public abstract class Application extends javax.microedition.midlet.MIDlet implements IMDApplication, IMDApplicationListener
Modifier and Type | Field and Description |
---|---|
static boolean |
app_terminating
Is the app in a state where it's terminating?
|
static java.lang.String[] |
debug_strings |
static javax.microedition.lcdui.Display |
display
Current display object
|
static Application |
instance
Our instance
|
Constructor and Description |
---|
Application() |
Modifier and Type | Method and Description |
---|---|
boolean |
allowUnsecureSSLConnectionForURL(java.lang.String theURL)
Disable full SSL security checking for this URL
|
void |
changeAppDirectionality(int direction)
Changes the application directionality.
|
void |
changeSize(int new_width,
int new_height)
Changes the dimensions of the main window.
|
void |
debug(java.lang.String debug_string,
int debug_flag)
Debug some string either to the console or (optionally, on a flag) to an array which could be output to the screen
|
void |
destroyApp()
Destroys the application.
|
void |
destroyApp(boolean unconditional)
Application is destroyed
|
IMDApplicationListener |
getApplicationListener()
Gets current @link
IMDApplicationListener |
IPushNotificationListener |
getPushNotificationListener()
Gets current
IPushNotificationListener |
java.lang.Object |
getService(java.lang.Class clazz)
Returns a service instance for particular class
|
java.lang.Object |
getService(java.lang.String serviceName)
Returns a service instance for the particular service name.
|
java.lang.String |
getStartFileAbsolutepath()
Deprecated.
|
java.lang.String |
getStartFileMimeType()
Deprecated.
|
PushNotification |
getStartPushNotification()
Deprecated.
|
java.lang.String |
getStartScheme()
Deprecated.
|
java.lang.String |
getStartURL()
Deprecated.
|
boolean |
isRunningOnMDThread()
Checks if the current thread is the main one.
|
boolean |
nUIKeyPressed(int arg0) |
void |
onAppDestroyed()
Will be called just before the application is destroyed.
|
void |
onAppDirectionalityChanged(int arg0)
Will be called if the text directionality has been changed.
|
void |
onAppPaused()
Will be called when the application is going into the background.
|
void |
onAppResumed()
Will be called when the application is going back from the background to the foreground.
|
void |
onAppStarted()
Will be called after the application has been started.
|
void |
onSizeChanged(int width,
int height)
Will be called when the available size has been changed.
|
void |
onStartAppFromFile(java.lang.String mimeType,
java.lang.String absolutePath)
Deprecated.
|
void |
onStartAppFromPushNotification(PushNotification message)
Deprecated.
|
void |
onStartAppFromURL(java.lang.String scheme,
java.lang.String url)
Deprecated.
|
void |
onTouch(int arg0,
int arg1) |
void |
pauseApp()
Application is paused
|
void |
resumeApp()
Resumes the application.
|
void |
runAsync(ICallable task,
IResultCallback callback)
Runs the given
task asynchronously. |
void |
runAsync(ICallable task,
IResultCallback callback,
boolean runCallbackOnMainThread)
Runs the given
task asynchronously. |
void |
runAsync(java.lang.Runnable task)
Runs the given
task asynchronously. |
void |
runAsync(java.lang.Runnable task,
IResultCallback callback)
Runs the given
task asynchronously. |
void |
runAsync(java.lang.Runnable task,
IResultCallback callback,
boolean runCallbackOnMainThread)
Runs the given
task asynchronously. |
void |
runOnMDThread(java.lang.Runnable task)
Runs task on the main MD thread.
|
void |
runOnMDThreadAndWait(java.lang.Runnable task)
Runs task on the main MD thread and waits until it has been executed.
|
abstract void |
setAppCanvas()
Used to set the canvas class used for this application
|
IMDApplicationListener |
setApplicationListener(IMDApplicationListener listener)
Sets listener to receive Application events events.
|
IPushNotificationListener |
setPushNotificationListener(IPushNotificationListener listener)
Sets listener to receive Push Notification messages.
|
void |
startApp()
Application is started
|
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAppProperty, platformRequest
public static Application instance
public static javax.microedition.lcdui.Display display
public static boolean app_terminating
public static java.lang.String[] debug_strings
public void onStartAppFromURL(java.lang.String scheme, java.lang.String url)
IMDApplicationListener.onStartAppFromURL(String, String)
insteadgetStartScheme()
or
getStartURL()
, you must include a call to super.onStartAppFromURL(scheme, url)
from your override.onStartAppFromURL
in interface IMDApplicationListener
scheme
- - URI schemeurl
- - URL that caused this callpublic void onStartAppFromFile(java.lang.String mimeType, java.lang.String absolutePath)
IMDApplicationListener.onStartAppFromFile(String, String)
insteadgetStartFileMimeType()
or
getStartFileAbsolutepath()
, you must include a call to
super.onStartAppFromFile(mimeType, absolutePath)
from your override.onStartAppFromFile
in interface IMDApplicationListener
mimeType
- - MIME-type of the fileabsolutePath
- - absolute path to the native file. This path can be used in Connector.openInputStream() to read file's content.public void onStartAppFromPushNotification(PushNotification message)
IMDApplicationListener.onStartAppFromPushNotification(PushNotification)
insteadonStartAppFromPushNotification
in interface IMDApplicationListener
message
- - the Push Notification that user has clicked onpublic PushNotification getStartPushNotification()
public java.lang.String getStartFileAbsolutepath()
public java.lang.String getStartFileMimeType()
public java.lang.String getStartScheme()
public java.lang.String getStartURL()
public IPushNotificationListener setPushNotificationListener(IPushNotificationListener listener)
setPushNotificationListener
in interface IMDApplication
listener
- - to send PN messagespublic IPushNotificationListener getPushNotificationListener()
IMDApplication
IPushNotificationListener
getPushNotificationListener
in interface IMDApplication
IPushNotificationListener
or null
if it hasn't been set.public abstract void setAppCanvas()
public void startApp()
startApp
in interface IMDApplication
startApp
in class javax.microedition.midlet.MIDlet
public void pauseApp()
pauseApp
in interface IMDApplication
pauseApp
in class javax.microedition.midlet.MIDlet
public void resumeApp()
IMDApplication
resumeApp
in interface IMDApplication
public void destroyApp()
IMDApplication
destroyApp
in interface IMDApplication
public void destroyApp(boolean unconditional)
destroyApp
in class javax.microedition.midlet.MIDlet
public void changeSize(int new_width, int new_height)
IMDApplication
changeSize
in interface IMDApplication
public void changeAppDirectionality(int direction)
IMDApplication
changeAppDirectionality
in interface IMDApplication
direction
- - can be nUIConstants.TEXT_DIRECTION_LTR
or nUIConstants.TEXT_DIRECTION_RTL
public void onTouch(int arg0, int arg1)
public boolean nUIKeyPressed(int arg0)
public java.lang.Object getService(java.lang.Class clazz)
IMDApplication
getService
in interface IMDApplication
clazz
- - the requested service.public java.lang.Object getService(java.lang.String serviceName)
IMDApplication
getService
in interface IMDApplication
serviceName
- - the requested service.public IMDApplicationListener setApplicationListener(IMDApplicationListener listener)
IMDApplication
setApplicationListener
in interface IMDApplication
listener
- - to send Application events to.public IMDApplicationListener getApplicationListener()
IMDApplication
IMDApplicationListener
getApplicationListener
in interface IMDApplication
IMDApplicationListener
or null
if it hasn't been set.public void debug(java.lang.String debug_string, int debug_flag)
public void onAppDestroyed()
IMDApplicationListener
onAppDestroyed
in interface IMDApplicationListener
public void onAppDirectionalityChanged(int arg0)
IMDApplicationListener
onAppDirectionalityChanged
in interface IMDApplicationListener
public void onAppPaused()
IMDApplicationListener
onAppPaused
in interface IMDApplicationListener
public void onAppResumed()
IMDApplicationListener
onAppResumed
in interface IMDApplicationListener
public void onAppStarted()
IMDApplicationListener
onAppStarted
in interface IMDApplicationListener
public void onSizeChanged(int width, int height)
IMDApplicationListener
onSizeChanged
in interface IMDApplicationListener
width
- - new withheight
- - new heightpublic boolean allowUnsecureSSLConnectionForURL(java.lang.String theURL)
allowUnsecureSSLConnectionForURL
in interface IMDApplication
theURL
- true
if the URL may bypass SSL security checks.public boolean isRunningOnMDThread()
IMDApplication
isRunningOnMDThread
in interface IMDApplication
public void runOnMDThread(java.lang.Runnable task)
IMDApplication
runOnMDThread
in interface IMDApplication
task
- - the task to execute.public void runOnMDThreadAndWait(java.lang.Runnable task)
IMDApplication
runOnMDThreadAndWait
in interface IMDApplication
task
- - the task to execute.public void runAsync(java.lang.Runnable task)
IMDApplication
task
asynchronously.runAsync
in interface IMDApplication
task
- - task to be executed in a new thread.public void runAsync(java.lang.Runnable task, IResultCallback callback)
IMDApplication
task
asynchronously.runAsync
in interface IMDApplication
task
- - task to be executed in a new thread.callback
- - callback to notify callers task has been finished with success or not. This will be called on main thread, which can access UI elements.public void runAsync(ICallable task, IResultCallback callback)
IMDApplication
task
asynchronously.runAsync
in interface IMDApplication
task
- - task to be executed in a new thread.callback
- - callback to notify callers task has been finished with success or not. This will be called on main thread, which can access UI elements.public void runAsync(java.lang.Runnable task, IResultCallback callback, boolean runCallbackOnMainThread)
IMDApplication
task
asynchronously.runAsync
in interface IMDApplication
task
- - the task will be executed in a new thread.callback
- - is used to notify if task has been finished.runCallbackOnMainThread
- - if true, the callback will run on the main thread, otherwise in the new created thread.public void runAsync(ICallable task, IResultCallback callback, boolean runCallbackOnMainThread)
IMDApplication
task
asynchronously.runAsync
in interface IMDApplication
task
- - the task will be executed in a new thread.callback
- - is used to notify if task has been finished.runCallbackOnMainThread
- - if true, the callback will run on the main thread.