public class AndroidMini2DxGame
extends android.app.Activity
implements com.badlogic.gdx.backends.android.AndroidApplicationBase
Modifier and Type | Field and Description |
---|---|
protected com.badlogic.gdx.ApplicationLogger |
applicationLogger |
protected com.badlogic.gdx.backends.android.AndroidAudio |
audio |
protected com.badlogic.gdx.backends.android.AndroidClipboard |
clipboard |
protected com.badlogic.gdx.utils.Array<java.lang.Runnable> |
executedRunnables |
protected com.badlogic.gdx.backends.android.AndroidFiles |
files |
protected boolean |
firstResume |
protected AndroidMini2DxGraphics |
graphics |
android.os.Handler |
handler |
protected boolean |
hideStatusBar |
protected com.badlogic.gdx.backends.android.AndroidInput |
input |
protected com.badlogic.gdx.utils.SnapshotArray<com.badlogic.gdx.LifecycleListener> |
lifecycleListeners |
protected ApplicationListener |
listener |
protected int |
logLevel |
protected com.badlogic.gdx.backends.android.AndroidNet |
net |
protected com.badlogic.gdx.utils.Array<java.lang.Runnable> |
runnables |
protected boolean |
useImmersiveMode |
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK
ACCESSIBILITY_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_SERVICE
MINIMUM_SDK
Constructor and Description |
---|
AndroidMini2DxGame() |
Modifier and Type | Method and Description |
---|---|
void |
addAndroidEventListener(com.badlogic.gdx.backends.android.AndroidEventListener listener)
Adds an event listener for Android specific event such as
onActivityResult(...).
|
void |
addLifecycleListener(com.badlogic.gdx.LifecycleListener listener) |
protected android.widget.FrameLayout.LayoutParams |
createLayoutParams() |
protected void |
createWakeLock(boolean use) |
void |
debug(java.lang.String tag,
java.lang.String message) |
void |
debug(java.lang.String tag,
java.lang.String message,
java.lang.Throwable exception) |
void |
error(java.lang.String tag,
java.lang.String message) |
void |
error(java.lang.String tag,
java.lang.String message,
java.lang.Throwable exception) |
void |
exit() |
ApplicationListener |
getApplicationListener() |
com.badlogic.gdx.ApplicationLogger |
getApplicationLogger() |
android.view.Window |
getApplicationWindow() |
com.badlogic.gdx.Audio |
getAudio() |
com.badlogic.gdx.utils.Clipboard |
getClipboard() |
android.content.Context |
getContext() |
com.badlogic.gdx.utils.Array<java.lang.Runnable> |
getExecutedRunnables() |
com.badlogic.gdx.Files |
getFiles() |
com.badlogic.gdx.Graphics |
getGraphics() |
android.os.Handler |
getHandler() |
com.badlogic.gdx.backends.android.AndroidInput |
getInput() |
long |
getJavaHeap() |
com.badlogic.gdx.utils.SnapshotArray<com.badlogic.gdx.LifecycleListener> |
getLifecycleListeners() |
int |
getLogLevel() |
long |
getNativeHeap() |
com.badlogic.gdx.Net |
getNet() |
com.badlogic.gdx.Preferences |
getPreferences(java.lang.String name) |
com.badlogic.gdx.utils.Array<java.lang.Runnable> |
getRunnables() |
com.badlogic.gdx.Application.ApplicationType |
getType() |
int |
getVersion() |
protected void |
hideStatusBar(boolean hide) |
void |
initialize(ApplicationListener listener,
AndroidMini2DxConfig config)
This method has to be called in the
Activity.onCreate(Bundle)
method. |
void |
initialize(GameContainer game,
AndroidMini2DxConfig config)
This method has to be called in the
Activity.onCreate(Bundle)
method. |
android.view.View |
initializeForView(ApplicationListener listener,
AndroidMini2DxConfig config)
This method has to be called in the
Activity.onCreate(Bundle)
method. |
android.view.View |
initializeForView(GameContainer game,
AndroidMini2DxConfig config)
This method has to be called in the
Activity.onCreate(Bundle)
method. |
void |
log(java.lang.String tag,
java.lang.String message) |
void |
log(java.lang.String tag,
java.lang.String message,
java.lang.Throwable exception) |
protected void |
onActivityResult(int requestCode,
int resultCode,
android.content.Intent data) |
void |
onConfigurationChanged(android.content.res.Configuration config) |
protected void |
onDestroy() |
protected void |
onPause() |
protected void |
onResume() |
void |
onWindowFocusChanged(boolean hasFocus) |
void |
postRunnable(java.lang.Runnable runnable) |
void |
removeAndroidEventListener(com.badlogic.gdx.backends.android.AndroidEventListener listener)
Removes an event listener for Android specific event such as
onActivityResult(...).
|
void |
removeLifecycleListener(com.badlogic.gdx.LifecycleListener listener) |
void |
setApplicationLogger(com.badlogic.gdx.ApplicationLogger applicationLogger) |
void |
setLogLevel(int logLevel) |
void |
useImmersiveMode(boolean use) |
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, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onBackPressed, onChildTitleChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onCreateView, onDetachedFromWindow, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNavigateUp, onNavigateUpFromChild, onNewIntent, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onPreparePanel, onProvideAssistData, onRestart, onRestoreInstanceState, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onStart, onStop, onTitleChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, 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, unregisterForContextMenu
applyOverrideConfiguration, attachBaseContext, getResources, getTheme, setTheme
bindService, 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, unregisterReceiver
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks
protected AndroidMini2DxGraphics graphics
protected com.badlogic.gdx.backends.android.AndroidInput input
protected com.badlogic.gdx.backends.android.AndroidAudio audio
protected com.badlogic.gdx.backends.android.AndroidFiles files
protected com.badlogic.gdx.backends.android.AndroidNet net
protected com.badlogic.gdx.backends.android.AndroidClipboard clipboard
protected ApplicationListener listener
public android.os.Handler handler
protected boolean firstResume
protected final com.badlogic.gdx.utils.Array<java.lang.Runnable> runnables
protected final com.badlogic.gdx.utils.Array<java.lang.Runnable> executedRunnables
protected final com.badlogic.gdx.utils.SnapshotArray<com.badlogic.gdx.LifecycleListener> lifecycleListeners
protected int logLevel
protected com.badlogic.gdx.ApplicationLogger applicationLogger
protected boolean useImmersiveMode
protected boolean hideStatusBar
public void initialize(GameContainer game, AndroidMini2DxConfig 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 AndroidMini2DxConfig
instance.game
- the GameContainer
implementing the game logicconfig
- the AndroidMini2DxConfig
, defining various settings of
the application (use accelerometer, etc.).public void initialize(ApplicationListener listener, AndroidMini2DxConfig 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 AndroidMini2DxConfig
instance.listener
- the ApplicationListener
implementing the program logicconfig
- the AndroidMini2DxConfig
, defining various
settings of the application (use accelerometer, etc.).public android.view.View initializeForView(GameContainer game, AndroidMini2DxConfig config)
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!
game
- the GameContainer
implementing the game logicconfig
- the AndroidMini2DxConfig
, defining various settings of
the application (use accelerometer, etc.).public android.view.View initializeForView(ApplicationListener listener, AndroidMini2DxConfig 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.).protected android.widget.FrameLayout.LayoutParams createLayoutParams()
protected void createWakeLock(boolean use)
protected void hideStatusBar(boolean hide)
public void onWindowFocusChanged(boolean hasFocus)
onWindowFocusChanged
in interface android.view.Window.Callback
onWindowFocusChanged
in class android.app.Activity
public void useImmersiveMode(boolean use)
useImmersiveMode
in interface com.badlogic.gdx.backends.android.AndroidApplicationBase
protected void onPause()
onPause
in class android.app.Activity
protected void onResume()
onResume
in class android.app.Activity
protected void onDestroy()
onDestroy
in class android.app.Activity
public ApplicationListener getApplicationListener()
getApplicationListener
in interface com.badlogic.gdx.Application
public com.badlogic.gdx.Audio getAudio()
getAudio
in interface com.badlogic.gdx.Application
public com.badlogic.gdx.Files getFiles()
getFiles
in interface com.badlogic.gdx.Application
public com.badlogic.gdx.Graphics getGraphics()
getGraphics
in interface com.badlogic.gdx.Application
public com.badlogic.gdx.backends.android.AndroidInput getInput()
getInput
in interface com.badlogic.gdx.Application
getInput
in interface com.badlogic.gdx.backends.android.AndroidApplicationBase
public com.badlogic.gdx.Net getNet()
getNet
in interface com.badlogic.gdx.Application
public com.badlogic.gdx.Application.ApplicationType getType()
getType
in interface com.badlogic.gdx.Application
public int getVersion()
getVersion
in interface com.badlogic.gdx.Application
public long getJavaHeap()
getJavaHeap
in interface com.badlogic.gdx.Application
public long getNativeHeap()
getNativeHeap
in interface com.badlogic.gdx.Application
public com.badlogic.gdx.Preferences getPreferences(java.lang.String name)
getPreferences
in interface com.badlogic.gdx.Application
public com.badlogic.gdx.utils.Clipboard getClipboard()
getClipboard
in interface com.badlogic.gdx.Application
public void postRunnable(java.lang.Runnable runnable)
postRunnable
in interface com.badlogic.gdx.Application
public void onConfigurationChanged(android.content.res.Configuration config)
onConfigurationChanged
in interface android.content.ComponentCallbacks
onConfigurationChanged
in class android.app.Activity
public void exit()
exit
in interface com.badlogic.gdx.Application
public void debug(java.lang.String tag, java.lang.String message)
debug
in interface com.badlogic.gdx.Application
public void debug(java.lang.String tag, java.lang.String message, java.lang.Throwable exception)
debug
in interface com.badlogic.gdx.Application
public void log(java.lang.String tag, java.lang.String message)
log
in interface com.badlogic.gdx.Application
public void log(java.lang.String tag, java.lang.String message, java.lang.Throwable exception)
log
in interface com.badlogic.gdx.Application
public void error(java.lang.String tag, java.lang.String message)
error
in interface com.badlogic.gdx.Application
public void error(java.lang.String tag, java.lang.String message, java.lang.Throwable exception)
error
in interface com.badlogic.gdx.Application
public void setLogLevel(int logLevel)
setLogLevel
in interface com.badlogic.gdx.Application
public int getLogLevel()
getLogLevel
in interface com.badlogic.gdx.Application
public void setApplicationLogger(com.badlogic.gdx.ApplicationLogger applicationLogger)
setApplicationLogger
in interface com.badlogic.gdx.Application
public com.badlogic.gdx.ApplicationLogger getApplicationLogger()
getApplicationLogger
in interface com.badlogic.gdx.Application
public void addLifecycleListener(com.badlogic.gdx.LifecycleListener listener)
addLifecycleListener
in interface com.badlogic.gdx.Application
public void removeLifecycleListener(com.badlogic.gdx.LifecycleListener listener)
removeLifecycleListener
in interface com.badlogic.gdx.Application
protected void onActivityResult(int requestCode, int resultCode, android.content.Intent data)
onActivityResult
in class android.app.Activity
public void addAndroidEventListener(com.badlogic.gdx.backends.android.AndroidEventListener listener)
public void removeAndroidEventListener(com.badlogic.gdx.backends.android.AndroidEventListener listener)
public android.content.Context getContext()
getContext
in interface com.badlogic.gdx.backends.android.AndroidApplicationBase
public com.badlogic.gdx.utils.Array<java.lang.Runnable> getRunnables()
getRunnables
in interface com.badlogic.gdx.backends.android.AndroidApplicationBase
public com.badlogic.gdx.utils.Array<java.lang.Runnable> getExecutedRunnables()
getExecutedRunnables
in interface com.badlogic.gdx.backends.android.AndroidApplicationBase
public com.badlogic.gdx.utils.SnapshotArray<com.badlogic.gdx.LifecycleListener> getLifecycleListeners()
getLifecycleListeners
in interface com.badlogic.gdx.backends.android.AndroidApplicationBase
public android.view.Window getApplicationWindow()
getApplicationWindow
in interface com.badlogic.gdx.backends.android.AndroidApplicationBase
public android.os.Handler getHandler()
getHandler
in interface com.badlogic.gdx.backends.android.AndroidApplicationBase