Android 4.2 Widgets

joneden

Active Member
Licensed User
Hi All,

Has anyone tried to do one of the new 4.2 lock screen widgets yet? If so is there a way to compile the app for 4.1 and up while retaining the 4.2 widget?

Regards,

Jon
 

corwin42

Expert
Licensed User
Has anyone tried to do one of the new 4.2 lock screen widgets yet? If so is there a way to compile the app for 4.1 and up while retaining the 4.2 widget?

Just tried it. You only have to add the

B4X:
android:widgetCategory="keyguard|home_screen">

element to the Appwidget-provider xml in the Objects/res/xml folder and make the file read only and compile with the Rev17 android.jar.
 

Attachments

  • Screenshot_2012-11-16-17-54-21.jpg
    Screenshot_2012-11-16-17-54-21.jpg
    75.9 KB · Views: 808
Upvote 0

joneden

Active Member
Licensed User
Hi Corwin,

Such a nice simple upgrade :)

I was a little worried about the code compiled with API 17 running on Android 4.1 devices as well as 4.2 but it seems to work just fine.

Now if only I could get the widget to work 100% of the time :)

Best Regards,

Jon
 
Upvote 0

NeoTechni

Well-Known Member
Licensed User
How do we get the size of the widget?

Currently I get something weird like:
 

Attachments

  • lcar.jpg
    lcar.jpg
    85.3 KB · Views: 474
Upvote 0

Nickelgrass

Active Member
Licensed User
Can the Lockscreen Widget be treated like any other Widget? I am updating the widget from within a second service with callsubdelayed. Is there anything to consider? I mean because the widget is only actually there if the lockscreen is on.
 
Upvote 0
Top