How to get package name of camera application

前端 未结 4 2060
陌清茗
陌清茗 2021-01-06 16:33

Thanks for previous replies,

Is it possible to get Package name of camera application which is installed on the device? If the OS is customized the default package n

4条回答
  •  失恋的感觉
    2021-01-06 16:53

    see http://www.androidsnippets.com/get-installed-applications-with-name-package-name-version-and-icon

    class PInfo {
        private String appname = "";
        private String pname = "";
        private String versionName = "";
        private int versionCode = 0;
        private Drawable icon;
        private void prettyPrint() {
            Log.v(appname + "\t" + pname + "\t" + versionName + "\t" + versionCode);
        }
    }
    
    private ArrayList getPackages() {
        ArrayList apps = getInstalledApps(false); /* false = no system packages */
        final int max = apps.size();
        for (int i=0; i getInstalledApps(boolean getSysPackages) {
        ArrayList res = new ArrayList();        
        List packs = getPackageManager().getInstalledPackages(0);
        for(int i=0;i

提交回复
热议问题