I've been using the app for about a year and a half by now and it's been really great as an alarm (it detects and wakes you during light sleep). Plus it calculates sleep duration, which you could use in your app. I believe that the data are accessible as a .csv in the phone's SD card so it shouldn't be too difficult.