android - How can I fix the "Error connecting with login URI" exception I get when adding events to Google Calendar? -


I use the following code in java. It works well and adds an event to Google Calendar. But this exception in Android gives an error in connecting with the login URI . Can anyone help me solve this?

  Calendar service My service = new calendar service ("CalendarTest"); String Username = "mytest.test@gmail.com"; String user password = "xxxxxxx"; // Create the required URL object {try MetafeedUrl = new URL (METAFEED_URL_BASE + userName); EventFeedUrl = New URL (METAFEED_URL_BASE + username + EVENT_FEED_URL_SUFFIX); } Hold (malformedlexception e) {// bad url strbuf.append (e.getMessage ()); System.err.println ("Uh oh - you have an invalid url."); E.printStackTrace (); Return; } Try {MyService.setUserCredentials (user name, userPassword); // Demonstrate creating a single event event Calendar EventContent Single Event = Create Event Event (MySaseer, "Event Title", "Event Details"); System.out.println ("Successfully created event" + singleEvent.getTitle (.) GetPlainText ()); // Display a quick add event display calendar EventIncenter Quick Edent = CreateAdAdvent (My service, "Tennis with me 22nd June 3pm 3:30 pm"); System.out.println ("Quickly add quick event" + QuickAddEvent.getTitle (.) GetPlainText ()); } // hold .......  

access to the Internet Need add something in the calendar, right?

So you have to give your app access to Internet access. Try adding this rights before AndroidManifest.xml's closing tag:

  Use of Android-permission: name = "android.permission.INTERNET" & gt; & Lt; / Usage-permission & gt;  

Comments