Android Question Homescreen widgets and Receivers in version 12.2

Cebuvi

Active Member
Licensed User
Longtime User

Cebuvi

Active Member
Licensed User
Longtime User
The code in the old widget is in the Sub Service_Start and Sub Service_Destroy, where should I add it now?
 
Last edited:
Upvote 0

Alessandro71

Well-Known Member
Licensed User
Longtime User
since we can't assume Starter is running, all global data that usually is declared in it, should also be ported to the Receiver module, I think.
For example a SQLite database, should be opened, read and closed within the Receiver module?
 
Upvote 0

Alessandro71

Well-Known Member
Licensed User
Longtime User
True.

It doesn't mean that you need to duplicate code. You can implement it in a class and make an instance in the receiver class and in one of the B4XPages.
Since tapping the widget also opens the main app, there’s a chance that the widget will update while the app is in foreground.
this means the database object will be instantiated 2 times and the database file opened 2 times: since it was stated that the Database object should be a global, single one to guarantee concurrency, this is giving me headaches…
 
Upvote 0
Top