android 统计应用安装量
来源:互联网 发布:desmume mac 编辑:程序博客网 时间:2024/05/22 03:17
Installtion ID : UUID
统计应用安装量,google的官方做法是通过程序中生成UUID来完成需求。代码如下:
public class Installation { private static String sID = null; private static final String INSTALLATION = "INSTALLATION"; public synchronized static String id(Context context) { if (sID == null) { File installation = new File(context.getFilesDir(), INSTALLATION); try { if (!installation.exists()) writeInstallationFile(installation); sID = readInstallationFile(installation); } catch (Exception e) { throw new RuntimeException(e); } } return sID; } private static String readInstallationFile(File installation) throws IOException { RandomAccessFile f = new RandomAccessFile(installation, "r"); byte[] bytes = new byte[(int) f.length()]; f.readFully(bytes); f.close(); return new String(bytes); } private static void writeInstallationFile(File installation) throws IOException { FileOutputStream out = new FileOutputStream(installation); String id = UUID.randomUUID().toString(); out.write(id.getBytes()); out.close(); }}
原文详见: http://android-developers.blogspot.com/2011/03/identifying-app-installations.html
- android 统计应用安装量
- Android Studio统计项目代码量
- 统计量
- 统计量
- Android应用流量统计
- 好东西分享,推荐一个软件安装量统计工具!
- 几种代码量统计工具的安装及使用
- android 网络应用轻量框架
- 不要看!Android统计渠道包注册量
- Android应用的耗电量统计
- Android应用的耗电量统计
- Android应用的耗电量统计
- Android应用的耗电量统计
- Android应用流量统计调研
- App渠道统计技术选型参考:openinstall的App安装量统计的优势在哪里
- 快速统计量
- 统计量的含义
- 常见统计量
- 第一次C程序设计上机报告
- eclipse maven插件在线安装
- Android 第三方ROM CyanogenMod 源码下载,编译,刷机
- lua 中文教程 notes.
- 蓦然回首,那些命令都在灯火阑珊处
- android 统计应用安装量
- WPF 获取屏幕长宽(分辨率)
- Linux时间函数
- 剖析游戏开发用view还是surfaceView ?
- Android - LayoutInflater (转)
- HTML 以前没有注意到内容
- python之string.maketrans和str.translate
- 浅谈国内大部分移动游戏为啥不挣钱(二)
- 第 1次实验任务