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

后端 未结 5 1063
再見小時候
再見小時候 2021-01-01 07:13

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 accessi

相关标签:
5条回答
  • 2021-01-01 07:29

    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

    0 讨论(0)
  • 2021-01-01 07:34

    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).

    0 讨论(0)
  • 2021-01-01 07:39

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

    0 讨论(0)
  • 2021-01-01 07:40

    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.

    0 讨论(0)
  • 2021-01-01 07:45

    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.

    0 讨论(0)
提交回复
热议问题