[英]How to check if an android application was installed even if it is removed from the device
[英]Titanium: Check if application installed on the device (android)
我如何檢查Android設備上是否安裝了應用程序(例如,通過應用程序ID - com.foo.bar)? 或者,我如何獲得設備上安裝的所有Android應用程序的列表? 我用鈦金屬手機。 謝謝!
您可以獲得所有已安裝的應用程序。
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> appData = packageManager.queryIntentActivities(
mainIntent, 0);
for (ResolveInfo appInfo : appData) {
Application application = new Application();
application.setApplicationName(appInfo.loadLabel(packageManager)
.toString());
}
這里編寫的代碼確實是一個Java代碼。 我不認為Titanium公開了一種訪問您正在尋找的信息的方法。
您可以做的是用Java編寫自己的原生Titanium模塊,使用kalyanpvs編寫的代碼並在javascript中使用它。
請查看http://docs.appcelerator.com/titanium/latest/#!/guide/Android_Module_Development_Guide ,了解有關Android鈦模塊開發的更多信息。
我正在猜測你的要求,但可以將網址鏈接到你的應用程序。
當您嘗試從任何來源(例如短信,電子郵件)加載該網址時,如果您擁有該網址,它將打開該應用,否則它只會在您的瀏覽器中打開該網址。
請參閱此處: Android在Intent中響應URL
這些幫助有用?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.