Add Umeng statistics_php tutorial to the Android app

Source: Internet
Author: User
Add Umeng statistics to the Android app. The MacbookProMGX72AndroidStudio1.3.2Genymotion simulator is a mobile application statistical analysis platform. It can help add Umeng statistics to Android apps
Software and hardware environment
  • Macbook Pro MGX 72
  • Android Studio 1.3.2
  • Genymotion simulator
Preface

Umeng is a mobile application statistical analysis platform. It helps mobile app operators to collect statistics and analyze traffic sources, Product Retention data, user attributes, and behavior data, this allows product developers and operators to use data to make decisions on products, operations, and promotion strategies.

Integrate Umeng SDK

First, go to the Umeng official website http://www.umeng.com/register an account. after completing the registration, go to the management background to integrate the application of Umeng statistics, as shown below:

After submission, assign the key to your application as follows:

Right-click the jar file in development Studio and select Add as library to complete the import.

Configure AndroidManifest. xml

Add the following permissions:


  
  
  
  
  

Enter the key and channel id. only one channel can be added to a package, as shown below:


  
  
Integration code

Call MobclickAgent. onResume (Context) in the onResume method of each Activity, and call MobclickAgent. onPause (Context) in the onPause method ). If there is an inheritance relationship between activities, do not add the onResume and onPause methods repeatedly. otherwise, repeated statistics will appear, affecting the statistical results. If the App calls methods such as Process. kill or System. exit to kill a Process, call the MobclickAgent. onKillProcess (Context) method before killing the Process.

At this point, the basic functions have been integrated, and it is still very simple. Some of the subsequent advanced functions can be added as needed. the official documents are already detailed and will not be written here. if you are interested, go to Umeng's official website to view them.

References

1. http://www.umeng.com/
2. http://dev.umeng.com/analytics/android-doc/integration

IMG Pro MGX 72 Android Studio 1.3.2 Genymotion simulator preface Umeng is a mobile application statistical analysis platform. It can help shift...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.