Installtion ID : UUID 统计安装
来源:互联网 发布:电路板设计软件下载 编辑:程序博客网 时间:2024/05/20 22:03
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(); }}
0 0
- Installtion ID : UUID 统计安装
- UUID唯一的ID
- 唯一ID java.util.UUID
- UUID 设备ID 系统版本
- C#使用UUID生成ID
- UUID全球唯一的ID
- mysql给id生成uuid
- ubuntu apt-get 安装软件时package has no installtion candidate问题
- 利用UUID()函数将数据表ID改为UUID
- 全局唯一ID--UUID介绍、JAVA中UUID的使用
- PHP安装UUID模块
- postgresql uuid-ossp安装
- uuid安装使用
- 应用程序中主键ID生成与UUID
- Java中的UUID类(生成唯一ID)
- Python使用UUID库生成唯一ID
- solr id 配置成uuid问题
- 在数据库中用 UUID 来做ID
- ITIL介绍
- 初识Node.js<一>DNS查询的例子
- H3C 交换机端口汇聚
- 多图表单上传
- java学习笔记1--开发环境平台总结
- Installtion ID : UUID 统计安装
- Android中View类OnClickListener和DialogInterface类OnClickListener冲突解决办法
- 序列化和反序列化系列博客(一)—— What and Why?
- 结构【重学C之六】
- ref和out的使用与区别
- (图文)在MyEclipse(2015)中上传项目到github的步骤(很详细)
- 发现群组(二)分级聚类
- 6种排序大集合--由小到大,由大到小!
- java学习笔记2--数据类型、数组