Answer the question
In order to leave comments, you need to log in
How to set MP3 as a ringtone from the application?
There is an Android application in HTML5, several dozen MP3 files are “hardwired” in it (the application is assembled from HTML into APK in Eclipse).
How to set MP3 as ringtone from the application?
Answer the question
In order to leave comments, you need to log in
Assuming that the ringtone does not require a high quality melody, then I would simply connect the device to a computer or other device that can record incoming sound and simply record it.
For example so.
ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.DATA, <<asbolutePathToYourAudioFileHere>>);
values.put(MediaStore.MediaColumns.TITLE, "<<yourRingToneNameHere>>");
values.put(MediaStore.MediaColumns.SIZE, k);
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/mpeg"); // assuming it's an mpeg, of course
values.put(MediaStore.Audio.Media.ARTIST, "<<yourArtistNameHere>>");
// values.put(MediaStore.Audio.Media.DURATION, duration); // doesn't appear to be necessary if you don't know
values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
Uri uri = MediaStore.Audio.Media.getContentUriForPath(outPath);
Uri newUri = getContentResolver().insert(uri, values);
RingtoneManager.setActualDefaultRingtoneUri(
<<MyActivity>>.this,
RingtoneManager.TYPE_RINGTONE,
newUri);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question