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