Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Screen Saver Sample Code

Tags:

android

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.

like image 684
Cheok Yan Cheng Avatar asked Mar 10 '11 14:03

Cheok Yan Cheng


People also ask

How do I unlock my screen saver on Android?

To enable Screen saver, drag down from the top of your device's screen and tap the gear icon. On the “Settings” screen, tap “Display” in the “Device” section. Then, tap “Screen saver” on the “Display” screen. To turn on the “Screen saver“, tap the slider button on the right side of the screen.


1 Answers

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.

like image 77
dbyrne Avatar answered Nov 15 '22 20:11

dbyrne