0

I'm currently in the middle of developing an Android app for my FYP. The app is something like a student mobile planner and one of its functions is to allow students to choose the subjects they are taking from a list (stored in a database) and then add them to a calendar so that they can view it anywhere and anytime (even if it's offline).

So, my problem now is i'm not sure how i should generate the calendar. Should I

(1) Use the built-in calendar on Android phones I have done some research and found that Android doesn’t provide an official API for read/write Calendar data in the past. But recently they just published a fully-worked-out set of APIs for accessing Calendar data but it is only for Ice Cream Sandwich (ICS) OS. So i think this should mean that if i develop my app using these APIs, my app will only work on devices with ICS installed? correct me if i'm wrong

Another thing is that i'm intending to allow user to view the calendar inside my app. it means that after user adds the subjects they taking, they will be shown a calendar displaying the times of the classes without having to exit the app and then be redirected to the built-in Android calendar. Is it possible?

(2) Find an open source calendar Android app and integrate it into my app. Is there any good open source calendar app out there? with good documentations so that i can understand how the app works faster. also, would it be hard to integrate others' app into my app?

(3) Build from scratch i have thought about this but 1 problem is that my app got some other functions and if i build the calendar part from scratch, i might not have enough time to finish other functions.

I'm a beginner to Android development and is still exploring around. if you got ideas other than the three mentioned above, do tell me smile.gif

loolie
  • 1

2 Answers2

0

To answer your first question: You are correct, the new Calendar APIs will only work for devices running Android 4.0 or higher. However, Google has web-based Calendar APIs with XML and JSON, so you could potentially use that on older devices to access the user's calendar data. Here's a link to the Google APIs Explorer. you can explore the available APIs and try out some mock requests, and it will show you what would come back in the response. There's also a relevant session from Google I/O 2011 on the subject.

Karakuri
  • 38,365
  • 12
  • 84
  • 104
  • is it possible to retrieve details about events(e.g classes) from a database and then add them to the built-in calendar of android phone? is there any APIs or tutorials out there that show how to do this? also another thing is that i will include the venue detail when adding the event to the calendar. user can click on the venue and my app will then display a map showing where it's located. so is it a good idea to use the built-in calendar? or should i use a standalone calendar? – loolie Feb 19 '12 at 09:01
0

You haven't specified as of what view you want to display your data in, there are many possible views where you can show your data in, particularly Month View, Day View or Agenda View, do a research and find out which one is suitable for your application.

Android 4.0 has fully functional Calendar API's, but as of now more that 90% phones don't run ICS. So your best bet would be to start writing your calendar from scratch.

Do not go for undocumented and unsupported Calendar API's available as open source, instead write your own as chances are Google will stop supporting those API's in the future.

For reference you might have a look at this http://w2davids.wordpress.com/android-simple-calendar/

It helped me a lot in understanding how calendar works, but since you say you are a beginner consider learning the basics of Android first which might be found here http://developer.android.com/index.html

I recently wrote a blog on how to get started with Android app development, you can also check out this, http://android-development-series-by-arif.blogspot.in/

Arif Nadeem
  • 8,524
  • 7
  • 47
  • 78
  • The thing i want is that my app will first retrieve details about classes from a database and then add them to the built-in calendar (is it possible?). then user should be able to switch between different views (month/day view) Another thing is that i will include the venue detail when adding the event to the calendar. user can click on the venue and it will then display a map showing where it's located. so is it possible to do it using the built-in calendar? or i have to write my own calendar from scratch? – loolie Feb 19 '12 at 11:09
  • As of now you cannot do that, the reason being that every android phone is not guaranteed to have a Calendar app and if does then chances are they might have been made using different API's refer to this http://stackoverflow.com/questions/3721963/how-to-add-calendar-events-in-android and check out the accepted answer. – Arif Nadeem Feb 19 '12 at 18:57