Code example for GsmCellLocation

Methods: getCid, getLac

0
	 
	public String getLocationGSM (){
		String [] ret = new String [2];		
		try{ 
			GsmCellLocation gsmLoc = (GsmCellLocation) tm.getCellLocation();
			return String.valueOf(gsmLoc.getCid())+","+String.valueOf(gsmLoc.getLac());	
		} 
		catch(Exception e){
			return "-1,-1"; 
		} 
	} 
 
 
    public synchronized void writeData ( String filename, String data){
    	Log.i(TAG, "On write data: "+filename);
        try{ 
                File root = Environment.getExternalStorageDirectory();
                if (root.canWrite()){
                		Log.i(TAG, "Ready to write");
                		File f = new File (root, filename);
                        FileWriter fw = new FileWriter(f, true);