/** * Returns the identifier of this process's user. * 返回此进程的用户的标识符. */ Log.e(TAG, "Process.myUid() = " + android.os.Process.myTid()); /** * Returns the identifier of this process, which can be used with * killProcess and sendSignal. * 返回此进程的标识符
这段时间公司项目中为了支持XP系统同事代码中用到了 GetThreadId 这个微软的API 但是这个API最低支持版本是 Windows version Windows Vista [desktop apps | UWP apps] Windows Server 2003 [desktop apps | UWP apps] 最后使用了 ZwQueryInformationThread 来解决 解决以后记录下 如果又遇到同样问题的 可以参考 参考文档 http://undocumented.nt
如何在不同的语言/平台中获取Android ID 最近开发工作中需要使用到AndroidID,在Unity和native code中也需要使用,java获取很方便,Unity中也不难,最难的是在native code中获取. 获取android ID需要有一个上下文实例,也就是Context实例,看下面的java获取方式: 在java中获取 Android原生代码,这个是最简单的: public static String GetAndroid(Context context){ final S