I just started doing some Android app development, and I decided I'm going to write an app to work with Google Calendar.
The first problem that came to me is that I can't add any Gmail account on the emulator. When I go to settings -> accounts, I can only add an Exchange account.
This raises a question how should I develop such application. I know that I should mock the API while I'm running tests, but how am I supposed to run the app on the emulator?
Should I just test it on mocked API with JUnit and then run it on production phone?
As for the emulator set up for a Google account, well, it depends on the Android version you have in your AVD: for example for 2.2, go to Settings/Accounts & Sync, click on Add account and Google, etc.
As for the Google Calendar access, the best way is to use the Google Calendar API.
Please note: there is not yet an official Android SDK API for the Calendar access.
There is a good example of accessing Google Calendar Data API from Android using the Google API Client Library for Java at calendar-v2-atom-android-sample. There are detailed instructions there for setting up the proper package:
Disclaimer: I am an owner of the Google API Client Library for Java project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With