Conrad Clark
Conrad Clark

Reputation: 4536

How to make an android phone ring programatically AS IF it was receiving a call?

First off, I'm a beginner in mobile development. I've seen many similar questions but none of them would answer specifically this.

I'm developing a game for android, platform target 2.2, in Java (eclipse, android sdk, avd, etc), and would like to know if there's a way to make the phone ring (based on the current ringtone, settings, etc) as if you were receiving a call from your app.

Think of it as if one of the characters of the game would be calling you, to notify you about something (for example, you could let something in a game kind of 'oven', and your assistant would call you when the food is ready)

Is it possible?

Upvotes: 2

Views: 3747

Answers (2)

vallllll
vallllll

Reputation: 2761

I know you can get the curremtly selected ringtone from the preferences: http://developer.android.com/reference/android/preference/RingtonePreference.html

and then you should have a look at music players http://developer.android.com/guide/topics/media/index.html

and play your ringtone and of course creating that custom Activity Martin is talking about

Upvotes: 1

DonGru
DonGru

Reputation: 13710

IMHO this is not possible. If you want to do that you have to create an Activity with a layout similar to that of the incoming-call-screen. Sure you can use the Android code as it is open source: Layout Directory on GIT

Upvotes: 1

Related Questions