Giter VIP home page Giter VIP logo

sa-sdk-android-plugin's Introduction

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-plugin:1.1.2'
    }
}

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:1.8.6'
}

如下示例图:

: 1、在 project 级别的 gradle.properties 中添加如下配置:

android.enableBuildCache=false

如下示例图:

如果开启 buildCache,Android Studio 会把依赖的 jar 或 arr 缓存到本地,并且把模块名称设置为 hash 值,导致 includeJarFilter 配置失效。

2、目前全埋点不支持 Android Studio 的 instant run 特性,使用全埋点需要关闭该特性。

如下示例图:

3、由于 SDK 会依赖 appcompat-v7 处理下面几个控件:

  • android.support.v7.widget.SwitchCompat
  • android.support.v7.app.AlertDialog

需要添加下面依赖( 如果项目中已引入了 v7包,可以不添加 ):

compile 'com.android.support:appcompat-v7:25.1.1'

To Learn More

See our full manual

License

Copyright 2016 firefly1126, 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.gradle_plugin_android_aspectjx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.