public abstract class AndroidLiveWallpaperService
extends android.service.wallpaper.WallpaperService
Application interface dedicated for android live wallpapers.
Derive from this class. In the onCreateApplication() method call the
initialize(ApplicationListener) 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.| Modifier and Type | Class and Description |
|---|---|
class |
AndroidLiveWallpaperService.AndroidWallpaperEngine
Bridge between surface on which wallpaper is rendered and the wallpaper service.
|
SERVICE_INTERFACE, SERVICE_META_DATASTART_CONTINUATION_MASK, START_FLAG_REDELIVERY, START_FLAG_RETRY, START_NOT_STICKY, START_REDELIVER_INTENT, START_STICKY, START_STICKY_COMPATIBILITYACCESSIBILITY_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| Constructor and Description |
|---|
AndroidLiveWallpaperService() |
| Modifier and Type | Method and Description |
|---|---|
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)
|
void |
initialize(ApplicationListener listener,
AndroidApplicationConfiguration config)
This method has to be called in the
onCreateApplication() method. |
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.
|
getApplication, onConfigurationChanged, onLowMemory, onRebind, onStart, onStartCommand, onTaskRemoved, onTrimMemory, onUnbind, startForeground, stopForeground, stopSelf, stopSelf, stopSelfResultbindService, 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, 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, unregisterReceiverpublic 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)
listener - 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. 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()
Copyright © 2016. All rights reserved.