Code example for PackageInfo

0
        PackageInfo pi;
        try { 
            pi = pm.getPackageInfo(app.getPackageName(), 0);
        } catch (NameNotFoundException eNnf) {
            // doubt this will ever run since we want info about our own package 
            pi = new PackageInfo();
            pi.versionName = "unknown";
            pi.versionCode = 69;
        } 
        Date theDate = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd_HH.mm.ss_zzz");
        result += "ENV\n";
        result += "Time=" + sdf.format(theDate) + "\n";
        result += "Device=" + Build.FINGERPRINT + "\n";
        try { 
            Field manufacturer = Build.class.getField("MANUFACTURER");
            result += "Make=" + manufacturer.get(null) + "\n";
        } catch (SecurityException e) {
        } catch (NoSuchFieldException e) {
        } catch (IllegalArgumentException e) {
        } catch (IllegalAccessException e) {