Create a broadcast event receiver and register this file in the manifest file, filtering the intent toAndroid.intent.action.PHONE_STATEIn the IntelliJ because did not prompt thought that does not have this, actually has, increases the permissionAndroid.permission.READ_PHONE_STATE
android:name=".receiver.CallReceiver">
android:name="android.intent.action.PHONE_STATE"/>
android:name="android.permission
The version number is set to 2 in Mainfest.xml today (the code gets the version number is invalid)Android:versioncode= "2"Android:versionname= "2.0"Actually through the code:Packagemanager manager = Mcontext.getpackagemanager (); = Manager.getpackageinfo (Mcontext.getpackagename (), 0); = info.versionname; = Info.versioncode;The detected version
of the default phone;So the direct use of Gsmphone.java in the Getdeviceid () method;Demo Code:Geminiphone Mgeminiphone;String Imei_sim1=mgeminiphone.getphonebyid (phoneconstants.gemini_sim_1). Getdeviceid ();String Imei_sim2=mgeminiphone.getphonebyid (phoneconstants.gemini_sim_2). Getdeviceid ();2) If you need to obtain the IMEI number in SDK development (third-party apk), use the Getdeviceid () method in Telephonymanager, or Getdeviceid in the Tele
There's really nothing to say ..., why do you have to do this ..., think it's fun ..., Google, the project teacher who wrote this interface to get Wifissid, has an aching egg.The methods for obtaining Wifissid are as follows:Android.net.wifi.WifiManager Mwifimanager = (wifimanager) MainActivity.this.getSystemService (Context.wifi_service) ; Android.net.wifi.WifiInfo mwifiinfo = Mwifimanager.getconnectioninfo (); String Currentwifissid = Mwifiinfo.getssid ();//Get current WifissidThink of everyth
This example shares the Android access to the mobile phone system version of information such as the method, for your reference, the specific contents are as follows:
The first type of code:
String Phoneinfo = "Product:" + Android.os.Build.PRODUCT;
Phoneinfo + = ", Cpu_abi:" + Android.os.Build.CPU_ABI;
Phoneinfo + = ", TAGS:" + Android.os.Build.TAGS; Phoneinfo = ", Version_codes. BASE: "+ Android.os.Build.VERSION_CODES."
BASE;
Phoneinfo + = "
Android Studio Right-click on the left-hand side of the open file to set the number of lines of code displayed, like Eclipse, 1. But there's a big difference here with Eclipse, and after Eclipse is set up, the rest of the files are also in effect, even if the number of rows reopened after the file is closed is still displayed, but in
(R.id.et_setup3_phonenumber); Bt_select_contact.setonclicklistener (this); bt_next.seTonclicklistener (this); Bt_prev.setonclicklistener (this); } @Override public void OnClick (View v) {switch (V.getid ()) {r.id.bt_select_contact:i Ntent Intent = new Intent (this, selectcontactactivity.class); Activates an interface with a return value Startactivityforresult (intent, 0); Break Case R.id.bt_next:finish ();//users will not see this interface when they click
Android provides an API to get the SIM card number, that is, to get the phone number of the local machine through telephonmanager.
It is particularly mentioned that information on the Internet shows that the new version of the dynamic zone card cannot be obtained. Is it unclear whether it is true? My card can be obtained, thank you! The remedy is to send an emai
In AndroidManifest. xml, we set the version number of the program, for example, android: versionName = "1.0.0 ". If you want to get the version number in the code, you can use the following method (you only need to modify the settings in AndroidManifest. xml when modifying the version number, instead of modifying the c
First we open our Android Studio.
The setting page pops up and we select Show line numbers and click the OK button.
Now we can see the travel number on the left side of the code.
We can see that not only the Java code shows the line number, but also the XML code area shows the line number, you can try it yo
eliminated two times, and of course there is the problem of storage, because if 1 million people want to promote, I can not generate 1 million copies of the installation package stored in the server for users to download.Yesterday also in the study of fingerprint problem, contacted the next friend union staff, after all, other professionals to do statistics, before told me that there is doing Android this feature, but today they told me that the proj
Obtain the current network type (2g, 3g, 4g, wifi), mobile phone model, and version number of Android.Obtain the mobile phone model: android. OS. build. MODEL: android. OS. build. VERSION. the code used to obtain the current network type of the mobile phone is as follows: This is a tool class, which can be saved for easy use.
Package com. iqtogether. qxueyou. sup
With the recent explosive growth of Google Android Market, more and more professional manufacturers are entering the market, and various copyright problems are emerging. Today, when my younger brother first logged on to the Android Market this month, he suddenly found that two unlucky games were targeted by nangongmeng and Hudson, the related program is stopped for download ......
Manufacturer's legal lette
The Android platform offers four types of data storage: Shared Preferences, file storage, SQLite storage, and networked storage. which
1 Shared Preferences A lightweight key-value storage mechanism dedicated to storing key-value pairs of data, and can only store basic data types (boolean, int, long, float, and string), which are typically used to store application configuration information.
2 file storage operates on files through FileInputStream an
to query n + 1 times.
I saw a post in the garden saying that I could use
Uri. withAppendedPath (PhoneLookup. CONTENT_FILTER_URI ,"*")
After obtaining the information of all contacts, I did not test successfully on the Android 4.0 simulator and the Android simulator.
Various types of contact information are stored in the Data table. Therefore, you can query the Data table and limit its MIMETYPE to Phone. CO
Here is the tool method for getting version informationVersion name public static String Getversionname (context context) {return Getpackageinfo (context). Versionname;} Version number public static int Getversioncode (context context) {return Getpackageinfo (context). Versioncode;} private static PackageInfo Getpackageinfo (context context) {PackageInfo pi = null;try {packagemanager pm = Context.getpack Agemanager ();p i = Pm.getpackageinfo (Context.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.