Using raw resource sound file as Ringtone

by Maur铆cio » Mon, 14 Dec 2009 05:32:37 GMT


Sponsored Links
 I have a problem setting a ringtone from a resource in my app:

Uri uri = Uri.parse("android.resource://com.package.app/" +
R.raw.sound1);
RingtoneManager.setActualDefaultRingtoneUri(this,
RingtoneManager.TYPE_RINGTONE, uri);

I've noticed also some people had the same problem but got no answers.
Do any of you guys have any idea of how making this work? (without
having to copy the file to the sdcard)

Cheers

--



Using raw resource sound file as Ringtone

by Open » Fri, 18 Dec 2009 07:31:36 GMT


 I was able to set a ringtone for my app like this in Android 1.6, but
it does not seem to work in 2.0.




--


Sponsored Links


Other Threads

1. How can I load resources from Jar files?

I have a project in J2SE that I'm trying to port to android.  At the
moment, it is broken into several jars with resources in each jar.
Can I use Class.getResource("/path/to/resource") to load the
resources?  If I do, can I pipe the raw stream that I fetch (of, let's
say, a PNG file) into something like BitmapFactory to obtain the
object I need?

--~--~---------~--~----~------------~-------~--~----~

2. How to mark a test to be @SmallTest OR @MediumTest OR @LargeTest

Hello,

I am new to using JUnit framework in Android. I checked tests folder
of sample applications provided by Google. Android allows feature of
creating test suite of small OR medium OR large tests using "adb shell
am instrument -e size small \ medium \ large'.

Kindly suggest the criteria of deciding if a test should be marked as
@SmallTest OR @MediumTest OR @LargeTest?

I studied InstrumentationTestRunner class source code and found that
endTest function calculates execution time of test and can print a
test should belong to which test suite.

Thanks in advance.

Regards
Vibhor

--~--~---------~--~----~------------~-------~--~----~

3. Gettiing error while installing in Eclipse

4. Android Dev Phone 1 without sim card?

5. How to manually cache a page using CacheManager

6. Not able to get all vaues of contact

7. How to add a label to a list view