import android.app.Activity;
import android.content.Context;
import android.telephony.TelephonyManager;
class Main {
/**
* Gets the device's phone number as a String.
*/
static String getPhoneNumber(Activity activity) {
TelephonyManager tm = (TelephonyManager) activity
.getApplicationContext().getSystemService(
Context.TELEPHONY_SERVICE);
String phoneNumber = tm.getLine1Number();
return phoneNumber;
}
}