如何以编程方式获取apk文件名和路径? [英] How can i get the apk file name and path programmatically?

查看:125
本文介绍了如何以编程方式获取apk文件名和路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我已经知道目标apk的程序包名称,我想获取程序的确切文件名.例如,如果我知道我的apk的包名称,即com.packagename,我如何获得该包的确切路径和文件名?顺便说一句,我不想​​只获得我的apk位置,我想要我申请的任何软件包名称的位置. SystemTuner pro能够做到这一点,所以我知道这是可能的,只是不确定如何做到.

I want to get the exact file name of a program if I already know the package name of the target apk. For instance, if I know the package name of my apk, which is com.packagename, how can I get the exact path and file name of that package? Btw, i don't want to get just MY apk location, i want the location of any package name i apply. SystemTuner pro is able to do this so i know it is possible, just not sure how.

谢谢大家!

推荐答案

PackageManager.getPackageInfo() returns information about the package, and PackageInfo.applicationInfo field has required information about the application.

这篇关于如何以编程方式获取apk文件名和路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆