How to use the library
Note: first post updated with the libraries
This is how you use the library.
No guarantees on it yet, as it might have some issues, like when you start your phone, there might be some process fail thing.
--- steps ----
Register at Airpush. Create a new app and get the AppId.
Download the Airpush sdk.
That should be it for Airpush side. Please note, they might take up to 24h to push your first ad.
Add the attached libraries and Airpush SDK to your extra libraries folder, and refresh or restart B4A.
Select both Airpush and MESAPLib.
Code in B4A:
Sub Globals
Dim ap As APAdViewX
End Sub
Sub Activity_Create(FirstTime As Boolean)
ap.Initialize("ap", "12345") 'your appid, the event "ap" will not fire though
'there is an option to run test ads too
End Sub
In your manifest file:
<!-- Airpush Code Start-->
<activity android:name="com.airpush.android.PushAds"
android:configChanges="orientation|keyboardHidden"/>
<receiver android:name="com.airpush.android.UserDetailsReceiver"/>
<receiver android:name="com.airpush.android.MessageReceiver" />
<receiver android:name="com.airpush.android.DeliveryReceiver" />
<receiver android:name="<Package Name>.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
<service android:name="com.airpush.android.PushService">
<intent-filter>
<action android:name="com.airpush.android.PushServiceStart<Your
appId>"/>
</intent-filter>
</service>
<!-- Airpush Code End-->
* Please replace <Package Name> with your “package name” and <Your appId> with your appid
Warning -> that bootloader thingy is something missing for now, i have no idea where to code that thing....
In manifest, permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.VIBRATE"/>(Optional But
Highly recommended to enhance your revenue stream)
Hmm... that should be it.
Have fun, and please do feedback on how it goes for you!
:sign0089: