How to get build/version number?

Hey,
If you need to get or control your application’s build/version number. You access them easily.
Java:
try {
    PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
    version = pInfo.versionName;
    int versionCode = pInfo.versionCode;
    Log.d("MyApp", "Version Name : "+version + "\n Version Code : "+versionCode);
} catch(PackageManager.NameNotFoundException e) {
    e.printStackTrace();
    Log.d("MyApp", "PackageManager Catch : "+e.toString());
}

Markdown:
try {
    PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
    version = pInfo.versionName;
    int versionCode = pInfo.versionCode;
    Log.d("MyApp", "Version Name : "+version + "\n Version Code : "+versionCode);
} catch(PackageManager.NameNotFoundException e) {
    e.printStackTrace();
    Log.d("MyApp", "PackageManager Catch : "+e.toString());
}
PackageInfo class let you access build and version number. As you can see pInfo.versionName will get you the full version and pInfo.versionCode will get you just the version code.
So simple, so easily :)
If you have any question, ask me :)

How to extract filename from Uri?

Now, we can extract filename with and without extension :) You will convert your bitmap to uri and get the real path of your file. Now w...