phone-number

iOS 7: How to get own number via private API?

ぃ、小莉子 提交于 2019-11-27 04:00:56
Old ways don't work any more: // way 1 void *lib = dlopen("/Symbols/System/Library/Framework/CoreTelephony.framework/CoreTelephony", RTLD_LAZY); NSString* (*getPhoneNumber)() = dlsym(lib, "CTSettingCopyMyPhoneNumber"); if (getPhoneNumber == nil) { NSLog(@"getPhoneNumber is nil"); return nil; } NSString* ownPhoneNumber = getPhoneNumber(); // way 2 extern NSString* CTSettingCopyMyPhoneNumber(); NSString *phone = CTSettingCopyMyPhoneNumber(); Related questions: Is it possible to detect a phone number of the device in iOS? [UPDATE] Provided method works on iOS 6.1.4 without JB and iOS 7.1.2 with

Get phonenumber programmatically - Android

爱⌒轻易说出口 提交于 2019-11-27 04:00:49
问题 is it possible to get the phonenumber of each device programmatically? I tried this code: TelephonyManager manager =(TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE); mPhoneNumber = manager.getLine1Number(); This works fine with some providers. Unfortunately it does not work with each provider. So i am looking for a trick or work around to get the phonenumber of the device. Is there a solution or is it impossible because the number is not stored on the sim card? 回答1:

Getting the local iPhone number through SDK

不羁岁月 提交于 2019-11-27 03:00:49
问题 I am looking for a SDK API to retrieve the device's local phone number from the SIM card. Is there a way to do it? 回答1: There's no reliable way. You'll find code online that tells you to look up SBFormattedPhoneNumber, and sometimes that works, but not consistently. Mostly it's people who brought their phone number over from another cell carrier. In those cases, you get a phone number, but not one for the current phone, and not one that's guaranteed to be valid for anything at all (it may not

How to get phone number in J2ME?

試著忘記壹切 提交于 2019-11-27 01:39:15
问题 How to get the phone number (not contact numbers,etc) in J2ME application ? The phone number that belongs to sim card in the phone. 回答1: phone number that belongs to sim card in the phone... above assumption is wrong. sim card does not store your phone number SIM card stores only a unique identifier which has nothing to do with your phone number. The way mobile interacts with network is about as follows: - [phone] hello network, ID on my SIM is 12345 - [network] hello 12345, I recognized you

How do you format a 10 digit string into a phone number?

若如初见. 提交于 2019-11-27 01:36:10
问题 I have database records in the form of 10 character long strings, such as 4085551234. I wish to format these into this format: (408) 555-1234. I think this is regex related. I'm new to programming and completely self-taught here, so any sort of resource relating to performing text processing would be appreciated as well. Thanks! 回答1: A regex is definitely overkill for this one. If you wanted to take a "phone number" and normalize it to 10 digits, that would be a good use for a regex. To do

How to make a call which begin with * in iPhone?

自古美人都是妖i 提交于 2019-11-26 23:38:21
问题 In my application, I want to call the number *111, when I use this URL tel:*111 to call, but can't make call success, please give me some indicate, thank you very much. [[UIApplication sharedApplication] openURL:@"tel:*111"] was not work. but it will work when remove * : [[UIApplication sharedApplication] openURL:@"tel:111"]; 回答1: It's not possible. From the Apple URL Scheme Reference: To prevent users from maliciously redirecting phone calls or changing the behavior of a phone or account,

How to get current SIM card number in Android?

本小妞迷上赌 提交于 2019-11-26 21:43:49
I want to know user mobile number in Android. I used this code but I'm not getting number. TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String n = tm.getLine1Number(); Permission: <uses-permission android:name="android.permission.READ_PHONE_STATE"/> Is it compulsory to save number in android mobile settings --> about phone --> status --> myphone number Any idea on this? Dipak Keshariya I think sim serial Number and sim number is unique. You can try this for get sim serial number and get sim number and Don't forget to add permission in manifest file.

How to get the mobile number of current sim card in real device?

只谈情不闲聊 提交于 2019-11-26 21:39:48
I have to make an application which shows the contact no of the SIM card that is being used in the cell. For that I need to use TelephonyManager class. Can I get details on its usage? Dave Webb You can use the TelephonyManager to do this: TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); String number = tm.getLine1Number(); The documentation for getLine1Number() says this method will return null if the number is "unavailable", but it does not say when the number might be unavailable. You'll need to give your application permission to make this query by adding the

Javascript Regex - What to use to validate a phone number?

筅森魡賤 提交于 2019-11-26 20:42:47
问题 Could anyone tell me what RegEx would work to validate an international phone number including white space between the numbers and also allowing for these chars: - ( ) . The amount of numbers in the string is not too important, I would just like the user to be able to type something like either example 1 or 2 if they wish: Example: +44 (0) 207 111 1111 442071111111 I have already read through and tested the posted answers to some similar questions to the best of my understanding but so far

Phone validation regex

不想你离开。 提交于 2019-11-26 18:41:33
I'm using this pattern to check the validation of a phone number ^[0-9\-\+]{9,15}$ It's works for 0771234567 and +0771234567 , but I want it to works for 077-1234567 and +077-1234567 and +077-1-23-45-67 and +077-123-45-6-7 What should I change in the pattern? Gent Please refer to this SO Post example of a regular expression in jquery for phone numbers /\(?([0-9]{3})\)?([ .-]?)([0-9]{3})\2([0-9]{4})/ (123) 456 7899 (123).456.7899 (123)-456-7899 123-456-7899 123 456 7899 1234567899 are supported This solution actually validates the numbers and the format. For example: 123-456-7890 is a valid