Android的屏幕保护程序示例code [英] Android Screen Saver Sample Code

查看:147
本文介绍了Android的屏幕保护程序示例code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找在Android屏幕保护程序的示例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?

我所看到的是定制的Andr​​oid屏幕保护程序(或休眠屏幕)

如果你的意思是创建您自己的锁   屏幕上,对于这个没有规定   在Android SDK

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

但我不明白这一点,因为我看到有这么多的屏幕保护程序在Android Market中的应用实例。

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

推荐答案

你真的是在谈论一个屏幕保护程序?或自定义锁屏?

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

自定义锁屏的OEM的皮肤像的HTC Sense的Motoblur,并通过修改Android平台本身完成。

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

有在市场上一些自定义锁屏也是如此。要做到这一点,你需要以下意图过滤器添加到的Andr​​oidManifest.xml 文件中的活动要作为一个锁屏使用:

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>

这样做,这样是一个黑客,因为一个对话框会弹出询问他要用(你或默认)哪一个用户。 <一href="https://market.android.com/details?id=com.google.$c$c.p.slideunlocker2&feature=search_result">Lock 2.0 是一个自定义锁屏的工作原理是这样的一个例子。

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.

这篇关于Android的屏幕保护程序示例code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆