Java tutorial
//package com.java2s; import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; public class Main { /** * get app package info */ public static PackageInfo getAppPackageInfo(Context context) { PackageManager pm = context.getPackageManager(); try { return pm.getPackageInfo(context.getPackageName(), 0); } catch (Exception e) { e.printStackTrace(); } return null; } }