Use JAVA code to obtain some basic information about the mobile phone (the local number, SDK version, system version, and mobile phone model) and javasdk
The Code is as follows:
Package com. zzw. getPhoneInfos; import android. app. activity; import android. content. context; import android. OS. build; import android. OS. bundle; import android. telephony. telephonyManager; import android. util. log; public class MainActivity extends Activity {@ Override protected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. activity_main); // obtain the telephone management object TelephonyManager mTelephonyManager = (TelephonyManager) this. getSystemService (Context. TELEPHONY_SERVICE); // obtain the mobile phone number String phoneNumber = mTelephonyManager. getLine1Number (); Log. d ("Get local phone number --->", phoneNumber); // obtain the phone model String phoneModel = Build. MODEL; Log. d ("Get Mobile Phone model --->", phoneModel); // get the SDK version String phoneSdkVersion = Build. VERSION. SDK; Log. d ("Get SDK version --->", phoneSdkVersion); // obtain the system version String phoneReleaseVersion = Build. VERSION. RELEASE; Log. d ("Get mobile phone system version -->", phoneReleaseVersion );}}
Do not forget the permission:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Result