Hello , im wishing to make an app that will do things based on what cell tower im connected to , is it possible using b4a to get the current cellid?
Dim Obj1 As Reflector
Dim cid, lac As Int
Obj1.Target = Obj1.GetContext
Obj1.Target = Obj1.RunMethod2("getSystemService", "phone", "java.lang.String")
Obj1.Target = Obj1.RunMethod("getCellLocation") ' get a GsmCellLocation
cid = Obj1.RunMethod("getCid") ' gsm cell id
lac = Obj1.RunMethod("getLac") ' gsm location area code
None I'm afraid. If it worked before it should keep on
working.
nt = ph.GetNetworkType
Select nt
Case "EDGE", "GPRS", "HSDPA", "HSPA", "HSUPA", "UMTS"
Obj1.Target = Obj1.GetContext
Obj1.Target = Obj1.RunMethod2("getSystemService", "phone", "java.lang.String")
Obj1.Target = Obj1.RunMethod("getCellLocation") ' get a GsmCellLocation
cid = Obj1.RunMethod("getCid") ' gsm cell id
lac = Obj1.RunMethod("getLac") ' gsm location area code
End Select