• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps building new application starting with alarm clock source code

iduke

Lurker
Jan 4, 2010
5
0
I'm hoping to create a custom alarm clock, and I'd like to start with the code for the alarm clock that is already part of the android platform. I downloaded the code from android.git.kernel.org Git - platform/packages/apps/AlarmClock.git/summary and created a new android project in eclipse using this source code, but I'm getting some compile errors. Can anyone help me figure out why or let me know if there is a better way to build a new alarm clock application starting with the android source code?
Thanks in advance.
 
I'm guessing I'm not using the correct version of the source code with the correct version of the SDK, but I've tried lots of different combinations and can't get any of them to work.

Some of the errors I'm getting when trying to use the latest snapshot with the 2.0.1 SDK:
In Alarms.java, Intent.ACTION_ALARM_CHANGED cannot be resolved on line 438.
In AlarmKlaxon.java, line 89 "mVibrator = new Vibrator();" throws an error because the Vibrator constructor is not visible, and on line 207, com.android.internal.R.raw.fallbackring cannot be resolved.
In SetAlarm.java, com.android.internal.R.id.content cannot be resolved on line 113.

How can I figure out which SDK version to use with which snapshot of the code?
 
Upvote 0
I'm trying to make an alarm clock with different snooze and dismiss behaviors. I was hoping not to have to rewrite code for setting alarms and alarm preferences. How would I do this without using the source code?

you don't have to download it and build it. You can simply copy and paste the code. Though you may need to go to a number of different .java files to get what is needed.
 
Upvote 0
Really, it's not a good idea.

Android 2.1 have significantly different Alarm Clock application, and it's source code is not yet published.

Original (1.6) source code was so bad, so I had to rewrite almost everything of it for my Smart Alarm Clock.

Current source code (with background service) is much better, but still is too messy from my point of view.

Read it, learn it, make your own with new ideas.
But there are a lot of apps in the market already that do whatever you need. Please, create something new, not just another crappy math-alarm-clock torture.
 
Upvote 0
I was hoping not to have to rewrite code for setting alarms and alarm preferences

That's a good idea.
My alarm application has several extention points. Just create broadcast-receiver for some specific intents to catch all the events.

You can also use native alarm database to use original interface for configuration:
android-alarm-database - Project Hosting on Google Code (sorry for another self-advertisement)

I hope it will be really easy to create plugins for android alarm clock.
 
Upvote 0
I'm brand new to building Apps, and don't knwo if it would be easier to add to an existing program, or start from scratch.

I'm looking to add a "sunrise" simulation to an alarm clock. Not just the picture of a sunrise, but the screen waking up, for an adjustable length of time before the alarm goes off, gradually get brighter until the alarm time. Any thought of how to add this to a program?
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones