Hi,
Want to share an experience that may help others save time.
I have a regular app and decided to Kiosk it following instructions from
https://www.b4x.com/android/forum/threads/device-owner-tasklock-kiosk-apps-2017.81765/#post-518018 and the app run flawless.
Made the app a Home Launcher Activity and restarted the device. Then I had some unexpected behaviors:
Moved the ClientKVS initialization to the Main activity and problem solved.
Moved the code to Main activity and got the same value: "". Seems the library was not operational yet.
So tried this at Main activity:
And after many lines of log the IMEI showed up!
Moved the code above to starter service and also worked.
That's it. Explanations and/or suggestions are welcome!
Want to share an experience that may help others save time.
I have a regular app and decided to Kiosk it following instructions from
https://www.b4x.com/android/forum/threads/device-owner-tasklock-kiosk-apps-2017.81765/#post-518018 and the app run flawless.
Made the app a Home Launcher Activity and restarted the device. Then I had some unexpected behaviors:
- Main module 'Sub Activity_Create' try to use a ClientKVS global variable declared at 'starter service' and initialized at 'Sub Service Create' but... it was not initialized!
Moved the ClientKVS initialization to the Main activity and problem solved.
- I get the IMEI from GetDeviceId (PhoneId library) to setup a global string variable in starter module 'Sub Service Create'.
Moved the code to Main activity and got the same value: "". Seems the library was not operational yet.
So tried this at Main activity:
B4X:
Dim pId As PhoneId
...
Do While pId.GetDeviceId.Length = 0
Log("GetDeviceId não retornou IMEI")
Loop
And after many lines of log the IMEI showed up!
Moved the code above to starter service and also worked.
That's it. Explanations and/or suggestions are welcome!