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();
		callbackContext.success(cellID + "");
	}

}

@@ -1134,11 +1134,15 @@
 ;%0A%09%09
-i
+I
 nt
+eger
  cel
@@ -1168,16 +1168,44 @@
 id();%0A%09%09
+%0A%09%09if (cellID != null) %7B%0A%09%09%09
 callback
@@ -1234,14 +1234,74 @@
  + %22%22);%0A
+%09%09%7D else %7B%0A%09%09%09callbackContext.error(%22Cell ID is null%22);%0A%09%09%7D%0A
 %09%7D%0A%0A%7D%0A

Update LocationInfo.java