0

I'm trying to figure out how exactly (if it's possible) to replicate the way the camera app works on the Jelly Bean lock screen.

From the lock screen, I can swipe left and the camera app displays, if I swipe right, I have the ability to add widgets. Would it be possible to provide an activity in such a manner it can be added to the lock screen, or is this only available for the default camera app?

Kingamajick
  • 2,281
  • 1
  • 16
  • 19
  • It would be a feature of the lock screen, which is a user replacable component. So worst case you could write a lock screen that allows it. – Gabe Sechan Feb 05 '13 at 01:33
  • I wouldn't want to replace the entire lock screen to be able to add an extra activity to it. Out of interest is the ability to replace the lock screen something that's new in 4.2 as far as I was aware it wasn't replaceable unless you were using a custom rom before. – Kingamajick Feb 05 '13 at 01:46
  • Its been available since at least 1.6- the OEM of my first Android phone had a button that would automatically call 911 on the lock screen. I pocket dialed the cops 3 times in 1 day, had to replace it. – Gabe Sechan Feb 05 '13 at 01:54

1 Answers1

0

It's just another widgetCategory, namely keyguard, which enables widgets to be added to the lock-screen. See the documentation here.

You would define your appwidget-provider xml as follows:

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
   ...
   android:widgetCategory="keyguard|home_screen">
</appwidget-provider>
323go
  • 14,143
  • 6
  • 33
  • 41
  • That refers to a widget, what I'm looking to do is be able to add an activity from my application to the local screen in the manner the camera does rather than providing a widget. The camera app (at least appears too) actually launches, and allows swipe interaction among other things. I expect this is a special case specified by the OS, but I wanted to see if it was possible. – Kingamajick Feb 05 '13 at 01:44
  • It takes up the entire screen when added. Unless you need something that can't be handled by a RemoteView, this will fit the bill. – 323go Feb 06 '13 at 01:55