hi

i tried to use sample code from "gdata-src.java-1.28.0.java.zip" to
test google Calendar API.

    CalendarService myService = new CalendarService("a-
b-1","http","www.google.com");

    try {
      myService.setUserCredentials(USERNAME, PASSWORD);
      ...
    } catch(ServiceException e) {
         // Server side error
                Log.e("TestSchedule()",e.toString());
   }

==> met following exception
 12-19 13:03:14.940: WARN/System.err(9347):
com.google.gdata.util.AuthenticationException: Error authenticating
(check service name)

and i modify code like this
    CalendarService myService = new CalendarService("a-b-1");
==> met following exception
12-19 13:03:16.710: WARN/System.err(9347):
com.google.gdata.util.AuthenticationException: Error connecting with
login URI

so i search google groups and so on i reach the content

http://groups.google.com/group/android-developers/browse_thread/thread/a029a9973143f621/d190d67dee6a0bda?show_docid=d190d67dee6a0bda

i used that (http://www.shanaghy.com/gdatamod/ ) files to "gdata\java
\lib" folder. But my emulator died.

so i tired 2th method.


===>
I modified the gdata source to override the https cert verifier in
the
following places.
com\google\gdata\client\GoogleAuthTokenFactory.java(461):
HttpURLConnection urlConnection = (HttpURLConnection)
url.openConnection();
com\google\gdata\client\authn\oauth\OAuthHttpClient.java(43):
HttpURLConnection connection = (HttpURLConnection)
url.openConnection();
com\google\gdata\client\http\AuthSubUtil.java(303): HttpURLConnection
httpConn = (HttpURLConnection) url.openConnection();
com\google\gdata\client\http\AuthSubUtil.java(371): HttpURLConnection
httpConn = (HttpURLConnection) url.openConnection();
com\google\gdata\client\http\AuthSubUtil.java(431): HttpURLConnection
httpConn = (HttpURLConnection) url.openConnection();
com\google\gdata\client\http\HttpGDataRequest.java(320):
HttpURLConnection uc = (HttpURLConnection)
requestUrl.openConnection();


The modified code looks like this:


    // Open connection
    HttpURLConnection urlConnection = (HttpURLConnection)
url.openConnection();
    if ( urlConnection instanceof HttpsURLConnection ) {
        HttpsURLConnection ucs = (HttpsURLConnection) urlConnection;
        ucs.setHostnameVerifier( new X509HostnameVerifier(){
            @Override
            public boolean verify(String arg0, SSLSession arg1) {
                return true;
            }
            @Override
            public void verify(String arg0, SSLSocket arg1) throws
IOException {
            }
            @Override
            public void verify(String arg0, X509Certificate arg1)
throws SSLException {
            }
            @Override
            public void verify(String arg0, String[] arg1, String[]
arg2) throws SSLException {
            }
        });
    }
<=====

i wanted to make JAR files, so i created project with eclipse and
modified each files you recommeded.

BUT i have some problem below that.

[javac] D:\java\workspace\324\java\src\com\google\gdata\client\http
\HttpGDataRequest.java:42: package org.apache.http.conn.ssl does not
exist
    [javac] import org.apache.http.conn.ssl.*;
    [javac] ^
    [javac] D:\java\workspace\324\java\src\com\google\gdata\client\http
\HttpGDataRequest.java:317: cannot find symbol
    [javac] symbol  : class X509HostnameVerifier
    [javac] location: class
com.google.gdata.client.http.HttpGDataRequest
    [javac]         ucs.setHostnameVerifier( new X509HostnameVerifier()
{
    [javac]                                      ^

I don't know how do i do that ?
I can't solve the problem.

i added the android.jar files throgh buildpath confiuration to import
"org.apache.http.conn.ssl.X509HostnameVerifier" but i meet the above
problem.
i really want  to make new JAR files. Plz tell me the solution more
details as step by step because i',m beginner with eclipse and Java.
Or any solutions do you have?

Regards

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to