oracle.adf.model.datacontrols.device
Interface DeviceManager

public interface DeviceManager

Interface that defines access to device-specific functionality, such as camera and GPS. Java code should make use of this interface via DeviceManagerFactory.getInstance(). Internally, the DeviceDataControl also makes use of this interface to fulfill requests for device side functionality.

startUpdatingPosition

Register a callback to receive regular updates on the device's position

Parameters:

updateInterval - - how often to retrieve the position in milliseconds.

enableHighAccuracy - - provides a hint that the application would like to receive the best possible results, even at increased power/computation expense (boolean)

watchID - - a unique identifier that can be used as a handle to subsequently stop listening for updates

callback - - An implementation of GeolocationCallback, which will be invoked at the specified updateInterval to deliver the device's location

Returns:

- A watchID that can be used at a later time to unsubscribe from location updates. This may potentially differ from the watchID that was passed in as a parameter, e.g. if an existing subscriber is already using the same watchID, so callers should always use the returned watchID

getPicture

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

createContact

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

findContacts

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.find

Parameters:

contactFields - - comma-delimited list of field names to match on, e.g. "id,displayName,name,nickname,phoneNumbers,emails,addresses,ims,organizations birthday,note,photos,categories,urls". Note that categories is always null in the return value on iOS and Android devices.

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

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. See PhoneGap documentation for more details.

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.

displayFile

Attempts to display file that is located on device. For a list of file types supported on iOS, see http://developer.apple.com/library/ios/#documentation /FileManagement/Conceptual /DocumentInteraction_TopicsForIOS/Articles/UsingtheQuickLookFramework.html On Android, this method attempts to open the file using an app associated with the file's MIME type. The MIME type is derived from the file extension. If no such app is installed, an error is displayed. The file path represents a URL on iOS and thus must be encoded. In particular, the iOS parser does not handle "+" as an encoding for space. Instead, "%20" must be used. Furthermore, if slashes are encoded to "%2F", then the leading slash must not be encoded. It must remain a slash.