添加首页轮播图数据统计

This commit is contained in:
huangzhuanghua
2016-11-14 19:01:27 +08:00
parent 9eb68e641c
commit 6ccc3e5cc6
9 changed files with 237 additions and 148 deletions

View File

@ -28,6 +28,7 @@ import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.android.volley.Request;
import com.android.volley.Request.Method;
import com.android.volley.Response;
import com.android.volley.VolleyError;
@ -59,6 +60,7 @@ import com.gh.gamecenter.entity.AppEntity;
import com.gh.gamecenter.entity.GameDigestEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.GameUpdateEntity;
import com.gh.gamecenter.entity.SlideEntity;
import com.gh.gamecenter.eventbus.EBDownloadStatus;
import com.gh.gamecenter.eventbus.EBPackage;
import com.gh.gamecenter.eventbus.EBShowDialog;
@ -265,6 +267,48 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
map.put("installed", downloadEntity.getInstalled());
map.put("network", NetworkUtils.getConnectedType(MainActivity.this));
DataCollectionManager.onEvent(MainActivity.this, "download", map);
if (downloadEntity.getEntrance().matches("^" + "\\(游戏\\-插件:滚动图\\[.+\\]\\)" + "$")) {
// 首页轮播图数据统计
statLunbotuData(downloadEntity.getEntrance());
}
}
// 首页轮播图数据统计
private void statLunbotuData(String entrance) {
int start = entrance.indexOf("[");
int end = entrance.indexOf("]");
if (start != -1 && end != -1) {
entrance = entrance.substring(start + 1, end);
String[] values = entrance.split("=");
if (values.length == 3) {
Map<String, String> map = new HashMap<>();
map.put("location", values[2]);
map.put("type", values[1]);
map.put("title", values[0]);
map.put("form", "download");
String version = PackageUtils.getVersion(this);
String user = DeviceUtils.getDeviceID(this);
String channel = (String) PackageUtils.getMetaData(this, getPackageName(), "TD_CHANNEL_ID");
map.put("version", version);
map.put("user", user);
map.put("device_id", TokenUtils.getDeviceId(this));
map.put("channel", channel);
String url = Config.DATA_HOST + "api/v1d0/log";
Map<String, String> params = new HashMap<>();
params.put("topic", "lunbotu");
params.put("source", "GH-ASSIST-Client");
params.put("time", String.valueOf(Utils.getTime(this)));
params.put("content", new JSONObject(map).toString());
StringExtendedRequest request = new StringExtendedRequest(Request.Method.POST, url, null, null);
request.setParams(params);
request.setShouldCache(false);
AppController.addToRequestQueue(request);
}
}
}
private void processHijack(DownloadEntity downloadEntity) {