Coder Social home page Coder Social logo

analyticssdkdemo's Introduction

AnalyticsSDKDemo

What

AnalyticsSDKDemo 演示了如何在 Android 工程中集成 TalkingData Analytics SDK 的接口功能。

How

  1. 访问 TalkingData 官网 注册帐号并按照提示申请 AppId

  2. AndroidManifest.xml 中添加下面的权限:

     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"  />
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"  />
     <uses-permission android:name="android.permission.GET_TASKS"  />
    
  3. 在 Android 工程 Application 类的 onCreate 方法中执行下面的代码初始化 SDK:

     TCAgent.LOG_ON = true;
     TCAgent.init(this, "[Your AppId]", "[Your ChannelId]");
     TCAgent.setReportUncaughtExceptions(true);
    

    另外,也可以像 Demo 中演示的那样将 AppIdChannelIdMetaData 的形式在 AndroidManifest.xml 文件中声明,

     <meta-data android:name="TD_APP_ID" android:value="Your_app_id" />
     <meta-data android:name="TD_CHANNEL_ID" android:value="Your_channel_id" />
    

    然后可以在初始化时这样调用:

     TCAgent.init(this);
    
  4. MainActivity 类中演示了如何进行 Activity 生命周期的跟踪和自定义事件的记录。

  5. FMActivity 类中演示了如何对 Fragment 生命周期进行跟踪。

更详细的 SDK 接口解释和集成文档请参考 Analytics SDK 集成文档

analyticssdkdemo's People

Contributors

hkxhrwang avatar lwq6211 avatar

Watchers

 avatar

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.