Ringtone issue record

Source: Internet
Author: User

 

1. Restore the inconsistency between the default and the default ringtones after the factory settings

Http://blog.csdn.net/ameyume/article/details/7608070

 

2. Uri Alert = ringtonemanager. getdefaulturi (ringtonemanager. type_alarm );

 

 

3.

1. define a global image
Private URI myuri = NULL;

2. Uri pickeduri = data. getparcelableextra (ringtonemanager. extra_ringtone_picked_uri) in onactivityresult;
Myuri = pickeduri;

3. Add a section before startactivityforresult (intent, 0:
If (myuri! = NULL)
{
Intent. putextra (ringtonemanager. extra_ringtone_existing_uri, myuri );
}

 

 

4. default settings for Android

Modify the settings source code to modify the system settings. The settings data is stored in COM. Android. providers. Settings/databases/settings. DB. to modify the default value loaded after the system is started

One way is to directly modify the value of settings. DB

The other is to modify the default value of settingsprovider.

The settings application can configure various settings of the Android system. The default values of these settings are all read from the database by settingsprovider in frameworks. Where does the data come from when the system is started for the first time?

The frameworks/base/packages/settingsprovider/RES/values/defaults. xml file is used to store the default settings of the Android system.
For example:
<Integer name = "def_screen_off_timeout"> 600000 </Integer>
<Integer name = "def_screen_brightness"> 102 </Integer> sets the default brightness.

<Bool name = "def_install_non_market_apps"> false </bool>: sets whether to allow installation of non-market applications by default.

If you want to define ults. not found in XML. After adding it here, you need to modify frameworks/base/packages/settingsprovider/src/COM/Android/providers/settings/databasehelper. java, add your own storage code.


Ringtone: the SD card ringtones file, supports audio files (MP3, WAV, Ogg, and other formats ).
Notification ringtone: SD card specifications, supporting audio files (MP3, WAV, Ogg, and other formats ).
Alarm ringtone: SD card alarms, supports audio files (MP3, WAV, Ogg, and other formats ).
Appendix: Location of the built-in ringtone File
Ringtone:/system/Media/Audio/ringtones
Notification ringtones:/system/Media/Audio/notifications
Alert tone:/system/Media/Audio/alarms
Interface operation event sound:/system/Media/Audio/UI

Certificate -----------------------------------------------------------------------------------------------------------------------------------

 

5.

Set the system default ringtone:

[Java]
View plaincopyprint?
  1. Ringtonemanager. setactualdefaultringtoneuri (context, ringtonemanager. type_ringtone, Uri );
RingtoneManager.setActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE, uri);                

Read system default ringtones:

[Java]
View plaincopyprint?
  1. Uri uri = ringtonemanager. getactualdefaultringtoneuri (this, ringtonemanager. Type

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.