Skip to content

chen-fishbein/startapp-codenameone

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

#startapp-codenameone

Library extension of the StartApp Ads SDK (http://www.startapp.com/) for the Codename One platform.(http://www.codenameone.com)

This plugin supports Interstitial Ads (Full Screen Ads) and Video Ads

The library is implemented for Android and iOS.

#Usage

Add the following build hints

android.xpermissions=<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
android.xapplication=<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" />
ios.add_libs=CoreTelephony.framework;SystemConfiguration.framework;CoreGraphics.framework;StoreKit.framework;AdSupport.framework;QuartzCore.framework;CoreMedia.framework;AVFoundation.framework;libz.dylib

init the SDK

    public void init(Object context) {
        try {
            Resources theme = Resources.openLayered("/theme");
            UIManager.getInstance().setThemeProps(theme.getTheme(theme.getThemeResourceNames()[0]));
            //init the startapp SDK
            manager = new StartAppManager();
            manager.initAndroidSDK(<account_id>, <android_app_id>, true);
            manager.initIOSSDK(<account_id>, <ios_app_id>, true);
            
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Load and Show the Ad

Call:

manager.loadAd(StartAppManager.AD_INTERSTITIALS);

or

manager.loadAd(StartAppManager.AD_REWARDED_VIDEO);

Notice the loading might take a few seconds.

When you wish to display the Ad call:

manager.showAd();

About

cn1lib for startapp ads network

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published