i want to develop a simple client for yahoo messenger on android 1.1. it will use openymsg api. is there anyone who have tried to use openymsg api on android before?
i've tried simple code like this:
Using java Syntax Highlighting
- package com.simple.yahoo;
- import java.io.IOException;
- import org.openymsg.network.AccountLockedException;
- import org.openymsg.network.LoginRefusedException;
- import org.openymsg.network.Session;
- import org.openymsg.network.SessionState;
- import android.app.Activity;
- import android.os.Bundle;
- public class SimpleYahoo extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.login_screen);
- Session session = new Session();
- try {
- session.login("anyuser","anypassword" );
- } catch (AccountLockedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalStateException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (LoginRefusedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- if (session!=null && session.getSessionStatus()== SessionState.LOGGED_ON)
- {
- try {
- session.sendBuzz("other");
- session.sendMessage("other", "testing");
- } catch (IllegalStateException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- try {
- session.logout();
- } catch (IllegalStateException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- }
Parsed in 0.037 seconds, using GeSHi 1.0.8.4
but when i run it from eclipse, it show error codes:
- Code: Select all
06-18 16:24:45.989: ERROR/AndroidRuntime(966): ERROR: thread attach failed
06-18 16:24:48.050: ERROR/dalvikvm(977): pthread_setspecific failed, err=22
06-18 16:24:48.389: ERROR/AndroidRuntime(985): Uncaught handler: thread main exiting due to uncaught exception
06-18 16:24:48.409: ERROR/AndroidRuntime(985): java.lang.VerifyError: org.openymsg.network.chatroom.ChatroomManager
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at org.openymsg.network.Session.login(Unknown Source)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at com.simple.yahoo.SimpleYahoo.onCreate(SimpleYahoo.java:22)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1122)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2104)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2157)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at android.app.ActivityThread.access$1800(ActivityThread.java:112)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1581)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at android.os.Handler.dispatchMessage(Handler.java:88)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at android.os.Looper.loop(Looper.java:123)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at android.app.ActivityThread.main(ActivityThread.java:3739)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at java.lang.reflect.Method.invokeNative(Native Method)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at java.lang.reflect.Method.invoke(Method.java:515)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
06-18 16:24:48.409: ERROR/AndroidRuntime(985): at dalvik.system.NativeStart.main(Native Method)
can somebody tell me what was wrong with code above?
thanks...

