JohnC Expert Licensed User Longtime User Jan 20, 2023 #1 I am running B4A 9.01 (yeah, I know it's older, but I don't have time to spend fixing 'gotchas' in all my projects if I update to 12.x). I want to create a widget for an android 5.x device, so I downloaded the example from this page: Android home screen widgets tutorial - part I Edit: widgets are handled with receivers now. See the attached example. This tutorial will explain how to implement your own home screen widgets (also named App Widgets). It is important to understand that the widgets are created and managed in another process, different than the process that... www.b4x.com But when I try to compile it, I get the error "Error description: CreateRemoteViews can only be called inside a Service module.". And if I try to run this example: Widget Layout (Resizable, Adaptive) Not sure if this can be considered a Tutorial, my first attempt. Lately I started to play with Widgets, mostly for curiosity. The main problem I encountered was how to design the Layout to make it resizable and make the content to adapt automatically to size changes. Unluckily designing a widget... www.b4x.com I will get the error: B4X: Copy Error description: Object reference not set to an instance of an object. Error occurred on line: 11 rv = ConfigureHomeWidget("4x1", "rv", 30, "Time in Letters", True) Word: ) If this error is due to my version of B4A being older, how can I obtain a copy of the older widget example that will work with B4A 9.01? Last edited: Jan 20, 2023
I am running B4A 9.01 (yeah, I know it's older, but I don't have time to spend fixing 'gotchas' in all my projects if I update to 12.x). I want to create a widget for an android 5.x device, so I downloaded the example from this page: Android home screen widgets tutorial - part I Edit: widgets are handled with receivers now. See the attached example. This tutorial will explain how to implement your own home screen widgets (also named App Widgets). It is important to understand that the widgets are created and managed in another process, different than the process that... www.b4x.com But when I try to compile it, I get the error "Error description: CreateRemoteViews can only be called inside a Service module.". And if I try to run this example: Widget Layout (Resizable, Adaptive) Not sure if this can be considered a Tutorial, my first attempt. Lately I started to play with Widgets, mostly for curiosity. The main problem I encountered was how to design the Layout to make it resizable and make the content to adapt automatically to size changes. Unluckily designing a widget... www.b4x.com I will get the error: B4X: Copy Error description: Object reference not set to an instance of an object. Error occurred on line: 11 rv = ConfigureHomeWidget("4x1", "rv", 30, "Time in Letters", True) Word: ) If this error is due to my version of B4A being older, how can I obtain a copy of the older widget example that will work with B4A 9.01?
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2023 #2 This is a complete waste of time to use B4A v9.01. The old example won't work not because of the B4A version but because it uses features no longer allowed by Android. Upvote 0
This is a complete waste of time to use B4A v9.01. The old example won't work not because of the B4A version but because it uses features no longer allowed by Android.
JohnC Expert Licensed User Longtime User Jan 22, 2023 #3 I just wanted to know if there was a quick way to get the older example because the device is android 5.0 as stated, but I did forget to mention that this will be a personal app, so the app is not bound by any restrictions of posting in google play store or newer android versions. My main objective of getting this code is to see if I could use a webview in a widget, but it looks like I can't, so it's a moot point at this time. NOTE: I understand your recommendation to use B4A 12, but I just don't have any spare time right now to "fix" things after I do the upgrade that are currently not broken with B4A 9.01. When I have some time to kill, I'll upgrade, I promise Last edited: Jan 22, 2023 Upvote 0
I just wanted to know if there was a quick way to get the older example because the device is android 5.0 as stated, but I did forget to mention that this will be a personal app, so the app is not bound by any restrictions of posting in google play store or newer android versions. My main objective of getting this code is to see if I could use a webview in a widget, but it looks like I can't, so it's a moot point at this time. NOTE: I understand your recommendation to use B4A 12, but I just don't have any spare time right now to "fix" things after I do the upgrade that are currently not broken with B4A 9.01. When I have some time to kill, I'll upgrade, I promise
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2023 #4 JohnC said: My main objective of getting this code is to see if I could use a webview in a widget but it looks like I can't, Click to expand... That's true. Upvote 0
JohnC said: My main objective of getting this code is to see if I could use a webview in a widget but it looks like I can't, Click to expand... That's true.