Did you ever have any luck getting this to work?  I'm also interested
in accessing Google Spreadsheets, but before I spend a bunch of man
hours trying, I'd like to know if it's even possible.

On Oct 15, 9:43 am, androidian <[EMAIL PROTECTED]> wrote:
> I removed the libs and added gdata-core and gdata-spreadsheetas
> source into my project, but I get the same error.  The project has no
> errors, so Dalvik has compiled successfully.  Why can't it login?
>
> Here's the relevant stack trace from ddms:
> 10-15 21:34:38.216: WARN/System.err(205):
> com.google.gdata.util.AuthenticationException: Error connecting with
> login URI
> 10-15 21:34:38.225: WARN/System.err(205):     at
> com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(GoogleAuthToken 
> Factory.java:
> 421)
> 10-15 21:34:38.237: WARN/System.err(205):     at
> com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(GoogleAut 
> hTokenFactory.java:
> 301)
> 10-15 21:34:38.246: WARN/System.err(205):     at
> com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java :
> 323)
> 10-15 21:34:38.246: WARN/System.err(205):     at
> com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java :
> 300)
> 10-15 21:34:38.255: WARN/System.err(205):     at
> com.mydomain.hello.HelloAndroid.login4(HelloAndroid.java:39)
> 10-15 21:34:38.255: WARN/System.err(205):     at
> com.mydomain.hello.HelloAndroid.onCreate(HelloAndroid.java:25)
> 10-15 21:34:38.255: WARN/System.err(205):     at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> 1122)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2103)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2156)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> android.app.ActivityThread.access$1800(ActivityThread.java:112)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1580)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> android.os.Handler.dispatchMessage(Handler.java:88)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> android.os.Looper.loop(Looper.java:123)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> android.app.ActivityThread.main(ActivityThread.java:3742)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> java.lang.reflect.Method.invoke(Method.java:515)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:739)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
> 10-15 21:34:38.265: WARN/System.err(205):     at
> dalvik.system.NativeStart.main(Native Method)
> 10-15 21:34:38.265: WARN/System.err(205): Caused by:
> java.io.IOException: Hostname <www.google.com> was not verified
> 10-15 21:34:38.287: WARN/System.err(205):     at
> org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.getSecureSocket(HttpConnection.java:
> 169)
> 10-15 21:34:38.287: WARN/System.err(205):     at
> org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnection
> $HttpsEngine.connect(HttpsURLConnection.java:398)
> 10-15 21:34:38.297: WARN/System.err(205):     at
> org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection...
> 1129)
> 10-15 21:34:38.297: WARN/System.err(205):     at
> org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnection.getOutputStream(HttpsURLConnect...
> 262)
> 10-15 21:34:38.306: WARN/System.err(205):     at
> com.google.gdata.client.GoogleAuthTokenFactory.makePostRequest(GoogleAuthTo 
> kenFactory.java:
> 477)
> 10-15 21:34:38.306: WARN/System.err(205):     at
> com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(GoogleAuthToken 
> Factory.java:
> 418)
> 10-15 21:34:38.306: WARN/System.err(205):     ... 18 more
>
> Any ideas?
>
> thanks,
> Ian
>
> On Oct 13, 11:37 pm, androidian <[EMAIL PROTECTED]> wrote:
>
> > Great stuff Mark, thank you very much.  As a first step I'll try
> > recompiling the gdata stuff and see what happens.
> > cheers,
> > Ian
>
> > On Oct 13, 10:14 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
>
> > > androidian wrote:
> > > > I imported gdata-core-1.0.jar and gdata-spreadsheet-1.0.jar into my
> > > > project and the SpreadsheetService class comes from the latter.  The
> > > > HTTP requests must be being done in the setUserCredentials method (all
> > > > inside those two jars).  Perhaps one of those jars is not compatible
> > > > with android?  
>
> > > Off the cuff, given the symptoms, I'd say that's likely.
>
> > >  > Is there a support matrix somewhere that I can check?
>
> > > Not that I'm aware of.
>
> > > There are at least two possible problems with any given third-party JAR:
>
> > > 1. The JAR makes assumptions regarding the underlying Java platform, in
> > > terms of available APIs or their behavior, and those assumptions fall
> > > down in the case of Android's Dalvik.
>
> > > 2. The JAR was compiled with an incompatible version of the Java
> > > compiler, so the bytecode that the Android build process uses gets
> > > fouled up.
>
> > > For example, with Beanshell (http://www.beanshell.org), using the JAR
> > > downloaded straight from the site didn't work for, um, beans. However,
> > > when I recompiled Beanshell, using the same compiler as with the rest of
> > > my project, it worked just fine.
>
> > > > I'm a little bit confused as to why there would be incompatibilities -
> > > > can you elaborate?
>
> > > Assuming those JARs don't have any dependencies of their own (e.g., they
> > > did not make you copy even more JARs into your project), they are
> > > probably using HttpUrlConnection and kin for doing their HTTP work. I
> > > would suspect that the Google Docs login process requires SSL.
>
> > > So, going back to my two points above:
>
> > > 1. It may be that SSL handling in Dalvik behaves differently than it
> > > does in whatever JavaSE edition your JARs were written for
>
> > > 2. It may be that a simple recompile of those JARs from source will 
> > > suffice
>
> > > > My manifest:
>
> > > Well, that looks OK, at least in terms of where your uses-permission
> > > element lives. Sometimes people put that inside the application element
> > > by mistake, and Android is pretty picky about that sort of thing.
>
> > > --
> > > Mark Murphy (a Commons Guy)http://commonsware.com
>
> > > Android Training on the Ranch! -- Mar 16-20, 
> > > 2009http://www.bignerdranch.com/schedule.shtml
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to