LocationManager and Jelly Bean

fanfalveto

Active Member
Licensed User
Longtime User
Is possible LocationManager don´t runs in Jelly Bean.I try this code with ICS and Gingerbrad and all is ok but with Jelly Bean don´t runs.
B4X:
'Service module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
Dim tiempo As Timer
Dim dat As leerdatos
Dim longitud As String
Dim latitud As String
Dim posicion As LocationManager
 Dim sms1 As PhoneSms
Dim funcio As String
Dim a As PhoneId
Dim serialsim As String
Dim serialsim2 As String
Dim numerosms As Int
Dim Sms As Sms
'Dim i As Intent
End Sub
Sub Service_Create
posicion.Initialize("posicion")
End Sub
Sub Service_Start (StartingIntent As Intent)
Try
funcio=dat.funciona
serialsim=dat.ids
Catch
StartActivity(Main)
End Try
Try
If funcio="1" Then
   numerosms=dat.numerollam   
   serialsim2=a.GetSimSerialNumber      
End If
Catch
End Try
posicion.requestMobileLocation
Try
If serialsim2<> serialsim Then
'   ToastMessageShow("mi serial: "&serialsim& " " &" otra: "&serialsim2,True)   
   tiempo.Initialize("tiempo1",7000)
   tiempo.Enabled=True
End If
Catch
End Try
End Sub
Sub tiempo1_Tick
'ToastMessageShow("a ver",False)
sms1.Send(numerosms,"Tengo tu movil "&CRLF&("http://maps.google.es/maps?hl=es&q=" & latitud & ",+" & longitud) )
numerosms=numerosms+1
'ToastMessageShow("enviado",False)
tiempo.Enabled=False
End Sub
Sub posicion_LocationChanged (Longitude As Double, Latitude As Double, Altitude As Double, Accuracy As Float, Bearing As Float, Provider As String, Speed As Float, Time As Long) 
   latitud=Latitude
   longitud=Longitude         
End Sub
Sub Service_Destroy
End Sub
 

jsanchezc

Member
Licensed User
Longtime User
I changed old phone with android 2.3 and now i have a Quechua,
same app, same compilation does work running with android 2.3
but not when running with new device:
LocationManager not working Jelly Beam:

** Activity (main) Create, isFirst = true **
LocationManager has been initialized.
** Activity (main) Resume **
problem setting interface quota


java.lang.IllegalStateException: command '1408 bandwidth setiquota rmnet0 9223372036854775807' failed with '400 1408 Bandwidth command failed'
at com.android.server.NetworkManagementService.setInterfaceQuota(NetworkManagementService.java:1370)
at com.android.server.net.NetworkPolicyManagerService.setInterfaceQuota(NetworkPolicyManagerService.java:1927)
at com.android.server.net.NetworkPolicyManagerService.updateNetworkRulesLocked(NetworkPolicyManagerService.java:1058)
at com.android.server.net.NetworkPolicyManagerService.access$1100(NetworkPolicyManagerService.java:169)
at com.android.server.net.NetworkPolicyManagerService$10.onReceive(NetworkPolicyManagerService.java:892)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:755)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)


Caused by: com.android.server.NativeDaemonConnector$NativeDaemonFailureException: command '1408 bandwidth setiquota rmnet0 9223372036854775807' failed with '400 1408 Bandwidth command failed'
at com.android.server.NativeDaemonConnector.execute(NativeDaemonConnector.java:349)
at com.android.server.NativeDaemonConnector.executeForList(NativeDaemonConnector.java:286)
at com.android.server.NativeDaemonConnector.execute(NativeDaemonConnector.java:252)
at com.android.server.NetworkManagementService.setInterfaceQuota(NetworkManagementService.java:1367)
... 9 more
** Activity (main) Pause, UserClosed = false **


** Activity (main) Resume **


** Activity (main) Pause, UserClosed = true **
 
Upvote 0

jsanchezc

Member
Licensed User
Longtime User
I add lines to Manifest and it seems work again:
AddPermission(android.permission.ACCESS_WIFI_STATE)
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.ACCESS_FINE_LOCATION)
 
Upvote 0

jsanchezc

Member
Licensed User
Longtime User
It seems problem is not solved, App (location by WiFi or Phone) works on my Quechua android4.1.2 but
do not work on LG same android 4.1.2
 
Upvote 0
Top