package com.telepin.cellTower;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.CordovaInterface;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;

import android.content.Context;
import android.telephony.TelephonyManager;
import android.telephony.gsm.GsmCellLocation;
import android.util.Log;

import android.provider.Settings;

public class LocationInfo extends CordovaPlugin {

	/**
	 * Constructor.
	 */
	public LocationInfo() {
	}

	@Override
	public boolean execute(String action, JSONArray data,
			CallbackContext callbackContext) throws JSONException {

		if (action.equals("getCID")) {
			
			this.getCID(callbackContext);
			return true;
		}
		return false;

	}

	public void getCID(CallbackContext callbackContext) throws IOException {
		TelephonyManager tm = (TelephonyManager) this.cordova.getActivity()
				.getApplicationContext()
				.getSystemService(Context.TELEPHONY_SERVICE);
		GsmCellLocation location = (GsmCellLocation) tm.getCellLocation();
		int cellID = location.getCid();
		Log.i("Cell ID", cellID + "");
		callbackContext.success(cellID + "");
		callbackContext.error("Cell ID is null");
		

	}

}

@@ -1168,39 +1168,31 @@
 ;%0A%09%09
-Log.i(%22C
+if (c
 ell
- 
 ID
-%22, cellID + %22%22);%0A
+ != null) %7B%0A%09
 %09%09ca
@@ -1227,16 +1227,28 @@
  + %22%22);%0A
+%09%09%7D else %7B%0A%09
 %09%09callba
@@ -1285,16 +1285,17 @@
 ll%22);%0A%09%09
+%7D
 %0A%0A%09%7D%0A%0A%7D%0A

Update LocationInfo.java