package com.plugin.CellLocation;

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

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 = "locationAction";

	int CID;

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

		PluginResult.Status status = PluginResult.Status.OK;
		try {
			if (action.equals(ACTION)) {
				CID = 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);
		location = (GsmCellLocation) tm.getCellLocation();
		int cellID = location.getCid();
		Log.i("Cell ID", cellID+"");
		return cellID;
	}

}

@@ -353,16 +353,48 @@
 l.Log;%0A%0A
+import org.apache.cordova.api;%0A%0A
 public c
@@ -496,19 +496,8 @@
 %22;%0A%0A
-%09int CID;%0A%0A
 %09@Ov
@@ -622,63 +622,8 @@
  %7B%0A%0A
-%09%09PluginResult.Status status = PluginResult.Status.OK;%0A
 %09%09tr
@@ -666,14 +666,23 @@
 %09%09%09%09
+int 
 CID = 
+this.
 getC
@@ -683,24 +683,26 @@
 s.getCID();%0A
+//
 %09%09%09%09Toast.ma
@@ -747,16 +747,18 @@
 D is %22+%0A
+//
 %09%09%09%09%09%09CI
@@ -1219,16 +1219,32 @@
 ICE);%0A%09%09
+GsmCellLocation 
 location

Solving errors