title: Android : Finding location using LAC and CID
body: <p>I got the values of Local Area Code(LAC) and Cell ID(CID) in my application. But i couldn't find the exact location using these values. I don't know what i am missing. Someone help me in this</p>
  
  <pre><code> m_manager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
      GsmCellLocation loc = (GsmCellLocation)m_manager.getCellLocation();
  if (loc != null)
  {
    // out.format("Location ");
  Toast.makeText(getApplicationContext(), "Location",Toast.LENGTH_LONG).show();
  
     if (loc.getCid() == -1) {
    // out.format("cid: unknown ");
  Toast.makeText(getApplicationContext(), "cid: unknown", Toast.LENGTH_LONG).show();
    } else {
    // out.format("cid: %08x ", loc.getCid());
  int location=loc.getCid();
  String str = Integer.toString(location);
  Toast.makeText(getApplicationContext(), str, Toast.LENGTH_LONG).show();
   }
  if (loc.getLac() == -1) {
    // out.format("lac: unknown\n");
  Toast.makeText(getApplicationContext(), "lac: unknown", Toast.LENGTH_LONG).show();
  } else {
    // out.format("lac: %08x\n", loc.getLac());
  int loca=loc.getLac();
  String str1 = Integer.toString(loca);
  Toast.makeText(getApplicationContext(),  str1, Toast.LENGTH_LONG).show();
  }
  </code></pre>