-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.content.ComponentCallbacks2,android.view.Window.Callback,com.badlogic.gdx.Application,com.badlogic.gdx.backends.android.AndroidApplicationBase
public class AndroidDaydream extends DreamService implements AndroidApplicationBase
An implementation of the Application interface for Android. Create an Activity that derives from this class. In the Activity#onCreate(Bundle) method call the initialize method specifying the configuration for the GLSurfaceView.
-
-
Field Summary
Fields Modifier and Type Field Description protected AndroidInputinputprotected Handlerhandlerprotected final Array<Runnable>runnablesprotected final Array<Runnable>executedRunnablesprotected final SnapshotArray<LifecycleListener>lifecycleListenersprotected intlogLevelprotected ApplicationLoggerapplicationLogger
-
Method Summary
Modifier and Type Method Description AndroidInputgetInput()Returns the AndroidInput object associated with this AndroidApplicationBase HandlergetHandler()Returns the Handler object created by the application Array<Runnable>getRunnables()A set of usable runnables Array<Runnable>getExecutedRunnables()The currently executed runnables SnapshotArray<LifecycleListener>getLifecycleListeners()Returns the LifecycleListener array associated with this AndroidApplicationBase intgetLogLevel()voidsetLogLevel(int logLevel)ApplicationLoggergetApplicationLogger()voidsetApplicationLogger(ApplicationLogger applicationLogger)voidinitialize(ApplicationListener listener)This method has to be called in the Activity#onCreate(Bundle) method. voidinitialize(ApplicationListener listener, AndroidApplicationConfiguration config)This method has to be called in the Activity#onCreate(Bundle) method. ViewinitializeForView(ApplicationListener listener)This method has to be called in the Activity#onCreate(Bundle) method. ViewinitializeForView(ApplicationListener listener, AndroidApplicationConfiguration config)This method has to be called in the Activity#onCreate(Bundle) method. voidonDreamingStopped()voidonDreamingStarted()voidonDetachedFromWindow()ApplicationListenergetApplicationListener()Application.ApplicationTypegetType()intgetVersion()longgetJavaHeap()longgetNativeHeap()PreferencesgetPreferences(String name)voidpostRunnable(Runnable runnable)voidonConfigurationChanged(Configuration config)voidexit()voiddebug(String tag, String message)voiddebug(String tag, String message, Throwable exception)voidlog(String tag, String message)voidlog(String tag, String message, Throwable exception)voiderror(String tag, String message)voiderror(String tag, String message, Throwable exception)voidaddLifecycleListener(LifecycleListener listener)voidremoveLifecycleListener(LifecycleListener listener)ContextgetContext()The application or activity context WindowgetApplicationWindow()Returns the Window associated with the application AndroidAudiocreateAudio(Context context, AndroidApplicationConfiguration config)Returns the AndroidAudio to be used by the application AndroidInputcreateInput(Application activity, Context context, Object view, AndroidApplicationConfiguration config)Returns the AndroidInput to be used by the application voidrunOnUiThread(Runnable runnable)Method signifies an intent of the caller to execute some action on the UI Thread. voiduseImmersiveMode(boolean b)Activates Android 4.4 KitKat's 'Immersive Mode' feature. -
Methods inherited from class android.service.dreams.DreamService
addContentView, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, finish, getWindow, getWindowManager, isFullscreen, isInteractive, isScreenBright, onActionModeFinished, onActionModeStarted, onAttachedToWindow, onBind, onContentChanged, onCreate, onCreatePanelMenu, onCreatePanelView, onDestroy, onDetachedFromWindow, onDreamingStarted, onDreamingStopped, onMenuItemSelected, onMenuOpened, onPanelClosed, onPreparePanel, onSearchRequested, onUnbind, onWakeUp, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, requireViewById, setContentView, setFullscreen, setInteractive, setScreenBright, wakeUp -
Methods inherited from class android.app.Service
getApplication, getForegroundServiceType, onConfigurationChanged, onLowMemory, onRebind, onStart, onStartCommand, onTaskRemoved, onTimeout, onTrimMemory, startForeground, stopForeground, stopSelf, stopSelfResult -
Methods inherited from class android.content.ContextWrapper
bindIsolatedService, bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingOrSelfUriPermissions, checkCallingPermission, checkCallingUriPermission, checkCallingUriPermissions, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermissions, clearWallpaper, createAttributionContext, createConfigurationContext, createContext, createContextForSplit, createDeviceContext, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createWindowContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getAttributionSource, getAttributionTag, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDataDir, getDatabasePath, getDeviceId, getDir, getDisplay, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFileStreamPath, getFilesDir, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getParams, getResources, getSharedPreferences, getSystemService, getSystemServiceName, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, isUiContext, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerComponentCallbacks, registerDeviceIdChangeListener, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeSelfPermissionsOnKill, revokeUriPermission, sendBroadcast, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, startActivities, startActivity, startForegroundService, startInstrumentation, startIntentSender, startService, stopService, unbindService, unregisterComponentCallbacks, unregisterDeviceIdChangeListener, unregisterReceiver, updateServiceGroup -
Methods inherited from class android.content.Context
getColor, getColorStateList, getDrawable, getString, getSystemService, getText, obtainStyledAttributes, revokeSelfPermissionOnKill, sendBroadcastWithMultiplePermissions -
Methods inherited from class android.view.Window.Callback
onPointerCaptureChanged, onProvideKeyboardShortcuts -
Methods inherited from class com.badlogic.gdx.backends.android.AndroidApplicationBase
getWindowManager, startActivity -
Methods inherited from class com.badlogic.gdx.Application
addLifecycleListener, debug, error, exit, getApplicationListener, getApplicationLogger, getAudio, getClipboard, getFiles, getGraphics, getInput, getJavaHeap, getLogLevel, getNativeHeap, getNet, getPreferences, getType, getVersion, log, postRunnable, removeLifecycleListener, setApplicationLogger, setLogLevel -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getInput
AndroidInput getInput()
Returns the AndroidInput object associated with this AndroidApplicationBase
-
getHandler
Handler getHandler()
Returns the Handler object created by the application
-
getRunnables
Array<Runnable> getRunnables()
A set of usable runnables
-
getExecutedRunnables
Array<Runnable> getExecutedRunnables()
The currently executed runnables
-
getLifecycleListeners
SnapshotArray<LifecycleListener> getLifecycleListeners()
Returns the LifecycleListener array associated with this AndroidApplicationBase
-
getLogLevel
int getLogLevel()
-
setLogLevel
void setLogLevel(int logLevel)
-
getApplicationLogger
ApplicationLogger getApplicationLogger()
-
setApplicationLogger
void setApplicationLogger(ApplicationLogger applicationLogger)
-
initialize
void initialize(ApplicationListener listener)
This method has to be called in the Activity#onCreate(Bundle) method. It sets up all the things necessary to get input,render via OpenGL and so on. Uses a default AndroidApplicationConfiguration.
- Parameters:
listener- the ApplicationListener implementing the program logic
-
initialize
void initialize(ApplicationListener listener, AndroidApplicationConfiguration config)
This method has to be called in the 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.
- Parameters:
listener- the ApplicationListener implementing the program logicconfig- the AndroidApplicationConfiguration, defining various settings of the application (use accelerometer,etc.).
-
initializeForView
View initializeForView(ApplicationListener listener)
This method has to be called in the 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!
- Parameters:
listener- the ApplicationListener implementing the program logic
-
initializeForView
View initializeForView(ApplicationListener listener, AndroidApplicationConfiguration config)
This method has to be called in the 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!
- Parameters:
listener- the ApplicationListener implementing the program logicconfig- the AndroidApplicationConfiguration, defining various settings of the application (use accelerometer,etc.).
-
onDreamingStopped
void onDreamingStopped()
-
onDreamingStarted
void onDreamingStarted()
-
onDetachedFromWindow
void onDetachedFromWindow()
-
getApplicationListener
ApplicationListener getApplicationListener()
-
getType
Application.ApplicationType getType()
-
getVersion
int getVersion()
-
getJavaHeap
long getJavaHeap()
-
getNativeHeap
long getNativeHeap()
-
getPreferences
Preferences getPreferences(String name)
-
postRunnable
void postRunnable(Runnable runnable)
-
onConfigurationChanged
void onConfigurationChanged(Configuration config)
-
exit
void exit()
-
addLifecycleListener
void addLifecycleListener(LifecycleListener listener)
-
removeLifecycleListener
void removeLifecycleListener(LifecycleListener listener)
-
getContext
Context getContext()
The application or activity context
-
getApplicationWindow
Window getApplicationWindow()
Returns the Window associated with the application
-
createAudio
AndroidAudio createAudio(Context context, AndroidApplicationConfiguration config)
Returns the AndroidAudio to be used by the application
-
createInput
AndroidInput createInput(Application activity, Context context, Object view, AndroidApplicationConfiguration config)
Returns the AndroidInput to be used by the application
-
runOnUiThread
void runOnUiThread(Runnable runnable)
Method signifies an intent of the caller to execute some action on the UI Thread.
- Parameters:
runnable- The runnable to be executed
-
useImmersiveMode
void useImmersiveMode(boolean b)
Activates Android 4.4 KitKat's 'Immersive Mode' feature.
- Parameters:
b- Whether or not to use immersive mode
-
-
-
-