Android

Clone URL of Demo:

http://dnsdk.vimedia.cn:8080/summary/VigameDemo-Android-Google.git

1:Add maven repositories

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'http://developer.huawei.com/repo/'}
        maven { url 'https://dl.bintray.com/umsdk/release' }
        maven {
            url 'https://android-sdk.is.com/'
        }
    }

    dependencies {
        classpath 'com.huawei.agconnect:agcp:1.1.1.300'
        classpath 'com.android.tools.build:gradle:3.4.3'
    }
}

2:Add in project gradle.properties

3:Implementation modules

4:Add proguard config

If the release version does not enable minify, you can skip

5:Add code in the project

5.1 Modify Application.java

Add code in the corresponding life cycle in MyApplication class:

Or

Made your MyApplication class inherit DNApplication:

5.2 Modify the main Activity

Change the main Acitivity to UniWbActivity or its subclasses.

6. Modify AndroidManifest.xml

Add related parameter configuration, And use VigameStartActivity as launch item.

7. Put in the configuration file and modify

Copy VigameConfig.xml and agrement.html to assets dictionary.

And You can configurate ConfigVigame.xml in assets. Property description is as follows:

Name

description

necessary

GameOpenActivity

the path of your main Activity

yes

ScreenOrientation

the orientation of screen

no

SupportAdPositions

the adPositionName of supports

no

WithSplashAD

Support splash ad

no

IsSDK

'true' always and don't modify

yes

CompanyIndex

the index of company,default 1

yes

8:Configuration items of test

1.Open app/build.gradle,modify package/channel/umeng appkey.

Recommendation the package name as follows for Advertising display

2. Modify the background of Splash AD.

If needs,add "bg_splash_vigame.png.png" file in res/drawable.

最后更新于

这有帮助吗?