Skip to main content

Pulling data from Google Calendar on Android in JSON



I'm using Android SDK level 8, Java. I have an app with a WebView and I want to import JSON in it.





What I want to achieve is: Send HTTP requests to the Google Calendar API v3 and receive data in raw JSON, however, authenticating the request using the Android account manager. I've been looking at the GData Java Client, more specifically at the Calendar Android Sample , which authenticates properly, but I want to specifically avoid the following things:





  • Using the GData API - unacceptable since I want a raw JSON string.



  • Pulling the data directly through JavaScript in the WebView - unacceptable since I would want to implement a SyncProvider in Java to update the JSON string







I found some information about the issue, for example: http://code.google.com/p/google-api-java-client/wiki/AndroidAccountManager





com.google.gdata.client.GoogleService.setUserToken(android.accounts.AccountManager.getAuthToken(???))





However, all the examples are connected with GData. On the other hand, exploring the Google Calendar v3 API page, I could not figure out how to authenticate with an auth token from the Account Manager.





In summation: how to retrieve JSON through plain HTTP requests to the Calendar API v3, authenticating the user with the token from the account manager, in Java.


Comments

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?

CCNA 1 Final Exam 2011 latest (hot hot hot)

  Hi! I have been posted content of ccna1 final exam (latest and only question.) I will post the answer and insert image on sunday. If you care, please subscribe your email an become a first person have full test content. Subcribe now  Some question  have not content because this question have images content. So that can you wait for me? SUNDAY 1. A user sees the command prompt: Router(config-if)# . What task can be performed at this mode? Reload the device. Perform basic tests. Configure individual interfaces. Configure individual terminal lines. 2. Refer to the exhibit. Host A attempts to establish a TCP/IP session with host C. During this attempt, a frame was captured with the source MAC address 0050.7320.D632 and the destination MAC address 0030.8517.44C4. The packet inside the captured frame has an IP source address 192.168.7.5, and the destination IP address is 192.168.219.24. At which point in the network was this packet captured? leaving host A leaving ATL leaving...