|
Post by egghead on Jun 8, 2022 9:42:06 GMT
I have a button in my app which calls Rho::NFCManager.enable
On clicking that button, the app built with Rho 7.5 exits when its run on an Android 12 device. However the same app runs fine in an old Android 6.0.1 (Cyanogen) device. Ditto on a more recent Android 11 device. Then I take that very same app and built it with Rho 7.2.2 and deploy again in Android 12 device. Now it runs fine.
So I conclude that there might be a bug in NFCManager in Rho 7.5. I could be wrong, though. Would be grateful if it could be investigated.
Thanks
|
|
|
Post by egghead on Jun 10, 2022 5:02:08 GMT
Another programmer in our team who uses Android Studio informed me that his app in which he used NFC feature was also crashing in Android 12 but not in Android < 12
He says that in Android 12 they had introduced a flag (immutable/non-immutable) in the intent. After setting it to immutable, his app is now working fine in Android 12
But how that relates to Rho 7.5 and how it doesn't to Rho 7.2.2 is beyond me.
But this information might be of some help. Hence this post.
|
|
|
Post by georgy on Jun 10, 2022 14:21:01 GMT
@eaghead It would be very helpful if you give me some example to work with.
|
|
|
Post by egghead on Jun 10, 2022 14:57:49 GMT
@eaghead It would be very helpful if you give me some example to work with. Well, I'm away from my dev PC right now, but as I said, I have a button on my index.erb labelled "Enable NFC", which calls Rho::NFCManager.enable Code is similar to what you'd find in the RhoApiSamples done several years ago and available on github Issue is observed for Android 12 only. Hope this helps. Thanks Addendum : model's index.erb: <INPUT type="button" value="Enable NFC" onClick="onEnable();"> Current NFC status : <input id="id_status" type="text" name="id_status" size="100%" style='border:none' readonly value="<%= $status %>"></input> <script type="text/javascript"> function onEnable() { $.get('/app/Nfc/do_enable', {}); } </script> Controller: def do_enable Rho::NFCManager.enable $status = Rho::NFCManager.is_enabled.to_s set_status($status) end def set_status(status) WebView.execute_js('setStatus("'+$status+'");') end
|
|
|
Post by georgy on Jun 14, 2022 23:31:26 GMT
|
|
|
Post by egghead on Jun 15, 2022 6:07:54 GMT
Thanks, it does not crash now. However, its now not reading the tag with code like Rho::NFCManager.get_current_Tag The device vibrates, but the tag isn't read
|
|
|
Post by georgy on Jun 24, 2022 15:32:57 GMT
egghead ok, we don't have device with android 12 and nfc for this task, so I need you to try again with new commit on same branch.
|
|
|
Post by georgy on Jul 1, 2022 15:46:46 GMT
|
|
|
Post by egghead on Jul 1, 2022 16:39:09 GMT
Sorry, couldn't check it out. Was on leave. Will try and do so ASAP. Thanks
|
|