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

5

2

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

Earing answered 2/11, 2011 at 15:41 Comment(1)
possible duplicate of android how to develop custom lock screenAntiperiodic
T
9

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

Toul answered 2/11, 2011 at 16:36 Comment(0)
M
5

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.

Morphophonemics answered 2/11, 2011 at 17:24 Comment(1)
This appears to be outdated, as it was last updated for Froyo. I haven't been able to find the modern variants, except these layout files which don't appear to be referenced anywhere.Emplane
P
3

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

Perseid answered 2/11, 2011 at 15:45 Comment(0)
D
1

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

Detribalize answered 17/9, 2015 at 16:17 Comment(2)
Just linking to your own library or tutorial is not a good answer. Linking to it, explaining why it solves the problem, providing code on how to do so and disclaiming that you wrote it makes for a better answer. See: What signifies “Good” self promotion?Scutari
Thanks for the tip @durron597. Edited accordinglyCounterword
R
1

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.

Retrospection answered 14/12, 2016 at 8:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.