telephony

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

限于喜欢 提交于 2019-12-18 08:46:08
问题 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

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

为君一笑 提交于 2019-12-18 08:45:52
问题 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

Bluetooth dial with 32feet.net and c#

空扰寡人 提交于 2019-12-18 04:53:09
问题 I am trying to provide a "click to dial" solution for someone to a bluetooth device such as a mobile phone. I have been trying to do so using the 32feet.net bluetooth api. I haven't really done anything with bluetooth (since the days of at commands via a bluetooth serial port) but I have paired the device in question, which supports the handsfree service with the pc. I have the following code to attempt to connect and send a dial command. String deviceAddr = "11:11:11:11:11:11";

Android DTMF send tone overriding

試著忘記壹切 提交于 2019-12-18 03:03:30
问题 I tried to programmatically send DTMF tones in Android. But the emulator shows up a dialog box that says "Do you want to send these tones?" and it sends the tones only if I click OK. But how can I programmatically overcome this dialog box? Gracias 回答1: In my application, I am sending DTMF tones (with gap using ","). Please see the code below. If you put number as: 12345,6,7 it will dial 12345 and send 6 and 7 as dtmf tone with gap. String url = "tel:" + number; Intent intent = new Intent

How to get current cell signal strength?

我的梦境 提交于 2019-12-17 18:29:46
问题 I would like to store the cell signal strength, and I do it like this: private class GetRssi extends PhoneStateListener { @Override public void onSignalStrengthsChanged(SignalStrength signalStrength) { super.onSignalStrengthsChanged(signalStrength); Variables.signal = signalStrength.getGsmSignalStrength(); } } Okay but this only runs if it changes. I need the current signal strength. Is there a method to just ask for the current signal strength? 回答1: There is getAllCellInfo() method in

How to record call in android? Is it possible?

扶醉桌前 提交于 2019-12-17 13:58:11
问题 I want to record call from android phone. I am using android.media.MediaRecorder pckg. Also used following code: mrec.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL); mrec.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mrec.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); But I didn't succeed in recording an incoming call. Can anyone recommend a tested code snippet? Also, Is this true? http://groups.google.com/group/android-developers/browse_thread/thread/c2bc85eb60ae2aa5?pli

How to Reject a call programatically in android

时光怂恿深爱的人放手 提交于 2019-12-17 10:35:22
问题 In my app I will maintain a list of contacts. Any calls from contacts in the list will be dropped. They will show under missed calls but the phone will not ring. 回答1: First create this Interface: public interface ITelephony { boolean endCall(); void answerRingingCall(); void silenceRinger(); } Then Create this class that extends BroadcastReceiver public class IncomingCallReceiver extends BroadcastReceiver { private ITelephony telephonyService; private String blacklistednumber = "+458664455";

Rejecting Incoming call in android

我与影子孤独终老i 提交于 2019-12-17 08:51:55
问题 I want to reject incoming in android, I have seen so many code from these links. Android: Taking complete control of phone(kiosk mode), is it possible? How? How to Reject a call programatically in android http://androidsourcecode.blogspot.in/2010/10/blocking-incoming-call-android.html http://androidbridge.blogspot.com/2011/05/how-to-answer-incoming-call-in-android.html?showComment=1361478035090#c5468022990217431781 But I am still unable to do it, can anybody tell me in simple and easy steps

Rejecting Incoming call in android

大兔子大兔子 提交于 2019-12-17 08:51:13
问题 I want to reject incoming in android, I have seen so many code from these links. Android: Taking complete control of phone(kiosk mode), is it possible? How? How to Reject a call programatically in android http://androidsourcecode.blogspot.in/2010/10/blocking-incoming-call-android.html http://androidbridge.blogspot.com/2011/05/how-to-answer-incoming-call-in-android.html?showComment=1361478035090#c5468022990217431781 But I am still unable to do it, can anybody tell me in simple and easy steps

What regular expression will match valid international phone numbers?

被刻印的时光 ゝ 提交于 2019-12-16 22:23:50
问题 I need to determine whether a phone number is valid before attempting to dial it. The phone call can go anywhere in the world. What regular expression will match valid international phone numbers? 回答1: \+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d| 2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]| 4[987654310]|3[9643210]|2[70]|7|1)\d{1,14}$ Is the correct format for matching a generic international phone number. I replaced the US land line centric international access code 011