Christopher Schene
asked on
Want to de-bounce andriod "phone dial" target
I would like to write an Android application intercept a click on the green phone icon on the "recent calls" screen. I keep on touching this target accidentally and end up "butt dialing" folks. It is very embarrassing to butt dial my manager at 1am on a weekend.
If I had my choice what I would like to do is optionally "beep" or make some sound so that I know I hit the target to dial someone the droid would ask me to confirm.
I think i can get started if I know:
1) How to intercept a touch on the green telephone icon to prevent it from dialing
2) How to popup a messages asking me to confirm or optionally timeout and default to either "dial" or "don't dial" (this should be configurable)
3) How to Dial the number after optional confirm
If I had my choice what I would like to do is optionally "beep" or make some sound so that I know I hit the target to dial someone the droid would ask me to confirm.
I think i can get started if I know:
1) How to intercept a touch on the green telephone icon to prevent it from dialing
2) How to popup a messages asking me to confirm or optionally timeout and default to either "dial" or "don't dial" (this should be configurable)
3) How to Dial the number after optional confirm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Eclipse is the usual medium for creating an Android project as the SDK integrates into it well.
http://stackoverflow.com/questions/6665594/call-dialer-issue-in-android gives some information on the intent filters your application will require.
First thing I would do is set up an empty project, add the intent filters to the manifest, then install it onto the phone. Try to make a call - if you are asked which dialler to use then your phone will recognise a custom dialler.
I had a quick Google and couldn't find any example projects to help you out unfortunately.
Cheers,
Chris
http://stackoverflow.com/questions/6665594/call-dialer-issue-in-android gives some information on the intent filters your application will require.
First thing I would do is set up an empty project, add the intent filters to the manifest, then install it onto the phone. Try to make a call - if you are asked which dialler to use then your phone will recognise a custom dialler.
I had a quick Google and couldn't find any example projects to help you out unfortunately.
Cheers,
Chris
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi cschene,
Change Your manifest file some thing like this
<uses-permission android:name="android.perm ission.CAL L_PHONE" />
<uses-permission android:name="android.perm ission.CAL L_PRIVILEG ED" />
<application android:icon="@drawable/ic _launcher" android:label="@string/app _name">
<activity android:name=".CallInterce pter " android:label="@string/app _name">
<intent-filter>
<action android:name="android.inte nt.action. CALL_PRIVI LEGED" />
<category android:name="android.inte nt.categor y.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
</activity>
</application>
Change Your manifest file some thing like this
<uses-permission android:name="android.perm
<uses-permission android:name="android.perm
<application android:icon="@drawable/ic
<activity android:name=".CallInterce
<intent-filter>
<action android:name="android.inte
<category android:name="android.inte
<data android:scheme="tel" />
</intent-filter>
</activity>
</application>
@santhanasamy
Your CallIntercepter.java is uploaded in rich text format, you might want to upload it in plain text instead.
Cheers,
Chris
Your CallIntercepter.java is uploaded in rich text format, you might want to upload it in plain text instead.
Cheers,
Chris
ASKER
Hi,
I am in the process of building a java package with Eclipse.....I should have this tested in two days. I have only created one other Android app----so I a bit slow.
I am in the process of building a java package with Eclipse.....I should have this tested in two days. I have only created one other Android app----so I a bit slow.
ASKER
Experts,
I am working on the application: I have created a project....but I am getting compile errors.
So, I made a new project as shown below....this does load and run on the Driod. So, the next step would be to add another package to the project with the name "Callinterceptor"
package chris.schene.custom_dialer ;
import android.app.Activity;
import android.os.Bundle;
public class Custom_dialerActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstan ceState);
setContentView(R.layout.ma in);
}
}
I am working on the application: I have created a project....but I am getting compile errors.
So, I made a new project as shown below....this does load and run on the Driod. So, the next step would be to add another package to the project with the name "Callinterceptor"
package chris.schene.custom_dialer
import android.app.Activity;
import android.os.Bundle;
public class Custom_dialerActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstan
setContentView(R.layout.ma
}
}
Hi cschene,
I guess no need to create a different activity ... Just use the attached java file CallIntercepter as the Your applications launcher activity.......And change the Androidmanifest.xml accordingly...
I guess no need to create a different activity ... Just use the attached java file CallIntercepter as the Your applications launcher activity.......And change the Androidmanifest.xml accordingly...
Hope this works out - if the recent calls list is part of the Contacts activity (I don't know) you might not be able to intercept the dialer this way as the Contacts activity uses its built-in dialer regardless
An alternative would be to declare your app as a BroadcastReceiver for the NEW_OUTGOING_CALL intent i.e.
see http://developer.android.com/reference/android/content/Intent.html#ACTION_NEW_OUTGOING_CALL for more info if it turns out you need this.
Cheers,
Chris
An alternative would be to declare your app as a BroadcastReceiver for the NEW_OUTGOING_CALL intent i.e.
<intent-filter android:priority="1">
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
That would intercept an outgoing call after it's dialed.see http://developer.android.com/reference/android/content/Intent.html#ACTION_NEW_OUTGOING_CALL for more info if it turns out you need this.
Cheers,
Chris
ASKER
I was helped by all of your comments so I split points....Not quite working yet, but I am on the right track...I'll post more questions if I get stuck again.<br /><br />Thanks experts!
ASKER
I need to set up a project and it may take me a few days.
How can I tell if my phone will ignore the "default" dialer?
Can you point me to a starter project? Should I be using Eclipse?
Chris