I want to build an app which extends basic alarm clock functionality. Since I am not inventing any wheel in the alarm functionality, I would like to use the android default alarm which is available openly.
However I have tried to build it many times but there are just too many errors (mentioned here also):
I tried this approach also but I am still not able to build it.
Can anyone please guide on how to build the android application provided in git android tree.
Links I referred to:
Alarm clock code: mContext variable cant be resolved
Alarm Clock from GIT - Gives error - Android
Updates:
1.)
Alarms.java:
Line 463: Intent alarmChanged = new Intent(Intent.ACTION_ALARM_CHANGED);
Error: ACTION_ALARM_CHANGED cannot be resolved or is not a field.
Solved this error but replacing the line with (Thanks to @shayanpourvatan ):
final String ACTION_ALARM_CHANGED = "android.intent.action.ALARM_CHANGED"; Intent alarmChanged = new Intent(ACTION_ALARM_CHANGED);
2.)
AlarmKlaxon.java
Line 89: mVibrator = new Vibrator();
Error: Cannot instantiate the type Vibrator
-----------------------------------
Solved by replacing the line with:
mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
3.)
SetAlarm.java
Line 115: FrameLayout content = (FrameLayout) getWindow().getDecorView()
.findViewById(com.android.internal.R.id.content);
Error:com.android.internal.R cannot be resolved to a variable
Solved by replacing :
com.android.internal.R.id.content into android.R.id.content