B4A Library StartApp ADS Library

Library attached below
copy StartAppPlus.jar and StartAppPlus.xml to lib folder
download and rename last StartApp SDK to startappinappplus.jar then add it also to lib folder

add this to manfest
B4X:
AddManifestText(
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>)
AddApplicationText(<activity android:name="com.startapp.android.publish.list3d.List3DActivity"
          android:theme="@android:style/Theme" />
<activity android:name="com.startapp.android.publish.AppWallActivity"
          android:theme="@android:style/Theme.Translucent"
          android:configChanges="orientation|keyboardHidden|screenSize" />)

its easy to use
B4X:
Dim StAppPlus As StartAppPlus
StAppPlus.Initialize(DevID,AppID)
'you have many methods like
StAppPlus.showSlider
StAppPlus.ShowSplash(App Name)
StAppPlus.ShowInterstitials

'To Show Banner

StAppPlus.ShowBanner

Activity.AddView(StAppPlus,0,(100%y-50dip),100%x,50dip)
lib tested with StartAppInApp-2.4.jar
if you did not signup yet please use my link for signup
https://portal.startapp.com//#/signup?referredBy=rfd5kwc
 

Attachments

  • Startapp-2015.zip
    3.7 KB · Views: 221
Last edited:

rleiman

Well-Known Member
Licensed User
Longtime User
Hi,

I signed up with StartApp.

Can you check my code? I must be missing something because the banner does not show up.

In the manifest:

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>
    )

AddManifestText(
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>)

AddApplicationText(<activity android:name="com.startapp.android.publish.list3d.List3DActivity"
          android:theme="@android:style/Theme" />
<activity android:name="com.startapp.android.publish.AppWallActivity"
          android:theme="@android:style/Theme.Translucent"
          android:configChanges="orientation|keyboardHidden|screenSize" />)

SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")
'End of default text.

In the main module:

B4X:
#Region  Project Attributes
    #ApplicationLabel: StartApp Test
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Dim StAppPlus As StartAppPlus
    Private ImageViewExit As ImageView
    Private PanelMenu As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")

    ' Set up the adverts.
    '--------------------
    StAppPlus.Initialize("My ID his here.","My app ID is here.")

    StAppPlus.ShowBanner
    Activity.AddView(StAppPlus,0,(100%y-50dip),100%x,50dip)
End Sub

Sub Activity_Resume

    ' Neatly arrange views.
    '----------------------
    Utils.CenterViewOnBottom(ImageViewExit, PanelMenu, 200)

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub ImageViewExit_Click
    Activity.Finish
End Sub
 

rleiman

Well-Known Member
Licensed User
Longtime User
Hi hanyelmehy,

Do you have a startapp library that works with version 3.2 of the SDK?

If not, can you post a copy of the version 2.4 SDK you tested your library on?

Thanks.
 

hanyelmehy

Active Member
Licensed User
Longtime User
Library work with StartAppInApp-3.2.0.jar just
rename StartAppInApp-3.2.0.jar to startappinappplus.jar and replace old one in your lib folder
and use this in Manifest
B4X:
'/////////////////////////////StartApp plus ////////////////////////////////////////////////
'//////////////////////////////////////////////////////////////////////////////////////////
AddManifestText(
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>)
AddApplicationText(<activity android:name="com.startapp.android.publish.list3d.List3DActivity"
          android:theme="@android:style/Theme" />
<activity android:name="com.startapp.android.publish.OverlayActivity"
          android:theme="@android:style/Theme.Translucent"
          android:configChanges="orientation|keyboardHidden|screenSize" />
<activity android:name="com.startapp.android.publish.FullScreenActivity"
          android:theme="@android:style/Theme"
          android:configChanges="orientation|keyboardHidden|screenSize" />)
'////////////////////////// END OF StartApp plus/////////////////////////////////////////
'//////////////////////////////////////////////////////////////////////////////////////////
 

rleiman

Well-Known Member
Licensed User
Longtime User
Hi

StAppPlus.Initialize(DevID,AppID)

What is the parameter DevID?

Thanks
Hi,

DevID is a number you get from Startapp after you register with them. This number needs to be surrounded in double quote marks ("Your Dev ID")
AppID is the number Startapp give you when you add your app to their web site for being included when users click on the ads. This also needs to be surrounded by the quote marks.
 

hookshy

Well-Known Member
Licensed User
Longtime User
Any idea how to cancel returning ads with this library ...?
Does anyone have an earlier version before this returning ads function ?

2.3.6 seems to skip this return ad ...
2.3.5 may not be compatible with google as android ID is no loger allowed

from startapp change log
  • 2.3.5:
    • Removed usage of the Android ID.
  • 2.3.6:
    • Major improvements & bug fixes.
  • 2.4:
    • New ad type - the Return Ad!
    • Added a callback for ad click event.
    • Bug fixes.
  • 2.4.1:
    • Minor improvement.
 
Top