Edit the AlarmClock in AOSP with Android-studio

Source: Internet
Author: User

1. Git the AlarmClock source code on AOSP

2. Select ' Import Project ' by Android-studio & we'll revise this code

Alarmklaxon.java
L89
Mvibrator = new Vibrator ();
Mvibrator = (Vibrator) getsystemservice (Vibrator_service);

l207,8
Setdatasourcefromresource (Getresources (), Mmediaplayer,
com.android.internal.r.raw.fallbackring);
Setdatasourcefromresource (Getresources (), Mmediaplayer,
r.raw.fallbackring);
R.raw.fallbackringとしてfallbackring.oggをファイルを Save (you can use a sound file called Fallbackring.ogg to put it under Main/res/raw)

Alarms.java
L462
Intent alarmchanged = new Intent (intent.action_alarm_changed);
Final String action_alarm_changed = "Android.intent.action.ALARM_CHANGED";
Intent alarmchanged = new Intent (action_alarm_changed);

l512,521,538
Specify apiに 's really into 対応 していないapiを call accolades out そうとしている.
eclipseクイックフィックス
ADD Target API to (メソッド name) で fix

Digitalclock.java
L52 Append
Private Context Mcontext;

L104, 110 additional
This.mcontext = context;

L187
Alarms.java with 様 アノテーション

Setalarm.java
L116
. Findviewbyid (Com.android.internal.r.id.content);
. Findviewbyid (Android. R.id.content);

L165
Alarms.java with 様 アノテーション

Androidmanifest.xml
Additional
Factor of The Times

Please execute ' adb uninstall Com.android.alarmclock ' in a shell.
と out たら straight にcmdで Natsumi Sato Line

Later, it is wrong to do some XML, so cut down some of the wrong lines. I can't imagine how to change it!!

Result build apk succeeded.

Ref

1. http://imax-live.blogspot.tw/2013/04/platformpackagesappsalarmclock.html

2. http://bokukoko.hatenablog.com/entry/20120825/1345895842

Edit the AlarmClock in AOSP with Android-studio

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.