boolean isAppExist(Context context, String appPkg) { try { IBundleManager manager = context.getBundleManager(); return manager.isApplicationEnabled(appPkg); } catch (IllegalArgumentException e) { return false; } } |
public void launchAppDetail(String appPkg.String AbilityName){ Intent intent = new Intent(); Set<String> entities = new HashSet<>(); entities.add("android.intent.category.LAUNCHER"); Operation operation = new Intent.OperationBuilder() .withDeviceId("") .withBundleName(appPkg) .withAbilityName(AbilityName) .withAction("android.intent.action.MAIN") .withFlags(Intent.FLAG_NOT_OHOS_COMPONENT) .withEntities(entities) .build(); intent.setOperation(operation); startAbility(intent); } |
public void AppShop(String appPkg){ HiLog.info(log,"launchAppDetail"); try { if(appPkg.isEmpty())return; Uri uri = Uri.parse("market://details?id="+appPkg); HiLog.info(log,"uri:"+uri); Intent intent = new Intent(); intent.setUri(uri).addFlags(Intent.FLAG_ABILITY_NEW_MISSION); startAbility(intent,0); }catch (Exception e){ e.printStackTrace(); } } |
public void AppWeb(String url){ Intent intent = new Intent(); Operation operation = new Intent.OperationBuilder() .withUri(Uri.parse(url)) .build(); intent.setOperation(operation); startAbility(intent); } |
// 微信 包名 com.tencent.mm //启动类名:com.tencent.mm.ui.LauncherUI //QQ 包名 com.tencent.mobileqq //启动类名:com.tencent.mobileqq.activity.HomeActivity //支付宝 包名:com.eg.android.AlipayGphone //启动类名com.eg.android.AlipayGphone.FastStartActivity //钉钉 包名:com.alibaba.android.rimet //启动类名:com.alibaba.android.rimet.biz.home.activity.HomeActivity //QQ空间 包名:com.qzone //QQ手机管家 包名:com.tencent.qqpimsecure //微博 包名:com.sina.weibo //启动类名:com.sina.weibo.EditActivity //天天动听 包名:com.sds.android.ttpod //中华万年历 包名:cn.etouch.ecalendar //百度地图 包名:com.baidu.BaiduMap //高德地图 包名:com.autonavi.minimap //启动类名:com.autonavi.map.activity.SplashActivity //信息 包名:com.android.mms //设置 包名:com.android.settings //浏览器 包名:com.android.browser //计算器 包名:com.android.calculator2 //时钟 包名:com.android.deskclock //图库 包名:com.android.gallery3d //相机 包名:com.android.hwcamera //音乐 包名:com.android.mediacenter //收音机 包名:com.huawei.android.FMRadio //录音机 包名:com.android.soundrecorder //UC浏览器 包名:com.UCMobile //美图秀秀 包名:com.mt.mtxx.mtxx //PPTV 包名:com.pplive.androidphone //书旗免费小说 包名:com.shuqi.controller //360手机助手 包名:com.qihoo.appstore //360卫士 包名:com.qihoo360.mobilesafe //360清理大师 包名:com.qihoo.cleandroid_cn //百度手机助手 包名:com.baidu.appsearch //豌豆荚 包名:com.wandoujia.phoenix2 //小米应用商店 包名:com.xiaomi.market //华为应用商店 包名:com.huawei.appmarket //安智应用商店 包名:com.hiapk.marketpho //R.E.管理器 包名:com.speedsoftware.rootexplorer //PP手机助手 包名:com.pp.assistant //OPPO应用商店 包名:com.oppo.market //联想应用商店 包名:com.lenovo.leos.appstore //应用宝 包名:com.tencent.android.qqdownloader apk包名原文链接:https://blog.csdn.net/qq_38922435/article/details/113810563 |