Search code examples
androidtextviewalarmlockscreen

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


Solution

  • 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);