package com.plugin.CellLocation;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
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;

public class locationInfo extends CordovaPlugin {

	public static final String ACTION = "sendCID";

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

		try {
			if (action.equals(ACTION)) {
				
				JSONObject r = new JSONObject();
				r.put("cid", this.getCID());
				callbackContext.success(r);
				return true;
			}
			callbackContext.error("Invalid action");
			return false;
		} catch (Exception e) {
			System.err.println("Exception: " + e.getMessage());
			callbackContext.error(e.getMessage());
			return false;
		}
	}

	private int getCID() 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+"");
		return cellID;
	}

}

@@ -111,16 +111,102 @@
 Plugin;%0A
+import org.apache.cordova.CordovaWebView;%0Aimport org.apache.cordova.CordovaInterface;%0A
 import o
@@ -459,16 +459,51 @@
 l.Log;%0A%0A
+import android.provider.Settings;%0A%0A
 public c
@@ -587,19 +587,225 @@
  = %22
-send
+get
 CID%22;%0A%0A
+%09 /**%0A     * Constructor.%0A     */%0A    public locationInfo() %7B%0A    %7D%0A    %0A    public void initialize(CordovaInterface cordova, CordovaWebView webView) %7B%0A        super.initialize(cordova, webView);%0A    %7D%0A    %0A
 %09@Ov
@@ -1030,24 +1030,27 @@
 %22, this.getC
+ell
 ID());%0A%09%09%09%09c
@@ -1313,14 +1313,13 @@
 %0A%0A%09p
-rivate
+ublic
  int
@@ -1323,16 +1323,19 @@
 int getC
+ell
 ID() thr

Update locationInfo.java