한국어   English

Adknowva Install Guide

Adknowva has an integration method based on Gradle. Plus, we supply sample applications thus, you may easily integrate our service through those examples. 
The full contents of guide documents are able to check by downloading the files from the “Download Sample App” menu at the bottom of this page.
Please check the latest version of Adknowva before your integration. Currently, the latest version is 1.2.1

Shortcuts

Manifest

- Add networkSecurityConfig (When you target Android 10(API level 29) or higher, please add requestLegacyExternalStorage)

<application
	android:allowBackup="true"
	android:requestLegacyExternalStorage="true"
	android:networkSecurityConfig="@xml/network"
	tools:replace="android:networkSecurityConfig"
	android:icon="@mipmap/ic_launcher"
	android:label="@string/app_name"
	android:roundIcon="@mipmap/ic_launcher_round"
	android:supportsRtl="true"
	android:theme="@style/AppTheme">

build.gradle(Project)

- Add Huvle Storage maven

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            name "Huvle"
            url "http://sdk.huvle.com:8080/repository/internal"
        }
    }
}

build.gradle(app)

- Add Adknowva and play-service-ads

android {
    ...
    defaultConfig {
        ...
        multiDexEnabled true
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    implementation 'com.google.android.gms:play-services-ads:19.3.0'
    implementation 'com.byappsoft.huvleadlib:HuvleAdLib:1.2.1'  // Please implement after checking the latest version.
}

Activity in which the advertisement will be applied

- onCreate

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate( savedInstanceState );
		setContentView( R.layout.activity_main );

		setHuvleAD(); // Call Huvle’s advertisement
	}

	// TODO - Huvle InApp Library
	private void setHuvleAD() {
		SDKSettings.useHttps(true);
		final BannerAdView staticBav = findViewById(R.id.banner_view);
		// For the "test" value below, please go to http://ssp.huvle.com/ to sign up > create media > Test your app after typing zoneid. Next, contact Huvle before releasing your app for authentication. You must not change the banner size.
		initBannerView(staticBav, "test",320,50);
	}
	private void initBannerView(final BannerAdView bav, String id, int w , int h) {
		bav.setPlacementID(id);
		bav.setAdSize(w, h);
		bav.setShouldServePSAs(false);
		bav.setClickThroughAction(ANClickThroughAction.OPEN_DEVICE_BROWSER); // Open the browser as the default browser when clicking on an advertisement
		bav.setResizeAdToFitContainer(true);
		AdListener adListener = new AdListener() {
			@Override public void onAdRequestFailed(AdView bav, ResultCode errorCode) {/*Handle when there is no advertiment*/}
			@Override public void onAdLoaded(AdView bav) {Log.v("Huvle_Banner", "The Ad Loaded!");}
			@Override public void onAdLoaded(NativeAdResponse nativeAdResponse) {Log.v("Huvle_Banner", "Ad onAdLoaded NativeAdResponse");}
			@Override public void onAdExpanded(AdView bav) {Log.v("Huvle_Banner", "Ad expanded");}
			@Override public void onAdCollapsed(AdView bav) {Log.v("Huvle_Banner", "Ad collapsed");}
			@Override public void onAdClicked(AdView bav) {Log.v("Huvle_Banner", "Ad clicked; opening browser");}
			@Override public void onAdClicked(AdView adView, String clickUrl) {Log.v("Huvle_Banner", "onAdClicked with click URL");}
			@Override public void onLazyAdLoaded(AdView adView) {}
		};
		bav.setAdListener(adListener);
		new Handler().postDelayed(new Runnable() {
			@Override public void run() {
				bav.loadAd();
			}
		}, 0);
	}
	// TODO - Huvle InApp Library

Download Sample App

- Adknowva Integration Sample : http://api.huvleview.com/ko/downloads/HuvleAdLibSample.zip
- Adknowva + Google Admob + HuvleSDK Integration Sample : http://api.huvleview.com/ko/downloads/HuvleAdLibSampleGoogle.zip