Android Question Accesing third party SDK with #Additionaljar

shaxboz

Member
Licensed User
Longtime User
Hi! I want to use AdAppter.mobi SDK in my app.
Can I use #Additionaljar for this SDK
I don`t know Java, so can anybody give example?
I uploaded SDk and AdAppter Android SDK Setup Guide.
 

Attachments

  • adappter-android-sdk-1.zip
    258.6 KB · Views: 196
  • AdAppter Android SDK Setup Guide.zip
    439.9 KB · Views: 272

shaxboz

Member
Licensed User
Longtime User
No, I couldn't find, but there is everything given with pictures and codes in this guide.

Erel, I send you eclipse demo project for this SDK by email
It was 900kb, and I couln't resize it to 500 for upload here, sorry
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Start with adding the ad:
B4X:
Dim Ad As JavaObject
Ad.InitializeNewInstance("com.adappter.sdk.banner.AdView", Array (GetContext, "http://show.adappter.mobi/request.php", "your key", true, true))
Activity.AddView(Ad, ...)

'you might also need to add a manager:
Dim manager As JavaObject
manager.InitializeNewInstance(GetContext, "http://show.adappter.mobi/request.php", "your key", true)

Sub GetContext As JavaObject
  Return GetBA.GetField("context")
End Sub

Sub GetBA As JavaObject
  Dim jo As JavaObject
  Dim cls As String = Me
  cls = cls.SubString("class ".Length)
  jo.InitializeStatic(cls)
  Return jo.GetFieldJO("processBA")
End Sub

Make sure to add the jar with AdditionalJar and also add the manifest text with the manifest editor:

B4X:
AddApplicationText(
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<activity android:name="com.adappter.sdk.video.RichMediaActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|
uiMode|screenSize|smallestScreenSize"
android:hardwareAccelerated="false" />)
 
Upvote 0
Top