Add a new ringtone to the Android system

Source: Internet
Author: User

If you want to add a ringtone to the Android system, you can use the ADB push method. However, if you want to modify the system multiple times, it will be too difficult to push it in. Here is a simple method, it is to compile the ringtone into the Android system. in the imgfile, the ringtone is automatically added every time you brush the image.

 

If you don't talk much about it, You can directly get into the topic:

 

1. ringtones in the Android system are stored in the frameworks/base/data/sounds/directory. Therefore, you must copy the ringtones to this path first.
Go to the frameworks/base/data/sounds/directory

~ /Work/android_src $ CD frameworks/base/data/sounds/

2. Copy the audio file test_music.ogg to this directory.

~ /Work/android_src/frameworks/base/data/sounds $ ls
Alarm_beep_01.ogg alarm_rooster_02.ogg effects newwavelabs ring_classic_03.ogg ring_digital_04.ogg ring_synth_04.ogg
Alarm_beep_02.ogg alert.ogg f1_missedcall.ogg specifications ring_classic_04.ogg ring_digital_05.ogg ring_synth_05.ogg
Alarm_beep_03.ogg audiopackage2.mk f1_new_mms.ogg originalaudio. mk ring_classic_05.ogg ringer.ogg ringtones
Alarm_buzzer.ogg audiopackage3.mk f1_new_sms.ogg ring3.ogg ring_digital_01.ogg ring_synth_01.ogg testfiles
Alarm_classic.ogg audiopackage4.mk f1_newvoicemail.ogg ring_classic_01.ogg ring_digital_02.ogg ring_synth_02.ogg
Alarm_rooster_01.ogg test_music.ogg ring_classic_02.ogg ring_digital_03.ogg ring_synth_03.ogg

3. to compile the audio file to the system. imgfile during each compilation, you also need to find the Android system manager, which is the *. mk file.

~ /Work/android_src/frameworks/base/data/sounds $ lsls-L *. mk
-Rwxr-XR-x 1 hyson 7876 audiopackage2.mk
-Rwxr-XR-x 1 hyson 7471 audiopackage3.mk
-Rwxr-XR-x 1 hyson 7817 audiopackage4.mk
-Rwxr-XR-x 1 hyson 3081 originalaudio. mk

 

4. Modify the MK file and add the audio file. Take originalaudio. mk as an example.

~ /Work/android_src/frameworks/base/data/sounds $ VI originalaudio. mk

 

$ (Local_path)/notifications/AlertSound_sample-08.ogg: System/Media/Audio/notifications/AlertSound_sample-08.ogg/</P> <p> $ (local_path)/test_music.ogg: system/Media/Audio/notifications/test_music.ogg/</P> <p> $ (local_path)/alarm_buzzer.ogg: System/Media/Audio/alarms/alarm_buzzer.ogg/ 

$ (Local_path)/test_music.ogg: System/Media/Audio/notifications/test_music.ogg/

Compile the test_music.ogg file of the current directory to the system/Media/Audio/notifications/directory of the target system.

 

5. Compilation System

~ /Work/android_src/frameworks/base/data/sounds $ mm Snod

MM Snod will compile directly in the current directory and write the compilation result to the system. imgfile.

 

Related Article

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.