Android 4.2 Widgets

joneden

Active Member
Licensed User
Longtime 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
Longtime 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
    75.9 KB · Views: 1,047
Upvote 0

joneden

Active Member
Licensed User
Longtime 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
Longtime User
How do we get the size of the widget?

Currently I get something weird like:
 

Attachments

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

Nickelgrass

Active Member
Licensed User
Longtime 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

scsjc

Well-Known Member
Licensed User
Longtime User
hello everybody, can leave a sample with one widget on lockscreen. thanks.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…