|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.content.Context
android.content.ContextWrapper
android.app.Service
android.service.wallpaper.WallpaperService
com.badlogic.gdx.backends.android.AndroidLiveWallpaperService
public abstract class AndroidLiveWallpaperService
An implementation of the Application interface dedicated for android live wallpapers.
Derive from this class. In the onCreateApplication() method call the initialize(ApplicationListener, boolean)
method specifying the configuration for the GLSurfaceView. You can also use AndroidWallpaperListener
along with ApplicationListener to respond for wallpaper specific events in your app listener:
MyAppListener implements ApplicationListener, AndroidWallpaperListener
Notice:
Following methods are not called for live wallpapers:
ApplicationListener.pause()
ApplicationListener.dispose()
TODO add callbacks to AndroidWallpaperListener allowing to notify app listener about changed visibility
state of live wallpaper but called from main thread, not from GL thread:
for example:
AndroidWallpaperListener.visibilityChanged(boolean)
//obsoleted:
//Notice!
//You have to kill all not daemon threads you created in ApplicationListener.pause() method.
//ApplicationListener.dispose() is never called!
//If you leave live non daemon threads, wallpaper service wouldn't be able to close,
//this can cause problems with wallpaper lifecycle.
Notice #2!
On some devices wallpaper service is not killed immediately after exiting from preview. Service object
is destroyed (onDestroy called) but process on which it runs remains alive. When user comes back to wallpaper
preview, new wallpaper service object is created, but in the same process. It is important if you plan to
use static variables / objects - they will be shared between living instances of wallpaper services'!
And depending on your implementation - it can cause problems you were not prepared to.
| Nested Class Summary | |
|---|---|
class |
AndroidLiveWallpaperService.AndroidWallpaperEngine
Bridge between surface on which wallpaper is rendered and the wallpaper service. |
| Nested classes/interfaces inherited from class android.service.wallpaper.WallpaperService |
|---|
android.service.wallpaper.WallpaperService.Engine |
| Field Summary |
|---|
| Fields inherited from class android.service.wallpaper.WallpaperService |
|---|
SERVICE_INTERFACE, SERVICE_META_DATA |
| Fields inherited from class android.app.Service |
|---|
START_CONTINUATION_MASK, START_FLAG_REDELIVERY, START_FLAG_RETRY, START_NOT_STICKY, START_REDELIVER_INTENT, START_STICKY, START_STICKY_COMPATIBILITY |
| Fields inherited from class android.content.Context |
|---|
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_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, CLIPBOARD_SERVICE, CONNECTIVITY_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, 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 |
| Fields inherited from interface android.content.ComponentCallbacks2 |
|---|
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN |
| Constructor Summary | |
|---|---|
AndroidLiveWallpaperService()
|
|
| Method Summary | |
|---|---|
AndroidLiveWallpaper |
getLiveWallpaper()
|
android.view.SurfaceHolder |
getSurfaceHolder()
Getter for SurfaceHolder object, surface holder is required to restore gl context in GLSurfaceView |
android.view.WindowManager |
getWindowManager()
|
void |
initialize(ApplicationListener listener,
AndroidApplicationConfiguration config)
This method has to be called in the onCreateApplication() method. |
void |
initialize(ApplicationListener listener,
boolean useGL2IfAvailable)
Look at initialize(ApplicationListener, AndroidApplicationConfiguration)} |
void |
onCreate()
Service is starting, libGDX application is shutdown now |
void |
onCreateApplication()
libGDX application is starting, it occurs after first wallpaper engine had started. |
android.service.wallpaper.WallpaperService.Engine |
onCreateEngine()
One of wallpaper engines is starting. |
void |
onDeepPauseApplication()
Called when the last engine is ending its live, it can occur when: 1. |
void |
onDestroy()
Service is dying, and will not be used again. |
| Methods inherited from class android.service.wallpaper.WallpaperService |
|---|
onBind |
| Methods inherited from class android.app.Service |
|---|
getApplication, onConfigurationChanged, onLowMemory, onRebind, onStart, onStartCommand, onTaskRemoved, onTrimMemory, onUnbind, startForeground, stopForeground, stopSelf, stopSelf, stopSelfResult |
| Methods inherited from class android.content.ContextWrapper |
|---|
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, getExternalFilesDir, getFilesDir, getFileStreamPath, getMainLooper, getObbDir, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getTheme, 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, setTheme, setWallpaper, setWallpaper, startActivities, startActivities, startActivity, startActivity, startInstrumentation, startIntentSender, startIntentSender, startService, stopService, unbindService, unregisterReceiver |
| Methods inherited from class android.content.Context |
|---|
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AndroidLiveWallpaperService()
| Method Detail |
|---|
public void onCreate()
onCreate in class android.service.wallpaper.WallpaperServicepublic android.service.wallpaper.WallpaperService.Engine onCreateEngine()
onCreateEngine in class android.service.wallpaper.WallpaperServicepublic void onCreateApplication()
initialize(ApplicationListener, AndroidApplicationConfiguration) from there.
public void initialize(ApplicationListener listener,
boolean useGL2IfAvailable)
initialize(ApplicationListener, AndroidApplicationConfiguration)}
listener - useGL2IfAvailable -
public void initialize(ApplicationListener listener,
AndroidApplicationConfiguration config)
onCreateApplication() method. It sets up all the things necessary to get
input, render via OpenGL and so on. If config.useGL20 is set the AndroidApplication will try to create an OpenGL ES 2.0
context which can then be used via Graphics.getGL20(). The GL10 and GL11 interfaces should not be
used when OpenGL ES 2.0 is enabled. To query whether enabling OpenGL ES 2.0 was successful use the
Graphics.isGL20Available() method. 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.). Do not change contents of this object after passing to this method!public android.view.SurfaceHolder getSurfaceHolder()
public void onDeepPauseApplication()
public void onDestroy()
onDestroy in class android.service.wallpaper.WallpaperServicepublic AndroidLiveWallpaper getLiveWallpaper()
public android.view.WindowManager getWindowManager()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||