(Android application source code Baidu statistical example
There are few example codes of Baidu statistical function. You need to have your own baidu account. You can go to Baidu background to check the software
package com. example. baiducount;
import android. app. Activity;
import android. os. Bundle;
import com. baidu. mobstat. StatService;
/*
*
*Demo of Baidu statistics
*/
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super. onCreate(savedInstanceState);
setContentView(R.layout.main);
}
public void onResume() {
super. onResume();
/**
*Page start (each activity needs to be added. If the call has been added in the inherited parent activity, it must not be added in the child activity)
*Cannot be associated with statservice Onpagestart and onpageend functions of the first level are used interchangeably
*/
StatService. onResume(this);
}
public void onPause() {
super. onPause();
/**
*End of page (each activity needs to be added. If the call has been added in the inherited parent activity, it must not be added in the child activity)
*Cannot be associated with statservice Onpagestart and onpageend functions of the first level are used interchangeably
*/
StatService. onPause(this);
}
})