Mmh, Getting frustrated here
I have never done this before so I might (probably) making stupid mistakes.
I tried 2 things:
First:
package cyclone.b4a.testflightapp;
import com.testflightapp.lib.TestFlight;
import android.app.Application;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.ActivityObject;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.BA.Permissions;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
@Version(1.02f)
@Permissions(values={"android.permission.INTERNET","android.permission.ACCESS_NETWORK_STATE"})
@ShortName("TestFlightApp")
public class TestFlightWrapper extends Application {
@Override
public void onCreate() {
super.onCreate();
BA.Log("MyApplication onCreate");
TestFlight.takeOff(this, "hidden");
BA.Log("Takeoff done");
// try your code after calling super.onCreate()
}
}
and add in the manifest:
SetApplicationAttribute(android:name, "cyclone.b4a.testflightapp.TestFlightWrapper")
This executes the application and the method OnCreate and after that the application just stops. It does not load the rest of my app.
In the second try I have (part of the code):
public class TestFlightWrapper {
private TestFlight tf;
/*
* Initialize the library testflightapp
*/
public void Initialize(BA ba) {
BA.Log("Wrapper TestFlight Init");
tf = new TestFlight();
BA.Log("Wrapper TestFlight Init");
tf.takeOff(ba.activity.getApplication(), "hidden");
}
and get the error :
** Activity (main) Create, isFirst = true **
Wrapper TestFlight Init
main_activity_create (java line: 313)
java.lang.NoClassDefFoundError: com.testflightapp.lib.TestFlight
at cyclone.b4a.testflightapp.TestFlightWrapper.Initialize(TestFlightWrapper.java:23)
at com.yazula.android.main._activity_create(main.java:313)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at com.yazula.android.main.afterFirstLayout(main.java:98)
at com.yazula.android.main.access$100(main.java:16)
at com.yazula.android.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
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:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
SO it cannot find the class TestFlight. So maybe this isn't a class and takeoff should be called like:
TestFlight.takeOff(ba.activity.getApplication(), "hidden");
this gives a java.lang.NullPointerException. Which make sense because the object might be null????
Anyone to point me in the correct direction?