我不知道是否有一种方法可以知道,我的应用程序是由供应商pinstalled(以及从Android Market没有安装)$ P $。应用也是在Android Market中可用,并且可以从那里进行更新。
I wonder whether there is a way to know that my app is preinstalled by vendor (and not installed from Android Market). Application is also available in Android Market and can be updated from there.
一个解决方法是在本地文件系统中创建一个文件(我们可以建立一个特殊的应用程序版本供应商)。但有一种情况,即应用程序可以从市场上更新了它的第一次运行前,并没有创建的文件。
One solution is to create a file in the local file system (we can build a special app version for vendor). But there is a case that application can be updated from the market before its first run, and file is not created.
那么,有没有其他办法?也许,安装路径?
So is there any other way? Probably, installation path?
另外它们也同样吸引这$ P $不管Android Market的应用程序检查,像它的谷歌地图进行pinstalled应用程序的自动更新。
Also it's interesting whether Android Market app checks this preinstalled app for updates automatically like it's performed for Google Maps.
您必须让你的包ApplicationInfo(与PackageManager),然后检查它的标志。
You have to get the ApplicationInfo of your package (with the PackageManager) and then check its flags.
if (android.content.pm.ApplicationInfo.FLAG_SYSTEM & myApplicationInfo.flags) != 0)
// It is a pre embedded application on the device.
上一篇:Android的NDK - 它支持直臂code或只是拇指拇指、Android、NDK、code
下一篇:Android的谷歌地图V2 - OnInfoWindowClick几个标志物几个、地图、标志物、Android