-3

please be a support, i have sent the lat/lngs obtained from my android to an apache tomcat server,running java for web using servlets and jsps. I wont to plot those obtained lat/lngs on the Google maps. can any body please tell me how should and can i do that. *Using servlets and jsps Thanks tons in advance.

  • Possible duplicate of [Programmatically obtain the phone number of the Android phone](http://stackoverflow.com/questions/2480288/programmatically-obtain-the-phone-number-of-the-android-phone) – Madhukar Hebbar Oct 19 '15 at 07:20
  • Please do not change a question once it has been answered. If you need a different answer, please ask a new question instead of modifying this one. – Mike Oct 19 '15 at 08:41

1 Answers1

0

try this. but some reason all mobile provider not give mobile number.

mobile no

public String getPhoneNO() {
    String phoneno = "";
    TelephonyManager tMgr = (TelephonyManager) context
            .getSystemService(Context.TELEPHONY_SERVICE);
    phoneno = tMgr.getLine1Number();
    if (phoneno != null) {
        return phoneno;
    }
    return "";
}

// Sim

public String getSim() {
    String phoneno = "";
    TelephonyManager tMgr = (TelephonyManager) context
            .getSystemService(Context.TELEPHONY_SERVICE);
    phoneno = tMgr.getSimOperatorName();
    if (phoneno != null) {
        return phoneno;
    }
    return "";
}
RDY
  • 613
  • 1
  • 9
  • 25