Follow

First Steps - Mandatory

View original article on our GitHub.

Step 1, Adding the SDK package to your Unity project

In order to add StartApp SDK to your application please follow the following steps:

1. Unzip the SDK files to a temporary folder
2. Import StartAppAndroidUnitySDK-x.x.x.unitypackage as a Custom Package (or drag and drop it to your "Assets" folder under the "Project" Window)

3. Import all the package's items by pressing "All" and then "Import".
If you are using a custom AndroidManifest.xml and don't want to override it with the one provided by this package, just uncheck the "AndroidManifest.xml". In this case, you must update the manifest manually as described in the next step.

 

Step 2, Updating your Manifest File

NOTES: If you are using a custom AndroidManifest.xml and didn't import it in the previous step, make sure to follow this step.
If you have imported the entire package you can skip this step and move on to step 3.

Update the manifest.xml (in the Android folders) as follow:

1. Make sure the following activities are declared under the <application> element:

<activity android:name="com.startapp.android.publish.list3d.List3DActivity"
          android:hardwareAccelerated="true"
          android:theme="@android:style/Theme" />
<activity android:name="com.startapp.android.publish.OverlayActivity"
          android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
          android:hardwareAccelerated="true"
          android:windowSoftInputMode="stateHidden"
          android:configChanges="orientation|keyboardHidden|screenSize" />
<activity android:name="com.startapp.android.publish.FullScreenActivity"
          android:hardwareAccelerated="true"
          android:theme="@android:style/Theme"
          android:configChanges="orientation|keyboardHidden|screenSize" />

2. Make sure the meta-data parameter named unityplayer.ForwardNativeEventsToDalvikis set to true:

<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />

3. Add the following mandatory permissions

<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"/>

4. Optional - add the following permissions (allow StartApp to show higher eCPM Geo-targeted ads):

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

 

Updating your StartApp data file

Update the StartAppData.txt file (in the Assets/Resources folders) by adding your StartApp Application ID after applicationId=

You can find your Application ID in the publishers’ portal - click on the "Apps and Sites" tab on the left pane and choose the relevant ID from your app list:

SDK Initialization

In the Start() method of your script, call the following static function:

void Start() {
#if UNITY_ANDROID
StartAppWrapper.init();
#endif
}
Was this article helpful?
4 out of 4 found this helpful
Have more questions? Submit a request

Comments

  • Avatar
    Seena Technocratics

    Excuse me. I am wandering since last 1 hours and unable to find your .unitypackage. This is very annoying.