How to develop an Android app that uses the Google Calendar API

I just started developing Android applications, and decided that I would write an application for working with Google Calendar .

The first problem that came to me is that I cannot add any Gmail account to the emulator. When I go to settings -> accounts, I can only add an Exchange account.

The question is, how do I develop such an application. I know that I should make fun of the API while I run the tests, but how should I run the application on an emulator?

Should I just test it on the mocked API with JUnit and then run it on my work phone?

+7
android android-emulator google-calendar google-api
source share
2 answers

As for the emulator configured for the Google account, it depends on the version of Android that you use in AVD : for example, for version 2.2 go to the “Settings / accounts and synchronization” section, click “Add account” and “Google”, etc. .d.

Regarding access to Google Calendar, the best way is to use the Google Calendar API .

Please note: there is not yet an official Android SDK API for accessing the calendar.

+5
source share

There is a good example of accessing the Google Calendar Data API from Android using the Google API Client Library for Java in calendar-v2-atom-android-sample . Here are detailed instructions for setting up the correct package:

  • Window> Android SDK and AVD Manager
    • Follow the instructions to install the "Google API from Google Inc., Android API 8"
    • Follow the instructions to create a new Android virtual device based on the target "Google API (Google Inc.) - API Level 8"
    • Click "Start ..." (wait a while ...)
    • On the emulator main screen, press the "Menu", "Settings" button
    • Click Accounts & Sync
    • Click "Add Account"
    • Click google and follow the instructions

Disclaimer: I am the owner of the Google API client library project for Java .

+3
source share

All Articles