Android Development Friends League stats

Source: Internet
Author: User

      when we develop a good app will send it to the application market, but there is a very good application market (such as Pea pod, app Bao, Android Market, etc.) so the problem, if we want to count the number of downloads of the applications we have developed, we must add up the download volume of each application market, On this point will let you give up the idea, then there is no better way, the answer is yes, the statistics Ah, it can not only statistics our application downloads, startup times, but also statistics page visits, check the program bugs and so on, then how to use it? It is used in the following steps:
First, register your friend's account and apply for key

before integrating the Friends League SDK, you first need to register and add new apps to the Friends Alliance website to get Appkey

Special Reminder: The developer registers the account with the enterprise mailbox, avoids the use personal mailbox registration, prevents because of the personal resignation brings the question, the proposal uses the Account form: [email protected] Enterprise domain name, [email protected] Enterprise domain name , [email protected] Enterprise domain name. applications of different platforms prohibit the use of the same appkey, the application name of the AU backend is not related to the actual application name and package name, it is suggested to be named "Application name + platform". application steps such as:





So the first step to apply for Appkey has been completed
Download the Statistics SDK Umeng-sdk-analytics.zip and unzip.
Android App downloadsUmsdk_android_analytics_v5.4.2.zip and UnzipImport the jar package under Libs in the download package into the local project Libs subdirectory
three, basic function integration

3.1 manifest configuration mainly includes adding permissions, filling in the appkey and filling in the channel ID three parts, the code example is as follows:

<manifest……><   uses-sdk      android:minsdkversion    =   "4"    >   </ < Span style= "" >USES-SDK    >  <   uses-permission      android:name    =  < Span style= "Color:rgb (0,0,128)" > "Android.permission.ACCESS_NETWORK_STATE"    >  </ < Span style= "" >uses-permission    >  <   uses-permission      android:name    =  < Span style= "Color:rgb (0,0,128)" > "Android.permission.ACCESS_WIFI_STATE"    />  <   uses-permission      android:name    =  < Span style= "Color:rgb (0,0,128)" > "Android.permission.INTERNET"    >  </ < Span style= "" >uses-permission    >  <   uses-permission      android:name    =  < Span style= "Color:rgb (0,0,128)" > "Android.permission.READ_PHONE_STATE"    >  </uses-permission><application ……>……<activity ……/> < meta-data  android:value="Your_app_key"   android:name="Umeng_appkey">  </meta-data> <   Meta-data       android:value    =    "Channel ID "      android:name    =   "UMENG_ CHANNEL "   />  </application> </manifest>

3.2 Appkey Fill inReplace it with the <meta-data android:value="YOUR_APP_KEY" android:name="UMENG_APPKEY"></meta-data> YOUR_APP_KEY app you applied for in the Appkey (Appkey can be used in the stats backgroundstatistics analysis, settings, Application Information page view), other parts are not required to change. If you do not want to configure Appkey in manifest, you can configure it in activity: simply call this interface in activity at program startup: AnalyticsConfig.setAppkey(String appkey)


iv. Statistics of basic data
After the configuration of the above, the correct integration of the following code, to ensure that the correct new users, active users, start times, the length of the use of basic data.

Called in the Onresume method of each activity MobclickAgent.onResume(Context) , called in the OnPause methodMobclickAgent.onPause(Context)

        public void Onresume( ) {Super. Onresume (); Mobclickagent.onresume ( This);}        public void OnPause( ) {Super. OnPause (); Mobclickagent.onpause ( This);}
  • Make sure that all the activity calls MobclickAgent.onResume() and MobclickAgent.onPause() methods, which will not block the application's main thread or affect the performance of the application.
  • Note If you have an inheritance or control relationship between your activity, do not add the OnPause and Onresume methods in both the parent and child activity, which will result in duplicate statistics, resulting in abnormally higher boot times. (eg. when using Tabhost, Tabactivity, Activitygroup).
  • When the app is running in the background for more than 30 seconds (the default) and then back to the front end, it will be considered to be two separate sessions (boot), such as the user going back to home, or going to another program, after a period of time before returning to the previous application. This interval can be MobclickAgent.setSessionContinueMillis(long interval) defined by the interface: The parameter unit is in milliseconds.
  • If a developer calls a method such as Process.kill or system.exit to kill a process, be sure to call the Mobclickagent.onkillprocess (context) method before this to save the statistics.
By completing the above steps, you can count the number of application launches, new users and other data to run the app on your phone to show that our users have grown


analysis on the statistics and Problems of Friends league



Android Development Friends League stats

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.