Android Question add appcenter sdk to b4a

b4xqar

Member
Licensed User
upload_2019-8-1_21-43-31.png


is there a way to add this to the b4a android ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Posting instructions as text so others can help you:
B4X:
import com.microsoft.appcenter.AppCenter;
import com.microsoft.appcenter.analytics.Analytics;
import com.microsoft.appcenter.crashes.Crashes;

AppCenter.start(getApplication(), "{Your App Secret}", Analytics.class);

It shouldn't be difficult to call it with JavaObject or inline Java.

Something like:
B4X:
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim AppCenter As JavaObject
AppCenter.InitializeStatic("com.microsoft.appcenter.AppCenter")
Dim Analytics As JavaObject
Analytics.InitializeStatic("com.microsoft.appcenter.analytics.Analytics")
AppCenter.RunMethod("start", Array(ctxt, "your app secret", Analytics))
 
Upvote 0
Top