Author Archives: nicktimakondu

Calendar Problems

Hello Again! It’s been a while since I last posted but not to worry, some good work has been done. We’ve redone the scheduling code to more closely match Android’s design philosophy of Content, Services, and Activities. The App now uses a Schedule_Event Activity instead of just Java code. This was a bit of a paradigm change for me and it definitely helped me understand the Android system better. The app now schedules tasks successfully but we have some issues with the Calendar.

One problem that I’m having is trying to get the app to write back to the user’s calendar with all the new events that have been scheduled. This feature used to work in Android 4.0 but no longer seems to be working in 4.1. I’m not sure what changed or why but this needs more exploring. The goal would be to create a new calendar on the user’s phone called Zadatak which would house the events that we generate, with titles that match the task. Reading from the Android Calendar is giving me weird errors. Sometimes it likes to read all the events in one calendar and sometimes it reads some events from all calendars. I need to explore the Android.CalendarContract class further to fully understand why these errors are happening.

So that’s what I’ve been working on these past few weeks. I look forward to your comments and suggestions!

-Nick Timakondu

Integration of the Calendar

Recently I’ve been working on getting the Android calendar to integrate with Zadatak. The operating systems keeps its calendar data in a database and access is provided through the CalendarContract classes. CalendarContract.Events is the table that we’re using to get all the user’s event. The algorithm works by finding the day with the most free time between now and the task’s due date. In my original testing of the algorithm I was doing that by simply iterating over every day between now and the due date. However now that we have a database of events instead of them being stored in memory, the number of times you access the database becomes a consideration. A solution I am currently in the midst of implementing is polling the database once a day and loading the next month into memory as a snapshot. This way both memory and database calls are taken into consideration. The snapshot is taken once a day and then is adjusted as tasks are scheduled into certain days. Next week I’ll be working on scheduling tasks and placing them back into the android calendar.


Magic of the Java Background

This past weekend was the RCOS Hackathon and I started getting into the structure of Zadatak. Our goals are to have the user put in as minimal information as possible and having the application do the rest of the work. This means the app has to dynamically allocate blocks of time to the schedule without bugging the user on details of when and how long. The app also has to work with pre-existing schedules, handle conflicts, and we want to include functionality on procrastinating and delaying work allotted blocks.

I set out to build some classes in Java that would encompass these requirements and ran into a pretty big question. What is a method of scheduling blocks into the right spots that takes our inputs (deadline and progress)? Our solution is based around 2 principles or functions. One to place the task into the calendar and one to manage a queue of tasks. The queue of tasks would be determined by an internal priority number(a factor of time remaining on task and amount of work task requires). The calendar placement would use a principle similar to operating system process management using a round robin style. Using all the remaining days for a task the placement would place hour by hour where time is free, trying to keep busy hours constant throughout the calendar. This week I’m going to try and implement these two ideas. Stay tuned for progress.


Tagged , , , ,