Android settings Live Wallpaper (wallpaper) description

Source: Internet
Author: User

When you go to the Settings page of the change wallpaper but not yet 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

When you click the Set wallpaper button
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 above
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 wallpaper instead of your own
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 set up the UI to configure the desktop dynamic effect if you add your own settings.
Let's take a look at the contents of my mainfest file <application> tags below

<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" is to declare a permission
<action android:name= "Android.service.wallpaper.WallpaperService This shows you what a service is.
One of the activity is our settings L interface, what is the specific content, is your own to imagine the place, pay attention to android:exported= "true" must be set, or the consequences of their own later, hey ...
Preferably in <manifest> Plus

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

Focus again:
We all know that wallpaper in the Res/xml directory, there is a configuration file, Maifest inside the android:resource= "@xml/livewallpaper" is configured here.

Take a look at the livewallpaper.xml content of the example:

<?xml version= "1.0" encoding= "Utf-8"?> < wallpaper//It's a statement, just write it. xmlns:android= "http://schemas.android.com /apk/res/android "//Here is the declaration of a setup interface, android:settingsactivity=" com.kris.wallpaper.SettingsActivity "//This is the thumbnail image of Android : thumbnail= "@drawable/thumb_icon"/>

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.