, only between the characters will be verified through. /** * Verify that the name entered is "Chinese" or whether it contains "•"*/ Public Staticboolean islegalname (String name) {if(Name.contains ("·") || Name.contains ("?")){ if(Name.matches ("^[\\u4e00-\\u9fa5]+[?] [\\u4e00-\\u9fa5]+$")){ return true; }Else { return false; } }Else { if(Name.matches ("^[\\u4e00-\\u9fa5]+$")){ return true; }Else {
How to get the native phone number on Android, and now Android provides an API to read the number that was cured on the early SIM card,
Copy Code code as follows:
Private String Getphonenumber () {
Telephonymanager Mtelephonymgr;
Mtelephonymgr = (Telephonymanager)
In the original: Android system get IMEI number Mobile number IMSI numberSource code: Http://www.zuidaima.com/share/1550463673584640.htmFirst, get IMEI numberTelephonymanager telephonymanager= (Telephonymanager) This.getsystemservice (Context.telephony_service);String Imei=telephonymanager.getdeviceid ();Permissions Required:Second, get mobile
format: Kanji + A-z + bit-A-Z or-
(includes only the common license plate number, Coach car and some of the military vehicle grades are not included)/
String carnumregex = "[\ue-\ufa]{}[a-z]{}[a-z_-]{}";
if (Textutils.isempty (Carnumber)) return false;
else return carnumber.matches (Carnumregex);
}
Of course, this regular expression has limitations, such as the first limit is only Chinese characters, not limited to only 34
The following is an example of a number, a telephone to tell EditText how to set the input type, other types can refer to the InputType class.
1) can only enter the number
The code is as follows
Copy Code
EditText et = (edittext) Findviewbyid (r.id.ettest);Et.setinputtype (Inputtype.type_class_number);
2) can only enter the phone
on the conditions.If the server in the issued text message, does not include the phone number, the phone is unable to obtain the phone number. If the text contains a number, the phone
When you contact this tutorial, the method used to select a contact is to read the contact from the database, and then display it with listview. After selecting the contact, the mobile phone number is returned,
In this way, when you click to select a contact, it takes time to load and the displayed contacts do not seem to be full,
In short, it is not good. You do not have to process the interface by calling
Tag: Code cat code Log Direct err map load ATIThere are many ways to get the package name and version number for other apps on your Android phone, which can be obtained directly from the APK package via AAPT or via code on your phone. Obviously, for the product or user to obtain this information, on the
Android AutoCompleteTextView supports mobile phone number formatting, with the history clearing operation, autocomplete clearing data
One of my friends has encountered this problem: AutoCompleteTextView Enables automatic filling. At the same time, you must have the mobile phone Formatting Function. The last row in the
I recently started to learn about Android, mainly focusing on the secrets of Android Application Development. In chapter 3rd, example_03_02 is an example of reading the name and phone number of contacts in the address book. However, due to API 2.0, each contact can have multiple ph
In my daily text message program, you can click the select contact button to display the contact selection page. After you click Select contact, the mobile phone number of the contact is added to a text box. For the introduction and interface of this program, see my first Android program.You can directly use the built-in contacts of
Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/47374415Some Android phones will have a number of commonly used features, such as ordering telephone, public telephone, air tickets, and so on, and so on, click on the corresponding number will automatically pop up the phone call interface.
Implement preset contacts (including names and numbers) to the mobile phone. Ensure that the contacts are read-only and cannot be deleted or edited.The code is divided into two parts:Part One inserts the preset contacts into the database;In Part Two mode, you cannot delete or edit a preset contact on the contact details and contact multi-choice interface.[Note] If you do not need to restrict the delete/edit operations of the preset contact, add only p
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
The front-end JS use XMLHttpRequest 2 upload pictures to the server, PC end and most mobile phones are normal, but in a small number of Android phone upload failed, the server to view the picture, displaying a byte count of 0. Here is the core code for uploading pictures:
Html
The code above uses Formdata to implement the form data submission. Formdata
In the daily use of the Android phone, the phone number to get a contact avatar, is often encountered problems. This article is an example of how Android is getting contact with a phone number
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.