Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile
11g Release 2 (11.1.2.3.0)

E27204-01


oracle.adf.model.datacontrols.device
Class DeviceDataControl

java.lang.Object
  extended by oracle.adf.model.datacontrols.device.DeviceDataControl


public class DeviceDataControl
extends java.lang.Object

Master device data control class. Services such as Device Properties, Geolocation, and Camera are encapsulated in this class. This is also used directly by JDeveloper to expose these services at design time in the DataControl palette.


Constructor Summary
DeviceDataControl()
           

 

Method Summary
 Contact createContact(Contact aContact)
          Save a previously-created Contact to the device's address book.
 Contact[] findContacts(java.lang.String contactFields, java.lang.String filter, boolean multiple)
          Enables retrieval of one or more Contact objects matching the specified criteria.
 java.lang.String getPicture(int quality, int destinationType, int sourceType, boolean allowEdit, int encodingType, int targetWidth, int targetHeight)
          Provides access to the device's default camera application, which enables taking a picture or retrieving a previously-saved image See PhoneGap documentation for more details: http://docs.phonegap.com/en/1.0.0/phonegap_camera_camera.md.html#camera.getPicture
 void removeContact(Contact aContact)
          Remove a contact from the address book See PhoneGap documentation for more details: http://docs.phonegap.com/en/1.0.0/phonegap_contacts_contacts.md.html#Contacts
 void sendEmail(java.lang.String to, java.lang.String cc, java.lang.String subject, java.lang.String body, java.lang.String bcc, java.lang.String attachments, java.lang.String mimeTypes)
          Display the operating system's default UI for sending an e-mail, and optionally pre-populate certain fields.
 void sendSMS(java.lang.String to, java.lang.String body)
          Display the operating system's default UI for sending a text message, and optionally pre-populate certain fields
 void startLocationMonitor(boolean enableHighAccuracy, int updateInterval, java.lang.String locationListener)
          Register a callback to receive regular updates on the device's position
 Contact updateContact(Contact aContact)
          Update an existing Contact object.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

DeviceDataControl

public DeviceDataControl()

Method Detail

startLocationMonitor

public void startLocationMonitor(boolean enableHighAccuracy,
                                 int updateInterval,
                                 java.lang.String locationListener)
Register a callback to receive regular updates on the device's position
Parameters:
enableHighAccuracy - - provides a hint that the application would like to receive the best possible results (boolean)
updateInterval - - defines how often to retrieve the position in milliseconds.
locationListener - - The name of a bean method that will be invoked in response to a location update, e.g. "MyBean.myMethod". Do not use EL syntax, unless you truly want the result of evaluating that expression to become the name of the locationListener

createContact

public Contact createContact(Contact aContact)
Save a previously-created Contact to the device's address book. Note that you can create a Contact by simply instantiating one and setting its properties, but in order to persist it, you must call createContact. See PhoneGap documentation for more details: http://docs.phonegap.com/en/1.0.0/phonegap_contacts_contacts.md.html#Contacts
Parameters:
aContact - - a previously-constructed Contact object
Returns:
a Contact object. Note that you should always use the returned Contact object in subsequent operations, because this object will have the requisite primary key

updateContact

public Contact updateContact(Contact aContact)
Update an existing Contact object. Note that you can modify a Contact via its various properties and methods, but in order to persist the changes, you must call updateContact See PhoneGap documentation for more details: http://docs.phonegap.com/en/1.0.0/phonegap_contacts_contacts.md.html#Contacts
Parameters:
aContact - - the modified Contact object to persist in the device's address book.
Returns:
- the modified Contact object

removeContact

public void removeContact(Contact aContact)
Remove a contact from the address book See PhoneGap documentation for more details: http://docs.phonegap.com/en/1.0.0/phonegap_contacts_contacts.md.html#Contacts
Parameters:
aContact - - the Contact object to remove

findContacts

public Contact[] findContacts(java.lang.String contactFields,
                              java.lang.String filter,
                              boolean multiple)
Enables retrieval of one or more Contact objects matching the specified criteria. See PhoneGap documentation for more details: http://docs.phonegap.com/en/1.0.0/phonegap_contacts_contacts.md.html#Contacts
Parameters:
contactFields - - comma-delimited list of field names to match on, e.g. "name,address"
filter - - search criteria. Note that the search criteria is matched against all fields specified in contactFields, so if you specify "John", a Contact object will be matched if any of the fields specified in contactFields (e.g. name OR address OR phonenumber) contains the filter string
Returns:
an array of Contact objects. Note that each Contact object will ONLY contain the fields you specified in the contactFields parameter; all others will be empty/null.

sendSMS

public void sendSMS(java.lang.String to,
                    java.lang.String body)
Display the operating system's default UI for sending a text message, and optionally pre-populate certain fields
Parameters:
to - - recipient list (comma-separated)
body - - text of message

sendEmail

public void sendEmail(java.lang.String to,
                      java.lang.String cc,
                      java.lang.String subject,
                      java.lang.String body,
                      java.lang.String bcc,
                      java.lang.String attachments,
                      java.lang.String mimeTypes)
Display the operating system's default UI for sending an e-mail, and optionally pre-populate certain fields.
Parameters:
to - - recipient list (comma-separated)
cc - - carbon copy recipient list (comma-separated)
subject - - subject line
body - - text of e-mail
bcc - - blind carbon copy recipient list (comma-separated)
attachments - - list of files to attach (comma-separated). Must be specified as absolute filenames; use AdfmfJavaUtilities.getDirectoryPathRoot() to help determine absolute filename.
mimeTypes - - list of MIME types, specified in the same order as the list of attachments. Specify null to let the system automatically determine MIME types for all attachments, or leave blanks in the comma-separated list to indicate the system should determine the MIME type only for those selected attachments. Example: attachments = "www/foo.txt,www/bar.png", mimetypes = "text/plain," means the first attachment is of type text/plain, but the system should automatically determine the MIME type for the second one.

getPicture

public java.lang.String getPicture(int quality,
                                   int destinationType,
                                   int sourceType,
                                   boolean allowEdit,
                                   int encodingType,
                                   int targetWidth,
                                   int targetHeight)
Provides access to the device's default camera application, which enables taking a picture or retrieving a previously-saved image See PhoneGap documentation for more details: http://docs.phonegap.com/en/1.0.0/phonegap_camera_camera.md.html#camera.getPicture
Parameters:
quality - - Quality of saved image. Range is [0, 100]
destinationType - - Choose the format of the return value. 0 = DESTINATIONTYPE_DATA_URL = Return image as base64 encoded string 1 = DESTINATIONTYPE_FILE_URI = Return image as a filename URI, like "file:///absolute/path/to/image.png" DESTINATIONTYPE_FILE_URI is recommended to avoid exhausting device resources.
sourceType - - Where should the picture come from? 0 = SOURCETYPE_PHOTOLIBRARY = Device's photo library 1 = SOURCETYPE_CAMERA = Take a picture with the device's camera 2 = SOURCETYPE_SAVEDPHOTOALBUM = Device's saved photo album
allowEdit - - Allow simple editing of image before selection
encodingType - - Choose the encoding of the returned image file. 0 = ENCODING_TYPE_JPEG = JPEG image 1 = ENCODING_TYPE_PNG = PNG image
targetWidth - - Width in pixels to scale image. Must be used with targetHeight. Aspect ratio is maintained
targetHeight - - Height in pixels to scale image. Must be used with targetWidth. Aspect ratio is maintained
Returns:
a String representing either base64 image data or a file URI, depending on the value of destinationType

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile
11g Release 2 (11.1.2.3.0)

E27204-01


Copyright © 2012 Oracle. All Rights Reserved.