Ohanian Active Member Licensed User Longtime User Oct 2, 2017 #1 Hello, i'm using this code to get cell info : Code: Copy Dim Cell As String Dim telMgr As JavaObject = GetContext.RunMethod("getSystemService", Array("phone")) Dim LstCellInfo As List = telMgr.RunMethod("getAllCellInfo", Null) If (LstCellInfo.Size > 0) Then Cell = LstCellInfo.Get(0) Log(Cell) End If the result is something like this : Code: Copy CellInfoWcdma:{mRegistered=YES mTimeStampType=oem_ril mTimeStamp=129299157826521ns CellIdentityWcdma:{ mMcc=432 mMnc=11 mLac=34200 mCid=2693318 mPsc=361 mUarfcn=0} CellSignalStrengthWcdma: ss=18 ber=62} is there any method to convert this string (Cell) to an object so i can access to the parameters (mMcc, mMnc & ...)?
Hello, i'm using this code to get cell info : Code: Copy Dim Cell As String Dim telMgr As JavaObject = GetContext.RunMethod("getSystemService", Array("phone")) Dim LstCellInfo As List = telMgr.RunMethod("getAllCellInfo", Null) If (LstCellInfo.Size > 0) Then Cell = LstCellInfo.Get(0) Log(Cell) End If the result is something like this : Code: Copy CellInfoWcdma:{mRegistered=YES mTimeStampType=oem_ril mTimeStamp=129299157826521ns CellIdentityWcdma:{ mMcc=432 mMnc=11 mLac=34200 mCid=2693318 mPsc=361 mUarfcn=0} CellSignalStrengthWcdma: ss=18 ber=62} is there any method to convert this string (Cell) to an object so i can access to the parameters (mMcc, mMnc & ...)?
stevel05 Expert Licensed User Longtime User Oct 2, 2017 #2 The returned value from LstCellInfo.Get(0) is a CellInfo Object, It is displaying the result of the toString method from CellInfo. If you Dim Cell As JavaObject instead of String, you will then be able to access it's methods. I don't know if there is an existing library that includes CellInfo. Upvote 0
The returned value from LstCellInfo.Get(0) is a CellInfo Object, It is displaying the result of the toString method from CellInfo. If you Dim Cell As JavaObject instead of String, you will then be able to access it's methods. I don't know if there is an existing library that includes CellInfo.
Ohanian Active Member Licensed User Longtime User Oct 2, 2017 #3 stevel05 said: The returned value from LstCellInfo.Get(0) is a CellInfo Object, It is displaying the result of the toString method from CellInfo. If you Dim Cell As JavaObject instead of String, you will then be able to access it's methods. I don't know if there is an existing library that includes CellInfo. Click to expand... Hi, here's the modified code, but the result of the methods is 0 : Code: Copy Dim Cell As JavaObject Cell = LstCellInfo.Get(0) Cell = Cell.RunMethod("getCellIdentity",Null) Log(Cell.RunMethod("getMcc",Null)) ' > 0 Log(Cell.RunMethod("getCid",Null)) ' > 0 Upvote 0
stevel05 said: The returned value from LstCellInfo.Get(0) is a CellInfo Object, It is displaying the result of the toString method from CellInfo. If you Dim Cell As JavaObject instead of String, you will then be able to access it's methods. I don't know if there is an existing library that includes CellInfo. Click to expand... Hi, here's the modified code, but the result of the methods is 0 : Code: Copy Dim Cell As JavaObject Cell = LstCellInfo.Get(0) Cell = Cell.RunMethod("getCellIdentity",Null) Log(Cell.RunMethod("getMcc",Null)) ' > 0 Log(Cell.RunMethod("getCid",Null)) ' > 0
DonManfred Expert Licensed User Longtime User Oct 2, 2017 #4 https://developer.android.com/reference/android/telephony/CellInfo.html Upvote 0