I want to implement an automatic call from my android phone. If I set message for a particular number and date as well, then my android phone should call that number automatically. Is it possible without any user interaction to call on any number via my android phone?
Yes it is possible. The code for call is straight forward.
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:09999"));
startActivity(intent);
Use your number in place of 09999.
Don't forget to specify the permission to call in Android Manifest.xml
Create an Alarm that will be fired at a particular time and add the code to call any particular number. Here is how you can set the AlarmManager to fire at a particular time. Then you can just call Intent.ACTION_CALL when your Alarm is fired.
Yes you can, with Intent.ACTION_CALL.
Related
Can any body suggest me, any Android Intent to make SIP Call? or even third party framework/lib/app, which has the facility to be invoked using an intent and some parameters will be fine.
Kindly Note: Not regular phone call, needed intent for SIP/Internet Phone call.
Thanks In Advance.
1) Do you mean you want to implement a SIP app?
Then, check this:
http://developer.android.com/guide/topics/connectivity/sip.html
Make you app and listen to ACTION_CALL.
Or
2) Do you want to invoke a calling app?
Then the usual ACTION_CALL will do.
(For example, in my phone ACTION_CALL will prompt me if I want to use Skype or Phone App)
Added:
I am using SipDroid in one of my phone. This is what happens when I try to make call:
Alternatively, if you meant to create an Intent, you could trying looking into declaring a custom scheme within an IntentFilter in your AndroidManifest.xml, such as calling an Intent with a sip:<numberToCall> will open your Activity.
I am using this code to make call
Intent callIntent = new Intent(Intent.ACTION_CALL,
Uri.parse("tel:" + phoneNumber));
startActivity(callIntent);
and I want to disconnect call after hear first ringing to leave a miss call on the destination phone.
I don't believe that's currently available in the Android sdk. I was trying to control outgoing calls on a project recently but other than dialing a number there's not a lot you can do. My last project needed to place a call, press a button, then hangup. For that I ended up setting up an Asterisk server that listened to a web page. You could do something similar but that would involve using a data connection to your own server.
You can check out these links. I don't like this answer but it's the way it is for now.
How to make a phone call in android and come back to my activity when the call is done?
http://developer.android.com/reference/android/content/Intent.html#ACTION_CALL
If you want to step outside of techniques I would recommend check out the this answer.
Can I make an emergency call programmatically in Android 2.1?
I've tried to use something like this:
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(telUri));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_NO_USER_ACTION);
appCtx.startActivity(intent);
but the only thing that I can do is call the system dialpad with the specified emergency number.
I have to push the 'dial' button to make call. Is there any way to skip the dialer?
No, you can't. The phone activity (actually part of the Contacts application) is what responds to the ACTION_CALL intent and you can't change how it handles it. This is done specifically to make sure the user confirms the number he/she wishes to dial.
I am trying to send a broadcast to simulate an incoming call.
I added the permission in AndroidManifest.xml file,
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
When I try to run the program, the phone reboots.(Emulator too).
Intent intent = new Intent();
intent.setAction("android.intent.action.PHONE_STATE");
intent.putExtra(TelephonyManager.EXTRA_STATE, TelephonyManager.CALL_STATE_RINGING);
intent.putExtra("EXTRA_INCOMING_NUMBER", "923982398");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
sendBroadcast(intent);
I may be wrong as I can't find anything in the docs but I'd say it's not possible to 'spoof' a call ringing broadcast. It's almost certainly reserved as 'system only'.
Think about it - if apps could do this, it may simply result in 'mischief' rather than anything malicious but it isn't something that I'd like to happen on my phone.
Create your own 'phone ringing' action to use for testing purposes and have your BroadcastReceiver listen for it. When you come to release the app then simply change the BroadcastReceiver's intent filter to listen for the real one.
I Downloaded some of the fake Caller Apps from play store and tested them.
I found that the App Raises an Event which displays the pre-mentioned GUI on the Top of Lock Screen and adds the entry into call logs using the insert method of ContentResolver.
The app does not use the inbuild Calling (Broadcast) mechanism. it just fakes the GUI on the Screen and plays the Default Ringtone/Vibration.
As per my Knowledge, I think it is not possible to fake a call ringing broadcast
Can you please help me find out how to call 911 without going through the Dialer user interface in Android?
I used the below code..but it's going through Dialer. I want to call directly to emergency number through my application.
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:911"));
startActivity(intent);
A search through existing questions provides the answer to this one as well as the two you asked yesterday: Dial Number Without Prompt
I think you need to add premission in mainfest file to use action_call.