package com.plugin.CellLocation;

import org.apache.cordova.api;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.content.Context;
import android.telephony;
import android.util.Log;

import org.apache.cordova.api;

public class locationInfo extends CordovaPlugin {

	public static final String ACTION = "locationAction";

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

		try {
			if (action.equals(ACTION)) {
				int CID = this.getCID();
//				Toast.makeText(cordova.getActivity(), "Your CID is "+
//						CID, Toast.LENGTH_LONG).show();
				// callbackContext.success(CID);
				callbackContext.success();
				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) getSystemService(Context.TELEPHONY_SERVICE);
		GsmCellLocation location = (GsmCellLocation) tm.getCellLocation();
		int cellID = location.getCid();
		Log.i("Cell ID", cellID+"");
		return cellID;
	}

}

@@ -56,18 +56,79 @@
 dova.api
+.CallbackContext;%0Aimport org.apache.cordova.api.CordovaPlugin
 ;%0A
-
 import o
@@ -266,65 +266,96 @@
 hony
-;%0Aimport android.util.Log;%0A%0Aimport org.apache.cordova.api
+.TelephonyManager;%0Aimport android.telephony.gsm.GsmCellLocation;%0Aimport android.util.Log
 ;%0A%0Ap

Update locationInfo.java