3

I have to get events from Google calendar into my own Android apps. How can I do this?

here I am used gdata lib , but in the for iteration i getting some id instead of tile.

Thanks in advance.

            DocsService client = new DocsService("myappname");
        try {
            client.setUserCredentials("example@gamil.com",
                    "pwd");

            URL feedUri = new URL(
                    "https://docs.google.com/feeds/default/private/full/");
            DocumentListFeed feed = client.getFeed(feedUri,
                    DocumentListFeed.class);

            // TextView textView = (TextView) findViewById(R.id.textView1);

            String text = "";
            for (DocumentListEntry entry : feed.getEntries()) {
                // text += entry.getTitle().getPlainText() + "\r\n";
                list.add(entry.getTitle().toString());

            }
            return list;
            // textView.setText(text);
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (ServiceException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
SUDHAKAR K
  • 33
  • 1
  • 4

2 Answers2

4

You need to use Calender Provider for that

and for events look at the link below :

http://developer.android.com/guide/topics/providers/calendar-provider.html#events

Here are some blogs and explaination for the same

http://www.grokkingandroid.com/androids-calendarcontract-provider/

And in this link is shown how to read and edit events in calender provider.

Hope this helps...

Community
  • 1
  • 1
Shruti
  • 1
  • 13
  • 55
  • 95
1

You need to use Calendar Provider

http://developer.android.com/guide/topics/providers/calendar-provider.html

Madhur Ahuja
  • 22,211
  • 14
  • 71
  • 124