cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to connect SUP in native Android application using MBO

Former Member
0 Kudos

Hello Experts,

                  When I run my native Android application, I am getting exception on line "app.setApplictionContext(MainActivity.this)" of initialize() method like java.lang.NoClassDefFoundError: com.sybase.afaria.SeedDataAPI.

Please help me on this issue. I am writing some code of initialize method and as well as exception detail below.

Method Code:

                    Log.d(TAG, "*********entering initapp***********");

                    // Create the application object

                    Application app = Application.getInstance();

                    if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED) {

                              app.setApplicationIdentifier("PersonMBO");

                              app.setApplicationContext(MainActivity.this);

                              PersonMBODB.setApplication(app);

Exception Detail:-

 

FATAL EXCEPTION: main

java.lang.NoClassDefFoundError: com.sybase.afaria.SeedDataAPI

at com.sybase.messaging.common.AndroidContext.initializeSeedDataAPI(AndroidContext.java:24)

at com.sybase.messaging.common.AndroidContext.setContext(AndroidContext.java:17)

at com.sybase.mobile.Application.checkInitialize(Application.java:242)

at com.sybase.mobile.Application.setApplicationContext(Application.java:229)

at com.peol.personapps.MainActivity.initialize(MainActivity.java:84)

at com.peol.personapps.MainActivity.onCreate(MainActivity.java:46)

at android.app.Activity.performCreate(Activity.java:5104)

at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)

at android.app.ActivityThread.access$600(ActivityThread.java:141)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:137)

at android.app.ActivityThread.main(ActivityThread.java:5041)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:511)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)

at dalvik.system.NativeStart.main(Native Method)

Thanks and regards

Nilesh Patidar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All,

    I have added AfariaSLL jar file to project library, Now these error is gone and it's working fine.

Answers (2)

Answers (2)

midhun_vp
Active Contributor
0 Kudos

You need to set the application before checking whether the app is registered or not.

Follow the below code:

app = Application.getInstance();

                                                            app.setApplicationIdentifier("test");

                                                            app.setApplicationContext(ServerSettingsScreen.this);

ConnectionProperties connProps = app.getConnectionProperties();

                                                  connProps.setFarmId(");

                                                  connProps.setServerName("");

                                                  connProps.setPortNumber("");

                                                  CocoaGhanaDB.setApplication(app);

                                                  LoginCredentials loginCredentials = new LoginCredentials("", "");

                                                  connProps.setLoginCredentials(loginCredentials);

 

                                                            if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED) {

                                                                      app.registerApplication(600);

                                                            } else {

                                                                      app.startConnection(600);

                                                            }

- Midhun VP

Former Member
0 Kudos

Hello!

Are you sure, that you are correctly generated code? Do you added a third-party jar file?

If not, check this: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01734.0224/doc/html/lly13...

Also, this may be helpful too: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01734.0224/doc/html/title...