Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I interact with the Lockscreen layout to display text into it, like this app:

I just discovered this application : https://market.android.com/details?id=de.j4velin.lockscreenCalendar

It seem that is now possible to write some text inside the lockscreen in the place where the alarm is usually written.

I would like to display custom text on this place, but have totally no idea on how to achieve that.

This guy succeed to write calendar events at this place.

Thank a lot for any clue//snippet that would help me.

enter image description here

like image 509
Waza_Be Avatar asked Sep 27 '11 13:09

Waza_Be


3 Answers

This is astonishingly easy to achieve and astonishingly badly documented. All you need to do is set the alarm string in the system settings, as follows:

    String message = "This is a test";
    Settings.System.putString(context.getContentResolver(),
            Settings.System.NEXT_ALARM_FORMATTED, message);
like image 179
marc1s Avatar answered Sep 21 '22 08:09

marc1s


It is not the exact thing you asked for,but the code for custom lockscreen can be found here.It might help you.

http://code.google.com/p/contactowner/

like image 39
Hiral Vadodaria Avatar answered Sep 20 '22 08:09

Hiral Vadodaria


I've never come accross any legit way within the public android APIs to affect the lock screen. Without playing with that app at all I wouldn't know for sure, but my guess is he created that activity that allows him to show whatever text he wants. Then uses a receiver to listen for SCREEN_OFF, or SCREEN_ON events and starts his "lock" activity at that time.

It is worth noting: If you choose to do something like this to achieve the affect you're after, it is not going to behave the exact same as the lock screen. The differences may be fairly slight, and could end up being fine for your purposes but be aware that they are there. Also assuming you go this route it wouldn't work if the user has a "pattern" lock as the KeyguardManager is unable to disable that screen programmatically

like image 32
FoamyGuy Avatar answered Sep 22 '22 08:09

FoamyGuy