Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. }
  2.  
  3. GsmCellLocation cellLocation = (GsmCellLocation) telephonyManager.getCellLocation();
  4. String networkOperator = telephonyManager.getNetworkOperator();
  5. String networOperatorName = telephonyManager.getNetworkOperatorName();
  6. String networkTyInfo = String.valueOf(telephonyManager.getNetworkType());
  7.  
  8.  
  9. int mnc = 0, mcc = 0;
  10. if (!TextUtils.isEmpty(networkOperator)) {
  11. mcc = Integer.parseInt(networkOperator.substring(0, 3));
  12. mnc = Integer.parseInt(networkOperator.substring(3));
  13. }
  14. int cid =0;
  15. int lac = 0;
  16. if (cellLocation != null) {
  17. cid = cellLocation.getCid();
  18. lac = cellLocation.getLac();
  19. }
  20.  
  21. GSMValues gsmValues = new GSMValues(String.valueOf(lac), String.valueOf(mcc), String.valueOf(mnc), String.valueOf(cid), String.valueOf(0),networkTyInfo,signalStrength,networOperatorName);
  22. // db = new DatabaseHelper(getApplicationContext());
  23.  
  24. // db.StoreLocations(gsmValues);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement