简体   繁体   English

如何检查应用程序在Android设备中的存在?

[英]How to check the presence of app in android device?

I'm working on a VoIP SDK.我正在研究 VoIP SDK。 A device may contain more than one app having my SDK.一台设备可能包含多个拥有我的 SDK 的应用程序。 I want to know the Presence of App A from App B .我想从 App B知道App A存在 Is that possible with or without using any device permission?无论是否使用任何设备许可,这都可能吗?

Though I don't receive any answer, So I'm giving the easiest solution applied by me.虽然我没有收到任何答案,所以我给出了我应用的最简单的解决方案。 Use PackageManager to get presense of other app.使用 PackageManager 获取其他应用程序的存在。 All you need is ApplicationID of that app.您只需要该应用程序的ApplicationID

    android.content.pm.PackageManager mPm = getPackageManager();  
    PackageInfo info = null;  
    try {
        info = mPm.getPackageInfo("<Put applicationID here>", 0);
        Boolean installed = info != null;
        Log.d("TAG","isInstalled : "+ "" + installed);
    } catch (PackageManager.NameNotFoundException e) {
        Log.d("TAG","not Installed");
        e.printStackTrace();
    }

If no application found with respect to applicationId passed, control would go to catch block.如果没有找到与 applicationId 相关的应用程序,则控制将转到 catch 块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android - 检查是否存在其他应用程序 - Android - check for presence of another app 如何在 Android 上检查设备中是否存在应用程序 - How to check exists app in device on Android 如何查看Android App是否为设备所有者? - How to check if an Android App is a device owner? 如何检查在移动Android设备或台式机Android设备(Android-x86 OS)上运行的android应用? - How to check a android app is running on mobile android device or desktop android device(Android-x86 OS)? 带有Asmack的Android-如何在android中检查XMPP中的用户状态? - Android with Asmack -How to check user presence status in XMPP in android? Android App 如何检查设备是空闲还是移动? - How to check whether the device is idle or moving for Android App? 打开移动设备时如何查看我的 android 应用程序? - how to check in my android app when switch on mobile device? 如何在Android中检查设备是否支持应用内结算v3 - How to check if device is supports in-app billing v3 in android Unity App:如何检查 Android / IOS 设备上剩余的可用空间 - Unity App: How to check available space left on Android / IOS device Android-如何检查我的应用之前是否已安装到设备上? - Android - how to check was my app installed to device before?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM