sa-sdk-android-plugin
The official Android SDK Plugin for Sensors Analytics
快速集成
Gradle 编译环境(Android Studio)
(1)在 project 级别的 build.gradle 文件中添加 android-gradle-plugin 依赖:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
//添加 android-gradle-plugin 依赖
classpath 'com.sensorsdata.analytics.android:android-gradle-plugin2:2.0.4'
}
}
allprojects {
repositories {
jcenter()
}
}
(2)在 主 module 的 build.gradle 文件中添加 com.sensorsdata.analytics.android 插件、Sensors Analytics SDK 依赖及指定 weave 哪些 module:
apply plugin: 'com.android.application'
//添加 com.sensorsdata.analytics.android 插件
apply plugin: 'com.sensorsdata.analytics.android'
dependencies {
compile 'com.android.support:appcompat-v7:25.1.1'
//添加 Sensors Analytics SDK 依赖
compile 'com.sensorsdata.analytics.android:SensorsAnalyticsSDK:2.0.2'
}
注: 1、由于 SDK 会依赖 appcompat-v7 处理下面几个控件:
- android.support.v7.widget.SwitchCompat
- android.support.v7.app.AlertDialog
需要添加下面依赖( 如果项目中已引入了 v7包,可以不添加 ):
compile 'com.android.support:appcompat-v7:25.1.1'
感谢
gradle_plugin_android_aspectjx
新书推荐
神策数据出品的《Android 全埋点解决方案》发售啦!!!
To Learn More
See our full manual
License
Copyright 2015-2017 Sensors Data Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.gradle_plugin_android_aspectjx