Hi,
One user upgades Android to Lollipop and my app stop working indicating the atached error.
Many user has Android 5 and 5.1 without problem.
What could cause this?
I use this code:
B4X:
Dim p As Phone
Dim overall_data_state As Int
Dim cellular_data_state As Int
Dim wifi As Int = p.GetSettings ("wifi_on")
Dim airplane_mode As Int = p.GetSettings ("airplane_mode_on")
Dim manuf As String = p.Manufacturer
Dim model As String = p.Model
'Test the Cellular State
Select Case p.GetDataState
Case "CONNECTED"
cellular_data_state = 1
Case Else
'Captures the other possible states of "SUSPENDED" "DISCONNECTED" "CONNECTING"
cellular_data_state = 0
End Select
Hi,
One user upgades Android to Lollipop and my app stop working indicating the atached error.
Many user has Android 5 and 5.1 without problem.
What could cause this?
I use this code:
Let me guess: 100% of the users with this error use Samsung devices with Android 5.x
I had the same issue with p.GetDataState(). See here.
The "official" way that Google recommends to detect a data connection in a B4A implementation is here and it does not need the READ_PHONE_STATE permission, even on Samsung devices.
Let me guess: 100% of the users with this error use Samsung devices with Android 5.x
I had the same issue with p.GetDataState(). See here.
The "official" way that Google recommends to detect a data connection in a B4A implementation is here and it does not need the READ_PHONE_STATE permission, even on Samsung devices.
As Erel said, this is a special case because it is a bug in Samsungs Android 5.0 Firmware. If you look into the Android documentation you will see that READ_PHONE_STATE is not needed for Phone.GetDataState(). Unfortunately Samsung messed something up in their firmwares that requires this right. Only Samsung knows, why.