NameNotFoundException if a package with the given name can not be found on the system. However, I could not imagine a scenario for that! Sean Hall Sean Hall 5, 2 21 The question was not about PhoneGap.

Your answer might just confuse people. BobbyJ Nowhere in the question, title, or tags does it specify that the question was about a native application.

This is what came up on google when I was searching for the answer, and would have saved me several hours. In this example you can see how silly it is to use third party solutions to create apps.

When you wrote it yourself from scratch it was just a couple of lines to code. Velayutham M Velayutham M 4 A very simple way is: For xamarin users, use this code to get version name and code 1 Version Name: Tushar patel Tushar patel 2, 1 17 Always do it with try catch block: Pratik Butani Pratik Butani Here is the method for getting the version code: Kevin Wallis 3, 3 16 Gevaria Purva Gevaria Purva 4 Better method - BuildConfig.

Shubham Gupta Shubham Gupta 79 1 5. If you want to use it on xml then add below line on your gradle file: Irfan Raza Irfan Raza 2, 1 15 Please double check if still working.

Checked with api Get version from PackageManager. This is the best way for most cases. So use only in non-library projects!

There is a workaround - set version for output apk file manually: H 2 JasonChiu JasonChiu 1 5. Durul Dalkanat Durul Dalkanat 4, 2 27 If you are using un official root for Android device.

I thing, you will need. This is my approach. Thanks for the help Durul Dalkanat: Explore these carousel items.

Unlevel the playing field Android TV personalizes your entertainment experience so you can enjoy more and browse less.

Technology that moves you Android Auto is designed with the driving environment in mind, from Google Maps to voice controls.

Come on, get appy With more apps than iOS, Android puts a world of options at your fingertips. Apps Carousel Explore a selection of Android applications that you can use to make your Android phone, tablet, wearable, auto console and television one-of-a-kind.

Sojtin You ever get it working? As a follow-up, we actually stopped using this method in favour of just a static integer and a static String for the versionCode and versionName , respectively.

Only because some tools like Code Push attempt to get your version number by parsing your build. June7 4, 5 11 Usman Khan 4, 33 Michael Michael 2, 4 23 Do you think that NNFE can be really thrown?

It would be weird to not find a running application in the package manager: NameNotFoundException if a package with the given name can not be found on the system.

However, I could not imagine a scenario for that! Sean Hall Sean Hall 5, 2 21 The question was not about PhoneGap. Your answer might just confuse people.

BobbyJ Nowhere in the question, title, or tags does it specify that the question was about a native application. This is what came up on google when I was searching for the answer, and would have saved me several hours.

In this example you can see how silly it is to use third party solutions to create apps. When you wrote it yourself from scratch it was just a couple of lines to code.

Velayutham M Velayutham M 4 A very simple way is: For xamarin users, use this code to get version name and code 1 Version Name: Tushar patel Tushar patel 2, 1 17 Always do it with try catch block: Pratik Butani Pratik Butani Here is the method for getting the version code: Kevin Wallis 3, 3 16 Gevaria Purva Gevaria Purva 4 Better method - BuildConfig.

Shubham Gupta Shubham Gupta 79 1 5. If you want to use it on xml then add below line on your gradle file: Irfan Raza Irfan Raza 2, 1 15 Please double check if still working.

Checked with api Get version from PackageManager. This is the best way for most cases. So use only in non-library projects! Drive anywhere with turn-by-turn navigation and real-time traffic information, right from your phone.

Android comes in all shapes and sizes thanks to capabilities launched with Donut which allowed Android to run on a variety of screen resolutions and aspect ratios.

This opened the door for phones featuring displays other than x portrait. Before there was Google Play, there was Android Market. It also planted the seeds for Android to come in all shapes and sizes - meanwhile Android Market came of age.

Explore these carousel items. Use the previous and next buttons, as well as the keyboard arrows, to change the displayed item. Permissions Define what you want to share with apps on your device and when.

Battery Enjoy a battery that works smarter, not harder. Material Design Multiscreen Notifications. Material Design Android gets an entirely new look and feel that makes it easier to navigate your device.

Smart dialer KitKat prioritizes the contacts you talk to most and you can search for nearby places directly from the dialer. Google Now Actionable notifications Account switching.

Google Now Get the information you need at just the right time with Google Now. Actionable notifications With Jelly Bean, notifications expand to show more information and let you respond in the moment; take action directly from the notification.

Tablet-friendly design System Bar Quick Settings. Quick Settings The new Quick Settings let you access essential information more easily: Battery management Gingerbread helped you get the most life out of your battery by knowing exactly how your device uses it; find out how much battery each aspect of your device consumes, from screen brightness to any active app.