By Juergenkress-Oracle on Mar 13, 2013
During the AMIS ADF Masterclass I showed how to take a picture from
within an ADF Mobile application, attach it to an Email and send that
email out to several recipients. To top it of, I even added the GPS
coordinates to the subject, so you know where the picture was taken. And
all of that with the push of one single button. Sounds complicated ?
Well actually it is very simple.
There are two ways to interact with device services. One is by using the page Definition, the second is by using the API.
I decided not to use the pageDef, but to invoke the device datacontrol from java by using the API. Then it is also possible to invoke multiple actions in one java method. In this case I take a picture, get the coordinates and send an email.
How to take a picture ?
Taking a picture is easy. Just call the getPicture() method, and make sure (for this use case) to set Destination Type to File.
That takes care of taking the picture.
How to get the current coordinates ?
By invoking getCurrentPosition it is very easy to get the GPS coordinates. Simply call the getCurrentPosition() method, and you will get the current coordinates. The coordinates are refreshed every 60 seconds. Read the full article here.
For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.