Bug? NB6 crashes Sony Xperia M5 hard, forcing phone reboot

Sandman

Expert
Licensed User
Longtime User
Does anyone encountered this issue with devices other than Galaxy S5 and Sony Xpreria M5?

Well, @JohnnyHamburg also mentioned Note 4 here. Other than that it seems it's not an overly common problem. (Or perhaps it's just difficult to bughunt and land on the bitmap icon in NB6?)

So what is the best strategy? Is it to simply add an IsCompatible to NB6 and check for these exact phones and it's one of them, set SupportLevel to S_OLD?

Or perhaps do what @woniol did, as described here? (Which seems to be an alternative solution to what @JordiCP came up with.)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is a problematic issue. It is an OS bug on a few devices running Android 6.

One of the reasons that I chose to limit NB6 to Android 6+ is to be able to use the new support for bitmaps. Working with bitmaps is much simpler than working with resources.

I need your help with finding the problematic devices.

NB6 v1.02 is attached.

See the code in IsIncompatibleDevice. It will log your device model. We then need to fill the map with the correct model names. I've just made a guess with the current values:
B4X:
Dim ProblematicDevices As Map = CreateMap("Samsung Galaxy S5": "", "Sony XPreria M5": "")
 

Attachments

  • NB6.bas
    12.8 KB · Views: 254

Sandman

Expert
Licensed User
Longtime User
I need your help with finding the problematic devices.

I'd love to help, but I just don't know how to do it in a way that's really helpful and provide good coverage of the problematic devices. I don't even get an exception to log and send to my server, it's a rock solid crash, so I can just act on anecdotal data that furious users report to me.

Would it be possible to use bitmaps and internally convert it to a resource? I realize this code from @woniol doesn't quite do that, but could something like this still be a solution? (I have no idea of the complexity of converting bitmaps to resources, sorry.)
B4X:
Private Sub CreateIconFromBitmap(bmp As Bitmap) As Object
    If bmp = Null Or bmp.IsInitialized = False Then Return 0
    Dim icon As JavaObject
    'Return icon.InitializeStatic("android.graphics.drawable.Icon").RunMethod("createWithBitmap", Array(bmp))
    Dim xml As XmlLayoutBuilder
    Return icon.InitializeStatic("android.graphics.drawable.Icon").RunMethod("createWithResource", Array(ctxt,xml.GetResourceId("drawable","icon")))
End Sub
 

Sandman

Expert
Licensed User
Longtime User
Do you have access to a device which crashes? Check the logs and find the logged model.

Yes, I do - a Sony Xperia M5.

B4X:
key: Sony E5603

So the strategy is pretty much to collect buggy devices over time and add them to ProblematicDevices?
 
Top