Introduction to android dynamic Wallpaper

Source: Internet
Author: User

When you go to the wallpaper modification settings page but haven't set

09-21 07:55:05. 575: INFO/System. out (1337): service onCreate
09-21 07:55:05. 614: INFO/System. out (1337): service onCreateEngine
09-21 07:55:05. 634: INFO/System. out (1337): MyEngine
09-21 07:55:05. 663: INFO/System. out (1337): onCreate
09-21 07:55:05. 746: INFO/System. out (1337): onSurfaceCreated
09-21 07:55:05. 753: INFO/System. out (1337): onSurfaceChanged
09-21 07:55:05. 785: INFO/System. out (1337): onVisibilityChanged

After you click Set wallpaper
09-21 07:55:19. 434: INFO/System. out (1337): onTouchEvent
09-21 07:55:19. 574: INFO/System. out (1337): onTouchEvent
09-21 07:55:20. 283: INFO/System. out (1337): service onCreateEngine
09-21 07:55:20. 294: INFO/System. out (1337): MyEngine
09-21 07:55:20. 304: INFO/System. out (1337): onCreate
09-21 07:55:20. 414: INFO/System. out (1337): onSurfaceCreated
09-21 07:55:20. 424: INFO/System. out (1337): onSurfaceChanged
09-21 07:55:20. 443: INFO/System. out (1337): onVisibilityChanged
09-21 07:55:20. 443: INFO/System. out (1337): onoffsetsChanged
09-21 07:55:20. 863: INFO/System. out (1337): onVisibilityChanged
09-21 07:55:21. 305: INFO/System. out (1337): onSurfaceDestoryed
09-21 07:55:21. 333: INFO/System. out (1337): onDestroy

Click on the wallpaper
09-21 07:55:34. 654: INFO/System. out (1337): onTouchEvent
09-21 07:55:34. 754: INFO/System. out (1337): onTouchEvent
09-21 07:55:34. 754: INFO/System. out (1337): onCommand

Start other programs to completely overwrite the screen
09-21 07:56:03. 855: INFO/System. out (1337): onTouchEvent
09-21 07:56:03. 884: INFO/System. out (1337): onTouchEvent
09-21 07:56:04. 494: INFO/System. out (1337): onVisibilityChanged

Set other wallpapers to replace your own wallpapers
09-21 07:56:34. 893: INFO/System. out (1337): onSurfaceDestoryed
09-21 07:56:34. 893: INFO/System. out (1337): onDestroy
09-21 07:56:34. 953: INFO/System. out (1337): service onDestory

Next, let's talk about how to add your own settings so that you can configure the desktop dynamic effect setting interface.
Let's take a look at the content under the <application> label in the mainfest file.

<Service android: label = "@ string/app_name" android: name = ". wallpaperKing "android: permission =" android. permission. BIND_WALLPAPER "> <intent-filter> <action android: name =" android. service. wallpaper. wallpaperService "/> </intent-filter> <meta-data android: name =" android. service. wallpaper "android: resource =" @ xml/livewallpaper "/> </service> <activity android: name = ". settingsActivity "android: label =" @ string/app_name "android: exported =" true "> </activity>

Android: permission = "android. permission. BIND_WALLPAPER" declares a permission.
<Action android: name = "android. service. wallpaper. WallpaperService" indicates what service you are using.
The activity is our configuration l interface. What is the content in it? It is what you want to imagine. Note that android: exported = "true" must be set, otherwise, after the consequences, you will be done...
It is best to add

<Uses-feature android: name = "android. software. live_wallpaper"/>

Focus again:
We all know that Wallpaper has a configuration file under the res/xml directory, that is, android: resource = "@ xml/livewallpaper" in maifest.

Let's take a look at the livewallpaper. xml content in the example:

<? Xml version = "1.0" encoding = "UTF-8"?> <Wallpaper // This is a statement, as written on the line xmlns: android = "http://schemas.android.com/apk/res/android" // here is a declaration of a set interface, android: settingsActivity = "com. kris. wallpaper. settingsActivity "// This is the thumbnail android: thumbnail =" @ drawable/thumb_icon "/>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.