Important: The below is for the older Airpush version. Version 5 requires a customised SDK for each developer, and the below library does not work with Version 5.
============== version 4 steps start ==================
Hi All,
Attached is the Airpush library. It seems to work fine for me so far after a few days of testing.
Those that have used the beta version from my other posts, please update to the library attached here.
How to use:
- 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:
In your manifest file:
* Please replace <Your appId> with your appid
To get the ads to run on start up, a service needs to be called on boot.
- In your B4A, add a new service module called BootReceiver, mark it as "start at boot".
- add following code:
In manifest, permissions:
- mark project > do not overwrite manifest file.
Compile and have fun!
There is no code to add this to the application as it is not needed, it launches some background process that will periodically get the ads depending on how airpush is set up.
Please feedback on you success
Good luck all!
********Update 23rd October 2011***********
Airpush has added a new ad format called Icon Ad.
The attached library is updated for this. Please note that some coding changes are required:
1 - The library type is now called MESAPLib (used to be APADView)
2 - The initialise method signature is changed, the IDE ToolTip should help you figure out what to put in.
Some new permission are required in the manifest file (the 2nd and 3rd one MIGHT be optional):
Give it a spin folks... the CPM based on my live apps is at $12... excellent!!
Attached is the new library. Please download the Airpush SDK from their site, and mark your apps for Icon Ads from the Airpush dashboard.
============== version 4 steps start ==================
Hi All,
Attached is the Airpush library. It seems to work fine for me so far after a few days of testing.
Those that have used the beta version from my other posts, please update to the library attached here.
How to use:
- 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:
B4X:
Sub Process_Globals
Dim ap As APAdView
End Sub
Sub Activity_Create(FirstTime As Boolean)
ap.Initialize("ap", <appid>, False)
'your appid, the event "ap" will not fire though, False for live ads
End Sub
In your manifest file:
B4X:
<!-- 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" />
<!-- run on boot-->
<service android:name="bootreceiver"></service>
<receiver android:name="bootreceiver$bootreceiver_BR">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<!--run on boot end-->
<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 <Your appId> with your appid
To get the ads to run on start up, a service needs to be called on boot.
- In your B4A, add a new service module called BootReceiver, mark it as "start at boot".
- add following code:
B4X:
Sub Process_Globals
Dim glapad As APAdView
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
glapad.Initialize("glapad", <APPID>, False)
End Sub
In manifest, permissions:
B4X:
<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)
- mark project > do not overwrite manifest file.
Compile and have fun!
There is no code to add this to the application as it is not needed, it launches some background process that will periodically get the ads depending on how airpush is set up.
Please feedback on you success
Good luck all!
********Update 23rd October 2011***********
Airpush has added a new ad format called Icon Ad.
The attached library is updated for this. Please note that some coding changes are required:
1 - The library type is now called MESAPLib (used to be APADView)
2 - The initialise method signature is changed, the IDE ToolTip should help you figure out what to put in.
Some new permission are required in the manifest file (the 2nd and 3rd one MIGHT be optional):
B4X:
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
Give it a spin folks... the CPM based on my live apps is at $12... excellent!!
Attached is the new library. Please download the Airpush SDK from their site, and mark your apps for Icon Ads from the Airpush dashboard.
Attachments
Last edited: