Hello all, i'm trying to create a library for this API here.
The xml and jar files compile fine in eclipse, but when i use it in B4A i get this error below...
I have been searching in the forums and google the whole day, and i've done about everything advised in all the posts i've found, including using JDK1.6.
from what i can understand in the error, it can't find the class named hapipay, which is the class in the library i created, i'm not an expert in Java obviously but this doesn't make sense.
Below is the code i have for the library, and i'm also attaching the project with the files needed.
I hope i can get an answer to this issue.
thanks,
Walter
The xml and jar files compile fine in eclipse, but when i use it in B4A i get this error below...
java.lang.NoClassDefFoundError: com.genesis.hapi.hapipay
at com.genesis.mobilerep.main._activity_create(main.java:318)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
at com.genesis.mobilerep.main.afterFirstLayout(main.java:98)
at com.genesis.mobilerep.main.access$100(main.java:16)
at com.genesis.mobilerep.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5299)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
I have been searching in the forums and google the whole day, and i've done about everything advised in all the posts i've found, including using JDK1.6.
from what i can understand in the error, it can't find the class named hapipay, which is the class in the library i created, i'm not an expert in Java obviously but this doesn't make sense.
Below is the code i have for the library, and i'm also attaching the project with the files needed.
B4X:
package com.genesis.hapi;
import java.util.List;
import android.content.Context;
import anywheresoftware.b4a.AbsObjectWrapper;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.ActivityObject;
import anywheresoftware.b4a.BA.Author;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.BA.DontInheritEvents;
import anywheresoftware.b4a.BA.Permissions;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
import com.handpoint.api.Device;
import com.handpoint.api.Events;
import com.handpoint.api.Hapi;
import com.handpoint.api.HapiFactory;
import com.handpoint.api.SignatureRequest;
import com.handpoint.api.TransactionResult;
@ShortName("HapiPayment")
@Permissions(values={"android.permission.BLUETOOTH", "android.permission.BLUETOOTH_ADMIN", "android.permission.INTERNET"})
@Author("Walter")
@Version(1.1f)
@ActivityObject
@DontInheritEvents
@DependsOn(values={"hapi-android-3.1.1"})
public class hapipay extends AbsObjectWrapper<Hapi> implements Events.Required{
private Hapi api;
public void Initialize(BA ba){
BA.Log("estamos inicializando");
Initapi(ba.context.getApplicationContext());
setObject(api);
}
public void Initapi(Context context){
BA.Log("Inicializando");
String SharedSecret = "0102030405060708091011121314151617181920212223242526272829303132";
this.api = HapiFactory.getAsyncInterface(this, context).defaultSharedSecret(SharedSecret);
}
@Override
public void deviceDiscoveryFinished(List<Device> arg0) {
// TODO Auto-generated method stub
}
I hope i can get an answer to this issue.
thanks,
Walter