Best code examples for Android GsmCellLocation class (android.telephony.gsm.GsmCellLocation)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android GsmCellLocation class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android GsmCellLocation examples from Open Source projects
This code example shows how to use the following methods: getCid, getLac
    if ( cellLoc.getClass().getSimpleName().equals("CdmaCellLocation") ) {
      ListActivity.info("cell location changed: cdma: " + cellLoc);
    } 
    else if ( cellLoc instanceof GsmCellLocation) {
      GsmCellLocation gsmCell = (GsmCellLocation) cellLoc;
      ListActivity.info("cell location changed: gsm Cid: " + gsmCell.getCid());
      ListActivity.info("cell location changed: gsm Lac: " + gsmCell.getLac());
    } 
  } 
   
  public boolean isPhoneActive() { 
    return isPhoneActive;
  } 
   
  public int getStrength() { 
    return strength;
  } 
   
  public ServiceState getServiceState() {
    return serviceState;
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCid, getLac
		    if (location != null)
		    { 
		    	if (location instanceof GsmCellLocation)
		    	{ 
		    		GsmCellLocation gsmLoc = (GsmCellLocation) location;
			        Log.i(TAG, "Detected cell LAC: " + gsmLoc.getLac() + " CID: " + gsmLoc.getCid());
			        cell = new CellLogEntry(gsmLoc.getCid(), gsmLoc.getLac());
		    	} 
		    	else if (location instanceof CdmaCellLocation)
		    	{ 
		    		CdmaCellLocation cdmaLoc = (CdmaCellLocation) location;
			        Log.i(TAG, "Detected cell NID: " + cdmaLoc.getNetworkId() + " BID: " + cdmaLoc.getBaseStationId());
			        cell = new CellLogEntry(cdmaLoc.getBaseStationId(), cdmaLoc.getNetworkId());
		    	} 
		    } 
	    	else 
	    	{ 
		        Log.i(TAG, "Unknown phone type " + telephony.getPhoneType());
	    	} 
		} 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getCid, getLac
This code example shows how to use the following methods: getCid, getLac
		} 
		 
		/** CellID Lookup **/	 
		GsmCellLocation location = (GsmCellLocation) telephonyManager.getCellLocation();
		try { 
		int cid = location.getCid();
		int lac = location.getLac();
		if (Integer.toString(cid) != null && Integer.toString(lac) != null) {
			Log.v("CellID Information", Integer.toString(cid));
			Log.v("Location Area Code Information", Integer.toString(lac));
		} 
		} 
		catch (NullPointerException e) {
			String err = (e.getMessage()==null)?"CellID Information OR Location Area Code Information":e.getMessage();
			Log.e("GSMCellLocation Exception", err);
		} 
 
 
		 
		String networkOperator = telephonyManager.getNetworkOperator();
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getCid, getLac, getPsc
Related Android GsmCellLocation Questions & Answers:
See Code Examples for Android GsmCellLocation Methods: