Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4052540
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:19:57+00:00 2026-05-20T14:19:57+00:00

I am creating an widget to access the events stored in a google calendar.

  • 0

I am creating an widget to access the events stored in a google calendar.
Target : Android 2.1

I have included following external jar :

google-collect-1.0-rc1.jar jsr305.jar

gdata-calendar-2.0.jar,

gdata-calendar-meta-2.0.jar,

gdata-client-1.0.jar,

gdata-client-meta-1.0.jar,

gdata-core-1.0.jar

I get the following exception :

com.google.gdata.util.ParseException : org.xml.sax

here is my code: HelloWidget.java

package de.thesmile.android.widget2;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;

import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.util.Log;
import android.widget.RemoteViews;
import com.google.gdata.client.calendar.*;
import com.google.gdata.data.*;
import de.thesmile.android.widget2.R;

public class HelloWidget extends AppWidgetProvider {
    int number =0;



    
public String gooleres()
{
    String result=new String("Unable to login into your account");
    // Create a CalenderService and authenticate
    try
    {
        URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/private/full");

        CalendarQuery myQuery = new CalendarQuery(feedUrl);
        myQuery.setMinimumStartTime(DateTime.parseDateTime("2011-03-01T00:00:00"));
        myQuery.setMaximumStartTime(DateTime.parseDateTime("2011-03-06T23:59:59"));

        CalendarService myService = new CalendarService("wqewq");
        myService.setUserCredentials("sunnycool333@gmail.com", "XXXXXX");

         //Send the request and receive the response:
        Feed resultFeed = myService.query(myQuery, Feed.class);

        for (int i = 0; i < resultFeed.getEntries().size(); i++) {
          Entry entry = resultFeed.getEntries().get(i);
          result= entry.getTitle().getPlainText().toString();
    }
        
    }
        catch(Exception e)
    {
        
        result="Exception raised "+e.toString();
    }
        return result;
        
}



    @Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager,
            int[] appWidgetIds) {
        
    
        
         
        for (int appWidgetId : appWidgetIds) {
        
                 
            RemoteViews views = new RemoteViews(context.getPackageName(),R.layout.main);
            views.setTextViewText(R.id.widget_textview, gooleres());
            appWidgetManager.updateAppWidget(appWidgetId, views);
            
        }
        
    }


}

The code seems to be proper because when I try to put the same code as simple java file then I do get the output..
the simple java file I created looks something like this and it gives proper output..

public static void main(String[] args) {
    // TODO Auto-generated method stub
    
    // Create a CalenderService and authenticate
    
    
    try
    {
    
    URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/private/full");

    CalendarQuery myQuery = new CalendarQuery(feedUrl);
    myQuery.setMinimumStartTime(DateTime.parseDateTime("2011-03-01T00:00:00"));
    myQuery.setMaximumStartTime(DateTime.parseDateTime("2011-03-08T23:59:59"));

    CalendarService myService = new CalendarService("exampleCo-exampleApp-1");
    myService.setUserCredentials("sunnycool333@gmail.com", "ytrfvgb$");

    // Send the request and receive the response:
    Feed resultFeed = myService.query(myQuery, Feed.class);

    for (int i = 0; i < resultFeed.getEntries().size(); i++) {
      Entry entry = resultFeed.getEntries().get(i);
      
      System.out.println(Integer.toString(i)+entry.getTitle().getPlainText().toString());
      
    }
    }
    catch (Exception e) {
        // TODO: handle exception
        System.out.println(e.toString());
    }
    
    

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:19:58+00:00Added an answer on May 20, 2026 at 2:19 pm

    gdata api is not supported fully by android..

    so have to move to google java client library 🙁

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a widget similar to Google search widget for android. How're they
For a widget I am creating for the Android OS, I want the user
I am creating a simple Android widget with a typical usecase of having many
I have a JavaScript widget which communicates with my Rails app by creating tags
I'm looking into creating a widget that supports animation, ideally via the android.view.animation framework,
I'm creating a widget (with PHP and jQuery) to be included in a hosting
Has anyone seen or have an idea on how to go about creating widget
I'm creating a Yahoo! Widget and have done this before without any problems (creating
I'm creating a widget for which I need to calculate the minHeight and minWidth
I am creating a widget and had successfully created it, what I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.