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...