A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Software Craftsman
this week in the
Phonecall sound integration
Joined: Nov 18, 2008
Apr 09, 2012 03:13:25
Is there some way to integrate sound to a phonecall?
Like playing a song in the background of a phonecall or something like it?
Joined: Jul 25, 2011
Apr 09, 2012 04:00:13
Check me if I am right ?. You want to play a song when you receive a call. If so,
You have to set an intent like the following,
Uri audioUri= MediaStore.Audio.Media.getContentUriForPath("// Your file name here"); ContentValues contentValues= new ContentValues(); contentValues.put(MediaStore.MediaColumns.DATA,"//file Path"); contentValues.put(MediaStore.Audio.Media.IS_RINGTONE, true); // You have to set more contentValues such as file size, is default alarm tone, duration, etc., You can explore it yourself Uri uri= main.getContentResolver().insert(audioUri, contentValues); // Now access your ring tone manager to set your uri RingtoneManager.setActualDefaultRingtoneUri( "//Your Activity" , RingtoneManager.TYPE_RINGTONE, uri);
I have tried with much more attributes for the contentValues object. The above code is just a skeleton. Hope this would help you.
The following is only my opinion.
I don't think android allows that access to developers to transmit sound during a call in addition to voice.
Have you tried LearnNowOnline?
subject: Phonecall sound integration
The winners are:
Position applying for - sixty-nine
Monitoring a directory?
phonecall notification while net usage
any tool for phone-call notification when dial-up connection is on
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015