telephony

iOS how to find country code of the user's phone number?

ぃ、小莉子 提交于 2019-11-30 09:38:52
I have an app that needs to figure out the country code of the phone number the user has. My understanding is that I can't just get the phone number of the user, but, is there a way for example if I have a US phone number to get the country code +1? I have found multiple answers that claim that using core telephony you can get the country code "+1" but I tried a few and none of them work. I tried this: CTTelephonyNetworkInfo *network_Info = [CTTelephonyNetworkInfo new]; CTCarrier *carrier = network_Info.subscriberCellularProvider; NSString *mnc = [carrier mobileNetworkCode]; NSString *mcc =

how to access com.android.internal.telephony.CallManager?

自作多情 提交于 2019-11-30 09:25:30
I am trying to access CallManager class object from com.android.internal.telephony package. Here is my code: ClassLoader classLoader = TestActivity.class.getClassLoader(); final ClassLoader classLoader = this.getClass().getClassLoader(); try { final Class<?> classCallManager = classLoader.loadClass("com.android.internal.telephony.CallManager"); Log.i("TestActivity", classCallManager); } catch (final ClassNotFoundException e) { Log.e("TestActivity", e); } Unfortunately, this is throwing a ClassNotFoundException . The same approach allows me to access PhoneFactory , but apparently I'm not

How to detect if device is capable of calling and messaging

心不动则不痛 提交于 2019-11-30 09:09:59
问题 Some devices ie. Galaxy Tablet 10.1 can only send SMS, but cannot call. Some other devices like Asus Transformer don't even have SIM card. How can I detect if device can makes calls? And how can I detect if device can send SMS? 回答1: Maybe you can query the PackageManager whether the system contains any component that can respond to ACTION_CALL and ACTION_SENDTO intents? You might need to add the "tel:" and "smsto:" scheme in the URI. 回答2: Using this technic you can test all sorts of things

How make use of the Voice API to make calls using Huawei 3g Modems?

限于喜欢 提交于 2019-11-30 06:54:23
问题 Some Huawei 3g modems like mine (E1752) has ability to make and receive calls. I believe onboard there is PCM channel that can be used while making or receiving the calls but I do not have any more information on that. I am using their app called the Mobile Partner which is a fairly complete app which supports making and receiving calls. But I want to build my own app which will run on Mac OS X. But I am not able to locate any documents detailing the Voice API and the onboard PCM channel. If

Android DDMS - send calls to actual device

主宰稳场 提交于 2019-11-30 05:21:50
问题 Does anyone know how (or if it's possible) to simulate a call to an actual device (i.e. USB debugging) using the DDMS in eclipse? I have no problems simulating calls to the emulator and the app I'm writing runs fine in both the emulator or the device. Platforms: IDE: eclipse on a mac Android Device: droid incredible, usb debugging enabled other: <application android:debuggable="true"> figured out you can't call an actual device from the emulator. 回答1: In the DDMS view, you have a tab called

phone number should be a string or some numeric type that have capacity to save phone number?

て烟熏妆下的殇ゞ 提交于 2019-11-30 02:37:56
问题 We want to store 10 digit mobile number i.e.9999999999. Should it be numeric or string datatype? We don't want to do any calculative or manipulation operation on this Which is better memory and performance wise? 回答1: ITU-T recommendation E.164 says you need 3 digits for the country code and up to 15 digits for the directory number within the country dialing plan. And, many people add some punctuation. For example: +1.212.555.1212 is a North American number. It could also be rendered (212) 555

How to properly use reflection to access hidden methods in Telephony Manager

左心房为你撑大大i 提交于 2019-11-29 23:35:38
问题 I'm not sure if I'm having trouble with Reflection itself, or the method I'm trying to obtain. What I'd like to do is call the function setLine1Number from the class: com.android.internal.telephony.gsm.GSMPhone So that I can have my number properly inserted into my phone as it is not required to be in my SIM. Therefore I want to be able to call the function getLine1Number and have it return the same number that I set. Reflection appears the only way to be able to use this function as it is

What does the different Call states in the Android telephony stack represent?

旧巷老猫 提交于 2019-11-29 19:16:56
问题 The internal Android class com.android.internal.telephony.Call contains an enum called State and defined as follows: public enum State { IDLE, ACTIVE, HOLDING, DIALING, ALERTING, INCOMING, WAITING, DISCONNECTED, DISCONNECTING; public boolean isAlive() { return !(this == IDLE || this == DISCONNECTED || this == DISCONNECTING); } public boolean isRinging() { return this == INCOMING || this == WAITING; } public boolean isDialing() { return this == DIALING || this == ALERTING; } } What does the

iOS how to find country code of the user's phone number?

拈花ヽ惹草 提交于 2019-11-29 14:28:45
问题 I have an app that needs to figure out the country code of the phone number the user has. My understanding is that I can't just get the phone number of the user, but, is there a way for example if I have a US phone number to get the country code +1? I have found multiple answers that claim that using core telephony you can get the country code "+1" but I tried a few and none of them work. I tried this: CTTelephonyNetworkInfo *network_Info = [CTTelephonyNetworkInfo new]; CTCarrier *carrier =

How to check telephony and camera availability for SDK version < 5

旧时模样 提交于 2019-11-29 14:28:14
Standard way of checking camera and telephony hardware availability works only since SDK >= 5: PackageManager pm = this.getPackageManager(); boolean hasTelephony=pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY); boolean hasCamera=pm.hasSystemFeature(PackageManager.FEATURE_CAMERA); My problem that I need to runtime define availability of telephony and camera in SDK 3 (Android 1.5) Any ideas? P.S. I understand that Android 1.5 is very outdated, but still I do have bunch of customers running these devices, so I have to keep compatibility with them. Well, I have found solution - very odd but