public class AdfmfContainerUtilities
extends oracle.adf.model.datacontrols.device.BaseProxy
Modifier and Type | Class and Description |
---|---|
static class |
AdfmfContainerUtilities.STATUS_BAR_STYLE
The available colors that can be used with the setStatusBarColor API to configure the appearance of the status bar.
|
Constructor and Description |
---|
AdfmfContainerUtilities() |
Modifier and Type | Method and Description |
---|---|
static String |
addLocalNotification(MafNativeLocalNotificationOptions options)
Schedule a local notification
|
static String |
cancelLocalNotification(String notificationId)
Cancel a local notification
|
static int |
getApplicationIconBadgeNumber()
Get current badge value of on application icon
|
static oracle.adfmf.framework.ApplicationInformation |
getApplicationInformation()
Gets
ApplicationInformation object containing the information about the application. |
static FeatureInformation |
getFeatureById(String featureId)
Returns the feature information for the passed in feature id.
|
static FeatureInformation |
getFeatureByName(String featureName)
Returns the feature information for the passed in feature name.
|
static FeatureInformation[] |
getFeatures()
Gets an array of
FeatureInformation objects that provide information about the features that are available in this session of the MAF application and should be displayed on a custom springboard. |
static AdfmfContainerUtilities.STATUS_BAR_STYLE |
getStatusBarStyle()
Gets the status bar foreground color on iOS
|
static void |
gotoDefaultFeature()
Activates the default feature.
|
static void |
gotoFeature(String featureId)
Activates the feature with the given id.
|
static void |
gotoSpringboard()
Activates the springboard.
|
static void |
hideNavigationBar()
Hides navigation bar.
|
static void |
hideSpringboard()
Hides springboard.
|
static Object |
invokeContainerJavaScriptFunction(String featureId, String methodName, Object[] args)
Invokes a Javascript method with the given arguments on the specified feature.
|
static Object |
invokeContainerMethod(String className, String methodName, Object[] args)
Invokes a native method on the specified class with the given arguments.
|
static void |
resetApplication(String message)
Reset the application Calling this method will cause the application to be reset.
|
static void |
resetFeature(String featureId)
Resets the feature with the given id.
|
static void |
resetFeature(String featureId, boolean gotoTheFeature)
Resets the feature with the given id and optionally navigates to that feature.
|
static void |
sendEmail(java.util.HashMap options)
Display the device's e-mail interface, and optionally pre-populate certain fields.
|
static void |
sendSMS(java.util.HashMap options)
Display the device's text messaging (SMS) interface, and optionally pre-populate certain fields.
|
static void |
setApplicationIconBadgeNumber(int badge)
Set a badge on application icon
|
static void |
setStatusBarStyle(AdfmfContainerUtilities.STATUS_BAR_STYLE color)
Sets the status bar foreground color on iOS
|
static void |
showNavigationBar()
Shows navigation bar.
|
static void |
showPreferences()
Shows the preferences page.
|
static void |
showSpringboard()
Shows springboard.
|
static void |
toggleSpringboard()
Toggles the springboard.
|
public static int getApplicationIconBadgeNumber()
public static oracle.adfmf.framework.ApplicationInformation getApplicationInformation() throws AdfException
ApplicationInformation
object containing the information about the application. This can be used to get the application name for a custom springboard. Additional information such as vendor, version and application id are provided as well.
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { ApplicationInformation ai = AdfmfContainerUtilities.getApplicationInformation(); ... } catch(AdfException e) { // handle the exception }
ApplicationInformation
object containing application level metadata. This includes application name, vendor, version and application id.AdfException
public static FeatureInformation getFeatureById(String featureId) throws AdfException
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { FeatureInformation fi = AdfmfContainerUtilities.getFeatureById("feature.id"); } catch(AdfException e) { // handle the exception }
featureId
- The id of the feature to retrieveAdfException
- If featureId is null, blank, invalid or the logged in user is not authorized for the feature.public static FeatureInformation getFeatureByName(String featureName) throws AdfException
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { FeatureInformation fi = AdfmfContainerUtilities.getFeatureByName("feature.name"); } catch(AdfException e) { // handle the exception }
featureName
- Name of the feature to retrieveAdfException
public static FeatureInformation[] getFeatures() throws AdfException
FeatureInformation
objects that provide information about the features that are available in this session of the MAF application and should be displayed on a custom springboard. These features have already been filtered by the evaluation of constraints. These are the features that would normally be displayed on the default springboard.
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { FeatureInformation[] fia = null; fia = AdfmfContainerUtilities.getFeatures(); for(int f = 0; f < fia.length; ++f) { FeatureInformation fi = fia[i]; ... } } catch(AdfException e) { // handle the exception }
FeatureInformation
objects each representing a feature that is available. This will include the feature id, the feature name, a path to the feature icon and a path to the feature image. Normally a springboard will display the name of the feature and the image for that feature.AdfException
public static void gotoDefaultFeature()
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { AdfmfContainerUtilities.gotoDefaultFeature(); } catch(AdfException e) { // handle the exception }
public static void gotoFeature(String featureId) throws AdfException
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { AdfmfContainerUtilities.gotoFeature("feature.id"); } catch(AdfException e) { // handle the exception }
Note: This method must not be used to open a sliding window, only to switch to another non-sliding window feature. To display a sliding window use the AdfmfSlidingWindowUtilities
APIs.
featureId
- The id of the feature to activateAdfException
- If featureId is null, blank, invalid or the logged in user is not authorized for the feature.public static void gotoSpringboard()
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { AdfmfContainerUtilities.gotoSpringboard(); } catch(AdfException e) { // handle the exception }
public static void toggleSpringboard()
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... AdfmfContainerUtilities.toggleSpringboard();
public static void hideNavigationBar()
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { AdfmfContainerUtilities.hideNavigationBar(); } catch(Exception e) { // handle the exception }
public static void hideSpringboard()
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { AdfmfContainerUtilities.hideSpringboard(); } catch(Exception e) { // handle the exception }
public static Object invokeContainerJavaScriptFunction(String featureId, String methodName, Object[] args) throws AdfException
featureId
- The id of the feature on which to invoke the methodmethodName
- method nameargs
- array of arguments to be passed to methodAdfException
-(function() { if (!window.application) window.application = {}; application.testFunction = function() { var args = arguments; alert("APP ALERT " + args.length + " "); return "application.testFunction - passed"; }; })();
public void invokeApplicationJavaScriptFuntions(ActionEvent actionEvent) { AdfmfContainerUtilities.invokeContainerJavaScriptFunction("feature1", "application.testFunction", new Object[] {} ); AdfmfContainerUtilities.invokeContainerJavaScriptFunction("feature1", "application.testFunction", new Object[] {"P1"} ); AdfmfContainerUtilities.invokeContainerJavaScriptFunction("feature1", "application.testFunction", new Object[] {"P1", "P2"} ); }
APP ALERT 0 APP ALERT 1 APP ALERT 2
public static Object invokeContainerMethod(String className, String methodName, Object[] args)
className
- class name: Always specify fully qualified class name for both iOS and Android.methodName
- method nameargs
- array of arguments to be passed to methodpublic static void resetFeature(String featureId) throws AdfException
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { AdfmfContainerUtilities.resetFeature("feature.id"); } catch(AdfException e) { // handle the exception }
featureId
- The id of the feature to resetAdfException
- If featureId is null, blank, invalid or the logged in user is not authorized for the feature.public static void resetFeature(String featureId, boolean gotoTheFeature) throws AdfException
Example
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { AdfmfContainerUtilities.resetFeature("feature.id", false); }catch(AdfException e) { // handle the exception }
featureId
- The id of the feature to resetgotoTheFeature
- Whether or not to navigate to the featureAdfException
- If featureId is null, blank, invalid or the logged in user is not authorized for the feature.public static void sendEmail(java.util.HashMap options)
After this interface is displayed, user can choose to either send the e-mail or discard it. Note that it is not possible to automatically send the e-mail due to device/carrier restrictions; only the end user can actually send the e-mail. The device must also have at least one e-mail account configured to send e-mail; otherwise, an error will be displayed indicating that no e-mail accounts could be found.
Examples :
Populate an e-mail to 'john.doe@foo.com', copy 'jane.doe@bar.com', with the subject 'Test message', and the body 'This is a test message'
HashMap options = new HashMap(); options.put("to", "john.doe@foo.com"); options.put("cc", "jane.doe@bar.com"); options.put("subject", "Test message"); options.put("body", "This is a test message"); AdfmfContainerUtilities.sendEmail(options);Taking the same example, but now adding a BCC to 'mary.may@another.com' and 'lary.day@another.com' and attaching two files.
HashMap options = new HashMap(); options.put("to", "john.doe@foo.com"); options.put("cc", "jane.doe@bar.com"); options.put("bcc", "mary.may@another.com,lary.day@another.com"); options.put("subject", "Test message"); options.put("body", "This is a test message"); options.put("attachments", "path/to/file1.txt,path/to/file2.png"); AdfmfContainerUtilities.sendEmail(options);
options
- is a HashMap object with the following optional properties:
AdfException
public static void sendSMS(java.util.HashMap options)
Example:
Populate an SMS message to '1234567890' with the body 'This is a test message'
HashMap options = new HashMap(); options.put("to", "1234567890"); options.put("body", "This is a test message"); AdfmfContainerUtilities.sendSMS(options);
options
- is a HashMap object with the following optional properties:
AdfException
public static void setApplicationIconBadgeNumber(int badge)
badge
- the badge valuepublic static void showNavigationBar()
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { AdfmfContainerUtilities.showNavigationBar(); } catch(Exception e) { // handle the exception }
public static void showSpringboard()
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { AdfmfContainerUtilities.showSpringboard(); } catch(Exception e) { // handle the exception }
public static void showPreferences()
Example :
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { AdfmfContainerUtilities.showPreferences(); } catch(Exception e) { // handle the exception }
public static void resetApplication(String message)
import oracle.adfmf.framework.api.AdfmfContainerUtilties; ... try { AdfmfContainerUtilities.restartApplication("New content is available."); } catch(Exception e) { // handle the exception }
message
- a message describing the reason the application is being restarted, or null if no message is requiredpublic static String addLocalNotification(MafNativeLocalNotificationOptions options) throws AdfException
options
- local notification options. See MafNativeLocalNotificationOptions
AdfException
- if there is an error scheduling notificationpublic static String cancelLocalNotification(String notificationId) throws AdfException
notificationId
- ID of the scheduled notification that is to be cancelledAdfException
- if there was an error canceling notificationpublic static void setStatusBarStyle(AdfmfContainerUtilities.STATUS_BAR_STYLE color)
The status bar foreground (text) color can be set to one of the allowed values as defined in the STATUS_BAR_STYLE enum. This API is functional only for iOS and invoking it on any other platform will be simply return.
The style may be one of the following values
color
- the new color to setpublic static AdfmfContainerUtilities.STATUS_BAR_STYLE getStatusBarStyle()
This method returns the current style of the status bar on iOS. This method is functional only when running on iOS. Invoking this method on any other platform will return null.