Where can I find examples or tutorials about creating a custom android lockscreen?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 15:43:38

问题


I'm interested about Android and have been trying to find an example or tutorial about creating a custom lockscreen.

I wanna create new lock screen for easy accessibilities.

For example

  • fast access to camera.
  • fast access to phone dial.
  • Using Speech to unlock screen.

I want to design the lock screen for blind people.

This answer might be useful


回答1:


Have a look at this answer.

You need to write your own home screen app which will implement the lockscreen behaviour that you require. There is sample code for writing your own home screen app in the Android SDK(Source code).




回答2:


If you have the native source code, this is where Google has implemented the lock screen code

androidgingerbread/frameworks/base/policy/src/com/android/internal/policy/impl/LockScreen.java

This gets built into android.policy.jar. I would say the best way to achieve what you are trying is to write a new homescreen app with required features as stated above.




回答3:


As far as I know, Google hasn't released an API that allows you to change the lock-screen on un-rooted devices.




回答4:


Lock screen widgets were deprecated in Android 5.0 and above. To help fill the void, you can use the Adenda SDK. It extends the Android stack to let you design and program your layouts on the lock screen like you would with any other app, and feed them into the SDK.

For example:

AdendaAgent.addCustomFragmentContent (Context context, String actionToPerformOnUnlock, String your.fragment.name, Bundle fragmentArgs, String identifier, boolean bDisplayUntilCancelled)

I'm affiliated with Adenda for full disclosure




回答5:


I wrote a post about How to write simple Android Lock Screen

In short, you can run a service that contains BroadcastReceiver that will listen to any event of Intent.ACTION_SCREEN_OFF, then you can draw your custom Lock Screen on top of everything by using android.permission.SYSTEM_ALERT_WINDOW.



来源:https://stackoverflow.com/questions/7983143/where-can-i-find-examples-or-tutorials-about-creating-a-custom-android-lockscree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!