ringtone

Get the Ringtone title from RingtonePreference

邮差的信 提交于 2021-02-07 04:59:25
问题 I have a RingtonePreference that is used to select a ringtone that is broadcasted to a receiver used in an Alarm application. I would like to display the title (the titles displayed in the list you see when you choose the ringtone) of the selected ringtone in the summary of the RingtonePrefernce. Somehow get the ID3 tag? Some ringtones would be mp3 but not all so this might not be a good idea? What I do now is: SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences

Set a selected audio file as ringtone

喜欢而已 提交于 2020-07-05 12:37:23
问题 I am developing an application: I am trying to set an audio file as a ringtone. I saw many posts, but no one actually helped me, so I decided to ask this question. I use this code when the Button is clicked: @Override public void onClick(View v) { Intent intent = new Intent(); intent.setAction(Intent.ACTION_GET_CONTENT); intent.setType("audio/*"); startActivityForResult(Intent.createChooser(intent, "Choose Sound File"), Audio); } in onActivityResult I am trying to get the file path and then

Set as Contact Ringtone? Android

女生的网名这么多〃 提交于 2020-01-23 01:15:32
问题 I am trying to learn how to add set as contact ringtone feature. I already know how to set default ringtone but I can't figure how to set as contact ringtone. I got to the part where I choose contact, but I don't know how to assign ringtone to that contact. That part is bugging me and I can't seem to find answer in questions that were already asked on this topic. Here is my code so far: static public final int CONTACT_CHOOSER_ACTIVITY_CODE = 73729; private File csound; private final File

Set as Contact Ringtone? Android

限于喜欢 提交于 2020-01-23 01:15:05
问题 I am trying to learn how to add set as contact ringtone feature. I already know how to set default ringtone but I can't figure how to set as contact ringtone. I got to the part where I choose contact, but I don't know how to assign ringtone to that contact. That part is bugging me and I can't seem to find answer in questions that were already asked on this topic. Here is my code so far: static public final int CONTACT_CHOOSER_ACTIVITY_CODE = 73729; private File csound; private final File

Custom Contact Ringtone Not Working on Some devices

你说的曾经没有我的故事 提交于 2020-01-21 10:15:10
问题 I'm developing music player, in that i have to set audio file as ringtone for contacts. Below code is working for some phones and some phones not. public static int setContactRingtone(@NonNull Context context, @NonNull Song song, String number) { int value = 0; if (context == null) { value = 0; } File f = new File(song.getmSongPath()); final Uri lookupUri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, number); final String[] projection = new String[] {

Unable to set as Ringtone because file already exists

喜夏-厌秋 提交于 2019-12-25 07:59:22
问题 I am trying to make app with set as ringtone feature but I got a problem. When I Set as ringtone once it's working. But when I try to set as ringtone for second time, nothing happens. Now the problem is because file already exist. How can I set my code to like...If file already exist proceed to next step Here is my code: private File rsound; private final File rpath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES); private void s1ring() { Boolean success =

how to detect the end of outgoing ringtone?

一个人想着一个人 提交于 2019-12-24 16:01:12
问题 I want to make a call with my program and after that recognize the call status . I want to detect the end of outgoing ringtone. How to detect the end of outgoing ringtone ? I use of Flowing code for make call . EditText ed = (EditText) findViewById(R.id.txtcall); Uri uri = Uri.fromParts("tel", ed.getText().toString(), null); callIntent = new Intent(Intent.ACTION_CALL,uri); startActivity(callIntent); 回答1: Following code snippet can help you in finding the phone call current statue whether its