Howto integrate to project

Vitaliy Petrov edited this page Apr 10, 2016 · 11 revisions

Add submodule to your project

    - mkdir $$PROJECT_ROOT/mobile
    - cd $$PROJECT_ROOT/mobile
    - git submodule add
    - git submodule update --init --recursive

And manual add Play Games C++ SDK Version 2.1 from to adctl/3rd/gpg-cpp-sdk

Move your 'android' folder to $$PROJECT_ROOT/mobile/android (for example).

Include .pri in your project

    #AdCtl: Google Analytics, AdMob,
    ANDROID_PACKAGE_SOURCE_DIR = $$PWD/mobile/android
    android {
      OTHER_FILES += \

Include in your AndroidMainifest.xml some lines

As described at this or

At first string inside 'application' tag:
<!--This meta-data tag is required to use Google Play Services and AdMob.-->
<meta-data android:name="" android:value="@integer/google_play_services_version"/>
<meta-data android:name="" android:value="@string/app_id"/>

In main activity:

<activity android:configChanges="..." android:name="ru.forsk.AdCtl.AdCtlActivity" android:label="..." android:screenOrientation="portrait" android:launchMode="singleTop">

After first activity:

        <!--Include the AdActivity configChanges and theme. -->
        <activity android:name="" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" android:label="Тёмные истории">
            <meta-data android:name="" android:value="darkstories"/>

Before < / manifest >:

        <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

That's all!

Gradle/And dependencies

As described here add dependencies to your Gradle or Ant files.

Gradle. Make sure that you have installed Google Repository, Google Play services and Android Support Repository in android sdk. Add dependencies in build.gradle:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile ''
    compile ""

Ant. Copy google-play-services_lib/ folders from android-sdk/extras/google/google_play_services/libproject/ directory to your AndroidManifest.xml location

Create file if not exists in your AndroidManifest.xml location and add to end of it:


Note: If you use Game Services, you must specify files:


Howto using library

By default all library features are disabled. You must enable features you want to use. Please read more in:

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.