-
Notifications
You must be signed in to change notification settings - Fork 7
SDKの組み込み方法
nendSDKの導入方法は下記2パターンからどちらか一方をプロジェクトの状況にあわせて選択してください。
AndroidXへの移行が必要です。
Googleから案内されているAndroid Studio を使用して既存のプロジェクトを移行するをご確認ください。
Gradleバージョンが7以上の場合
-
settings.gradleのdependencyResolutionManagementにmavenリポジトリの情報を追加します。
dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() // <- 定義済みの場合は新たに追記不要です mavenCentral() maven { // nendSDK url 'https://fan-adn.github.io/nendSDK-Android-lib/library' } } }
-
build.gradleのdependenciesに利用するライブラリの情報を追加します。
dependencies { // ~省略~ // nendSDK implementation 'net.nend.android:nend-sdk:10.0.0' }
Gradleバージョンが7未満の場合
-
build.gradleのrepositoriesにmavenリポジトリの情報を追加します。
repositories { // ~省略~ google() // <- 定義済みの場合は新たに追記不要です maven { // nendSDK url 'https://fan-adn.github.io/nendSDK-Android-lib/library' } }
-
build.gradleのdependenciesに利用するライブラリの情報を追加します。
dependencies { // ~省略~ // nendSDK implementation 'net.nend.android:nend-sdk:10.0.0' }
-
サブプロジェクトの配下にlibsディレクトリを作成し、そこへnendSDKのaarファイルを配置します。
-
aarファイルとnendSDK内部の依存性を追加するため、nendSDKを利用するサブプロジェクトのbuild.gradleを以下のようにします。
dependencies { implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs') implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.32' implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' implementation 'androidx.appcompat:appcompat:1.4.2' //定義済みの場合は不要 implementation 'androidx.constraintlayout:constraintlayout:2.1.2' implementation 'androidx.preference:preference:1.1.1' }
Android Studio 4.2以下での導入方法
-
メニュータブの File > New > New Module... から、Import .JAR/.AAR Package を選択します。
-
ダウンロードした aar ファイルを選択します。 Subproject name: に付けた名前が build.gradle ファイルや settings.gradle ファイル、また
3
の手順に使用される nendSDK の名前になります。 -
File > Project Structure (またはプロジェクトを右クリック > Open Module Settings) から Dependencies > Modules で対象のプロジェクトを選択して
+
をクリックし、3 Module Dependency から (2) でインポートした nendSDK を選択します。
build.gradle ファイルに3
で追加した nendSDK が compile project として追加されていれば aar ファイルの組み込みは完了です。
aar ファイルを直接組み込んだ際は以下のライブラリをプロジェクトに別途追加してください。
最終的に以下のようになっていれば nendSDK の組み込みは完了です。
build.gradle
dependencies {
// ~省略~
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.32'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'androidx.appcompat:appcompat:1.4.2' //定義済みの場合は不要
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.preference:preference:1.1.1'
implementation project(':nendSDK')
}
SDKを組み込むアプリの targetSdkVersion
が 33以上
の場合、広告IDを取得するために、 AndroidManifest.xml
に以下の権限の追加することを強く推奨します。
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
より詳しい内容は以下をご覧ください。
- 広告IDの取り扱いに対するプライバシーとセキュリティの更新のお知らせ
- 権限追加に関する詳しい内容と追加方法
v9.0.0から位置情報取得機能を完全に削除しました
Gradleビルドを実行するとnendSDKが利用できるようになります。
実装手順に従い、コードを記述していきます。
-
2023年9月1日より、SDK v6.0.0未満では動画広告の配信を停止いたします。新しいバージョンのご利用をご検討ください。
-
Google Play Consoleのデータセーフティに関して、nendSDKのデータ収集項目のページを追加しました。詳しくはこちらをご覧ください。
-
Android 13より、Google Advertising IDのアクセスのために権限の追加を強く推奨しています。詳しくはSDKの組み込み方法をご覧ください。
-
v9.0.0よりSDK内部の依存性及び位置情報機能の完全な削除を行いました。詳しくは更新履歴を御覧ください。
-
らくらくスマートフォンの
F-01L
にて、特定のOSバージョンでバナー広告利用時にアプリがクラッシュするという報告を一部のメディア様から頂いております。詳細はこちらをご確認ください。 -
Google Play Services r30 よりライブラリプロジェクトの提供がなくなり、今後はEclipseプロジェクトへのGoogle Play Servicesの導入が不可能となったため、nendSDKにおいてもEclispeでの導入・開発のサポートを終了させていただきました。
EclipseからAndroidStudioへの移行はこちらをご参照ください。 -
Googleのデベロッパーポリシーの更新に伴い、v3.1.0のSDKよりインタースティシャル広告のアプリ終了時表示機能を廃止させていただきました。
-
Effective September 1, 2023, we will stop serving video ads with SDK under v6.0.0. Please consider using a newer version.
-
For data safety section in Google Play Console, We added a page about data collection used on nendSDK. For details, please see here.
-
Since Android 13, we highly recommend add the permision to access Google Advertising ID. For details, please see About integrate the SDK.
-
In v9.0.0, a new dependency had been added to the sdk and all functions of collecting location data are completely deleted.
-
We have received reports from some media that a model of smartphone,
F-01L
crashes when using banner ads on a specific OS version. For details, please check here. -
nendSDK terminated the introduction and development support of Eclispe as Google Play Services (r30) no longer provides library project and impossible to install Google Play Services to the Eclispe project.
Please check the link below for how to transfer from Eclipse to AndroidStudio. -
With the update of Google Developer Policy, we terminated the function to show interstitial ads before the user closes the app from v3.1.0 SDK.
- バナー型広告
- アイコン型広告
- インタースティシャル広告
- ネイティブ広告
- フルボード広告
- 動画広告
- 動画ネイティブ広告
- Release Notes
- Preparation
- Supported Devices and IDE
- nendSDK Data Collection Items
- nendSDK Privacy Policy
- About Information Button
- Banner Ad
- Icon Ads
- Interstitial Ad
- Native Ad
- Fullscreen Ad
- Video Ad
- Native Video Ad