---
title: "How to get the build/version number of your Android application?"  
description: "How to get the build/version number of your Android application?"  
author: "Anonymous User"  
published: 2015-08-10  
updated: 2015-08-10  
canonical: https://www.mindstick.com/forum/33405/how-to-get-the-build-version-number-of-your-android-application  
category: "android"  
tags: ["android", "android emulator"]  
reading_time: 1 minute  

---

# How to get the build/version number of your Android application?

I need to [figure](https://yourviews.mindstick.com/view/87536/what-are-ghosts-jobs-and-how-to-figure-out-them) out how to get or make a build number for my [Android](https://www.mindstick.com/articles/13046/10-reasons-why-i-prefer-android-vs-iphone-ios) application. I need the build number to display in the UI.\
Do I have to do something with [AndroidManifest.xml](https://www.mindstick.com/interview/12768/what-is-the-androidmanifest-xml)?

## Replies

### Reply by Anonymous User

Use:

```
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);version = pInfo.versionName;
```

\
OR

```
String versionName = context.getPackageManager()    .getPackageInfo(context.getPackageName(), 0).versionName;
```

\
If you're using the Gradle plugin/Android Studio, as of version 0.7.0, version code and version name are available statically in BuildConfig:

```
int versionCode = BuildConfig.VERSION_CODE;String versionName = BuildConfig.VERSION_NAME;
```


---

Original Source: https://www.mindstick.com/forum/33405/how-to-get-the-build-version-number-of-your-android-application

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
