Java tutorial
//package com.java2s; import android.app.Activity; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; public class Main { public static String getVersion(Activity activity) { try { PackageInfo pInfo = activity.getPackageManager().getPackageInfo(activity.getPackageName(), 0); return pInfo.versionName; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); return "0"; } } }