Android provides a Locationmanager class specifically for GPs support, which acts similarly to service classes such as Telephonymanager, Audiomanager, and all GPS-targeting related services, Object will be generated by the object.Similar to the method of obtaining Telephonymanager and Audiomanager in the program, the program does not directly Locationmanager instances, but is obtained by invoking the Getsys
"+" number to replace the local country (you in which country or region to call the code of International calls), such as in China or Europe is generally 00, and in North America is 1,gsm 00 and 1 made a mark directly with "+" to replace, This can be identified by operators in areas that support the GSM format. Because the operator is doing this call transfer service. CDMA I haven't thought about it yet.Google as a global company to provide a libphonenumber jar package, on GitHub has its open s
How to obtain the phone number of the Local Machine on Android? Currently, an API is provided on Android to read the fixed number on the early SIM card,
CopyCodeThe Code is as follows: Private string getphonenumber (){
Telephonymanager mtelephonymgr;
Mtelephonymgr = (telephonymanager) getsystemservice (context. telephony_service );
Return mtelephonymgr. getline1number ();
}
The above getphonenumber me
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 email to 10086 (10010) and then get the email from the sender ......
PS: Some developers cannot read the phone number. I will explain
- if(Velocityx > 200) {//speed greater than 400 pixels per second - //can complete sliding + floatDX = E2.getx ()-E1.getx ();//the distance between the x-axis direction sliding - if(Math.Abs (DX) ) { + return true;//If the spacing does not conform directly to invalid A } at if(DX //swipe from right to left -NextNULL);//event calls that are not components -}
Android.telephony.telephonymanager;import Android.util.log;public class Phonestatusservice extends Service {public Static final String TAG = "Phonestatusservice";//declaring service class for mobile phone system state management private Telephonymanager tm;//the listener for the phone state Myphonelistener myphonelistener;//defines a telephone recorder private mediarecorder mediarecorder; @Overridepublic IBinder Onbind ( Intent arg0) {return null;} C
(); Get phone Manager Telephonymanager TM = (Telephonymanager) getsystemservice (Telephony_service); Set listen//Parameter 2: Set listener to listen to only what data Tm.listen (new MyListener (), phonestatelistener.listen_call_state); } private Mediarecorder Recorder; Class MyListener extends Phonestatelistener {//Call this method when the phone state changes @Override public void Oncallstate
# LOCAL_CERTIFICATE: = sharedLOCAL_CERTIFICATE: = platform why is this requirement required? In TelephonyManager, the status is only IDLE, incoming call, and outgoing call. See the following in phone:Phone phone = PhoneFactory. getDefaultPhone ();This call cannot run in a process other than phone. If you do not believe it, try it. Remember that the Logoff of the main thread of a process is unique.
The reason is as follows:
[Java]If (slot! = Lorule. my
Android gets the local SMI card number, androidsmi
1 // get the mobile phone number 2 TelephonyManager tm = (TelephonyManager) this. getSystemService (Context. TELEPHONY_SERVICE); 3 String deviceid = tm. getDeviceId (); // obtain the unique ID of a smart device 4 String te1 = tm. getLine1Number (); // obtain the local number 5 String imei = tm. getSimSerialNumber (); // the serial number of the SIM card 6
Android obtains IMSI information (determined to be mobile, Unicom, and Telecom mobile phone cards) and androidimsi
First, we need to know that the first three digits of the mobile phone IMSI number are China Mobile, followed by two digits of 00 02, 01 is China Unicom, and 03 is China Telecom. The first step is to obtain the mobile phone IMSI number first: the code is as follows:
1/** 2 * Get IMSI Information 3 * @ param context 4 * @ return 5 */6 public static String getPhoneIMSI (Context contex
cannot display overflow menus the above solution has solved how to forcibly display overflow menus on mobile phones lower than Android 4.4. Below we will solve the problem that some wonderful mobile phones cannot display overflow menus. Why does meizu mobile phone fail to display? What I learned is that meizu does not have the so-called actionbar, which is called smartbar. It seems that meizu engineers have modified the official actionbar. One word! However, Xiao Wu came up with a solution. Eac
"License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */packag
[Android] obtains information about the mobile phone's hardware and android hardware.
Today, I chatted in the QQ group. A buddy bought a 16 GB mobile phone running memory in a certain treasure. At that time, I was so scared, so I had the idea of writing a program to read the actual memory of this mobile phone, so I had this blog today.
Shows all information items. (Some information is displayed blank because my test machine does not have a mobile phone card)
The following code is used:
Packa
Android determines whether the current device is a mobile phone or tablet or an android tablet.
Android development needs to adapt to mobile phones and tablets. In some cases, it is necessary to determine whether the device is a mobile phone or tablet.On the Internet, it is often said that the device size, DPI, version number, and whether the phone function is available are used to determine whether the device is accurate.Here is a concise and powerful method (official usage ):
/*** Determine wh
)) {Siv_sim_bound.setcheck (false); } Else{Siv_sim_bound.setcheck (true); } siv_sim_bound.setonclicklistener (NewView.onclicklistener () {@Override Public voidOnClick (view view) {//3. Get the original method BooleanIscheck =Siv_sim_bound.ischeck (); //4. Reverse the original state//5, Status set to current entrySiv_sim_bound.setcheck (!Ischeck); //6, Storage (serial card number)//6.1 Get the SIM card serial number Telephonemanager if(!Ischeck) {
); } Public voidClick (View v) {Toast.maketext ( This, "Start Service", Toast.length_short). Show (); Service=NewIntent ( This, MyService.class); StartService (service); }}Service
Define internal classes in the service to listen for phone status PackageXidian.dy.com.chujia;ImportAndroid.app.Service;Importandroid.content.Intent;ImportAndroid.media.MediaRecorder;Importandroid.os.Environment;ImportAndroid.os.IBinder;Importandroid.support.annotation.Nullable;ImportAndroid.telephony.Phon
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.