public class AndroidApplication extends android.app.Activity implements AndroidApplicationBase
Application interface for Android. Create an Activity that derives from this class. In
the Activity.onCreate(Bundle) method call the initialize(ApplicationListener) method specifying the
configuration for the GLSurfaceView.Application.ApplicationType| Modifier and Type | Field and Description |
|---|---|
android.os.Handler |
handler |
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OKACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, AUDIO_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAPTIONING_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_ROUTER_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICEMINIMUM_SDKLOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_NONE| Constructor and Description |
|---|
AndroidApplication() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAndroidEventListener(AndroidEventListener listener)
Adds an event listener for Android specific event such as onActivityResult(...).
|
void |
addLifecycleListener(LifecycleListener listener) |
void |
debug(String tag,
String message) |
void |
debug(String tag,
String message,
Throwable exception) |
void |
error(String tag,
String message) |
void |
error(String tag,
String message,
Throwable exception) |
void |
exit() |
ApplicationListener |
getApplicationListener() |
android.view.Window |
getApplicationWindow()
Returns the Window associated with the application
|
Audio |
getAudio() |
Clipboard |
getClipboard() |
android.content.Context |
getContext()
The application or activity context
|
Array<Runnable> |
getExecutedRunnables()
The currently executed runnables
|
Files |
getFiles() |
Graphics |
getGraphics() |
android.os.Handler |
getHandler()
Returns the Handler object created by the application
|
AndroidInput |
getInput()
Returns the
AndroidInput object associated with this AndroidApplicationBase |
long |
getJavaHeap() |
Array<LifecycleListener> |
getLifecycleListeners()
Returns the
LifecycleListener array associated with this AndroidApplicationBase |
int |
getLogLevel() |
long |
getNativeHeap() |
Net |
getNet() |
Preferences |
getPreferences(String name) |
Array<Runnable> |
getRunnables()
A set of usable runnables
|
Application.ApplicationType |
getType() |
int |
getVersion() |
void |
initialize(ApplicationListener listener)
This method has to be called in the
Activity.onCreate(Bundle) method. |
void |
initialize(ApplicationListener listener,
AndroidApplicationConfiguration config)
This method has to be called in the
Activity.onCreate(Bundle) method. |
android.view.View |
initializeForView(ApplicationListener listener)
This method has to be called in the
Activity.onCreate(Bundle) method. |
android.view.View |
initializeForView(ApplicationListener listener,
AndroidApplicationConfiguration config)
This method has to be called in the
Activity.onCreate(Bundle) method. |
void |
log(String tag,
String message) |
void |
log(String tag,
String message,
Throwable exception) |
void |
onConfigurationChanged(android.content.res.Configuration config) |
void |
onWindowFocusChanged(boolean hasFocus) |
void |
postRunnable(Runnable runnable) |
void |
removeAndroidEventListener(AndroidEventListener listener)
Removes an event listener for Android specific event such as onActivityResult(...).
|
void |
removeLifecycleListener(LifecycleListener listener) |
void |
setLogLevel(int logLevel) |
void |
useImmersiveMode(boolean use)
Activates Android 4.4 KitKat's 'Immersive Mode' feature.
|
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dump, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishFromChild, getActionBar, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMenuInflater, getParent, getParentActivityIntent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, invalidateOptionsMenu, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isTaskRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onAttachedToWindow, onAttachFragment, onBackPressed, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onCreateView, onDetachedFromWindow, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNavigateUp, onNavigateUpFromChild, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onPreparePanel, onProvideAssistData, onRetainNonConfigurationInstance, onSearchRequested, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onWindowAttributesChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, recreate, registerForContextMenu, removeDialog, reportFullyDrawn, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setIntent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, shouldUpRecreateTask, showDialog, showDialog, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityForResult, startActivityForResult, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenuapplyOverrideConfiguration, getResources, getTheme, setThemebindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createDisplayContext, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getFilesDir, getFileStreamPath, getMainLooper, getObbDir, getObbDirs, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceivergetString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacksequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetWindowManager, runOnUiThread, startActivitypublic void initialize(ApplicationListener listener)
Activity.onCreate(Bundle) method. It sets up all the things necessary to get
input, render via OpenGL and so on. Uses a default AndroidApplicationConfiguration.listener - the ApplicationListener implementing the program logicpublic void initialize(ApplicationListener listener, AndroidApplicationConfiguration config)
Activity.onCreate(Bundle) method. It sets up all the things necessary to get
input, render via OpenGL and so on. You can configure other aspects of the application with the rest of the fields in the
AndroidApplicationConfiguration instance.listener - the ApplicationListener implementing the program logicconfig - the AndroidApplicationConfiguration, defining various settings of the application (use accelerometer,
etc.).public android.view.View initializeForView(ApplicationListener listener)
Activity.onCreate(Bundle) method. It sets up all the things necessary to get
input, render via OpenGL and so on. Uses a default AndroidApplicationConfiguration.
Note: you have to add the returned view to your layout!
listener - the ApplicationListener implementing the program logicpublic android.view.View initializeForView(ApplicationListener listener, AndroidApplicationConfiguration config)
Activity.onCreate(Bundle) method. It sets up all the things necessary to get
input, render via OpenGL and so on. You can configure other aspects of the application with the rest of the fields in the
AndroidApplicationConfiguration instance.
Note: you have to add the returned view to your layout!
listener - the ApplicationListener implementing the program logicconfig - the AndroidApplicationConfiguration, defining various settings of the application (use accelerometer,
etc.).public void onWindowFocusChanged(boolean hasFocus)
onWindowFocusChanged in interface android.view.Window.CallbackonWindowFocusChanged in class android.app.Activitypublic void useImmersiveMode(boolean use)
AndroidApplicationBaseuseImmersiveMode in interface AndroidApplicationBaseuse - Whether or not to use immersive modepublic ApplicationListener getApplicationListener()
getApplicationListener in interface Applicationpublic Audio getAudio()
getAudio in interface Applicationpublic Files getFiles()
getFiles in interface Applicationpublic Graphics getGraphics()
getGraphics in interface Applicationpublic AndroidInput getInput()
AndroidApplicationBaseAndroidInput object associated with this AndroidApplicationBasegetInput in interface ApplicationgetInput in interface AndroidApplicationBaseAndroidInput objectpublic Net getNet()
getNet in interface Applicationpublic Application.ApplicationType getType()
getType in interface Applicationpublic int getVersion()
getVersion in interface Applicationpublic long getJavaHeap()
getJavaHeap in interface Applicationpublic long getNativeHeap()
getNativeHeap in interface Applicationpublic Preferences getPreferences(String name)
getPreferences in interface Applicationpublic Clipboard getClipboard()
getClipboard in interface Applicationpublic void postRunnable(Runnable runnable)
postRunnable in interface Applicationpublic void onConfigurationChanged(android.content.res.Configuration config)
onConfigurationChanged in interface android.content.ComponentCallbacksonConfigurationChanged in class android.app.Activitypublic void exit()
exit in interface Applicationpublic void debug(String tag, String message)
debug in interface Applicationpublic void debug(String tag, String message, Throwable exception)
debug in interface Applicationpublic void log(String tag, String message)
log in interface Applicationpublic void log(String tag, String message, Throwable exception)
log in interface Applicationpublic void error(String tag, String message)
error in interface Applicationpublic void error(String tag, String message, Throwable exception)
error in interface Applicationpublic void setLogLevel(int logLevel)
setLogLevel in interface Applicationpublic int getLogLevel()
getLogLevel in interface Applicationpublic void addLifecycleListener(LifecycleListener listener)
addLifecycleListener in interface Applicationpublic void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener in interface Applicationpublic void addAndroidEventListener(AndroidEventListener listener)
public void removeAndroidEventListener(AndroidEventListener listener)
public android.content.Context getContext()
AndroidApplicationBasegetContext in interface AndroidApplicationBaseContextpublic Array<Runnable> getRunnables()
AndroidApplicationBasegetRunnables in interface AndroidApplicationBaseRunnable arraypublic Array<Runnable> getExecutedRunnables()
AndroidApplicationBasegetExecutedRunnables in interface AndroidApplicationBaseRunnable arraypublic Array<LifecycleListener> getLifecycleListeners()
AndroidApplicationBaseLifecycleListener array associated with this AndroidApplicationBasegetLifecycleListeners in interface AndroidApplicationBaseLifecycleListener'spublic android.view.Window getApplicationWindow()
AndroidApplicationBasegetApplicationWindow in interface AndroidApplicationBaseWindow associated with the applicationpublic android.os.Handler getHandler()
AndroidApplicationBasegetHandler in interface AndroidApplicationBaseHandler object created by the applicationCopyright © 2015. All rights reserved.