Cheok Yan Cheng
Cheok Yan Cheng

Reputation: 42870

Android Screen Saver Sample Code

I am looking for a sample code on Android Screen Saver. I tried google but hard to find any useful result. Does anyone have any good samples on that?

What I saw is Custom Android Screensaver (or sleep screen)

If you mean creating your own lock screen, there is no provision for this in the Android SDK

But I do not understand on this, as I saw there are so many screen saver application example in Android Market.

Upvotes: 9

Views: 15775

Answers (1)

dbyrne
dbyrne

Reputation: 61101

Are you really talking about a screensaver? Or a custom lock screen?

The custom lock screens for OEM skins like HTC Sense and Motoblur are done by modifying the Android platform itself.

There are some custom lock screens available in the market as well. To achieve this, you need to add the following intent filter to the AndroidManifest.xml file for the Activity you want to use as a lock screen:

<intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <category android:name="android.intent.category.HOME" />
  <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

Doing it this way is a hack because a dialog box will pop up asking the user which one he wants to use (yours or the default). Lock 2.0 is an example of a custom lock screen that works this way.

Upvotes: 8

Related Questions