Android get app version name

How to get the versionCode and versionName of your app

EnvyAndroid

Read more posts by this author.

EnvyAndroid

In you AndroidManifest.xml file, you can specify the values of android:versionCode and android:versionName .

versionCode

The versionCode is integer value used to easily differentiate between app versions.

App developers must increment this value when they release updates to their apps in Android Market, so it can determine if users are using an old version of the app, and offer them to update it.

versionName

The versionName is a string containing a regular “release version” as seen in other desktop applications, such as “1.4.5” or “3.7”.

The versionName is just a “human readable” version code.

Accessing it

Here is how you can access these values in your application code:

This way, you can check which version of your app is being used, if you need to do something spesific with that information. Or you can make a small method that checks for new updates to the app.

You can also access other useful resources this way, for example: packageName and requestedPermissions.

More on android app versioning here, and AndroidManifest i explained in depth here.

Источник

Android get app version name

This is unofficial service-wrapper of Google Play Developer API for retrieving Android app version that currently located on Google Play Store in simple JSON (REST) response.

Just call GET request /?id= and get last app version (Beta versions not captured)

Request to Google Play Developer API takes about 3 second. That’s why this service cached app version for 4 hour. So you will receive information from the delay up to 4 hours.

Table of contents

You have put your app on the Google Play Store. It has been installed by lots of customers. The users should check the auto-update check box in the Play Store app for each app they want to auto-update. However some users have unchecked it or not checked it in the first place.

So you may want to use some service to pragmatically check if there is an updated version of my app on the Play Store. If there is an updated version then the user could be directed to the Play Store.

Google Play does not provide any official APIs for retrieving metadata in simple way.

So I found several solution on stackoverflow. There are 2 types of them:

First services just wrapper for web page or hosted on google app engine which usually outage when daily free quota used up.

Читайте также:  Сменить шрифт для android

With Second solution you have to update hardcoded version number every release. For example we release a new version every week and forgot to update hardcoded version number saved on our backend.

Third. www.playstoreapi.com is not available anymore.

Fourth solution is pretty good. You have to get this value from your Google Play Store page.

But you have to update the app when something in html is changed. And this method have another side effect. Google don’t show app version number when you use several platforms (x86 and armeabi-v7a). For example https://play.google.com/store/apps/details?id=com.wipon.wipon page have not version number on it.

That’s why I’d like to use Google Play Developer API and fake deploy mechanism to get apk’s list. This method is the most stable in my opinion. It realised in this repo

pip install -r requirements.txt

Python 2.6 or 2.7 are fully supported. This requirement flew from google-api-python-client

Python 3.3+ is also now supported! However, this service has not yet been used as thoroughly with Python 3, so I’d recommend testing before deploying with Python 3 in production.

Configuration is simply copying the OAuth2 key to project folder.

  1. Go to the APIs Console and log in with your Google Play Developer Console account.
  2. Go to Settings → API access
  3. Turn the Google Play Android Developer API on if it’s not
  4. Create or link Google Developer Project with Google Play Developer Console account
  5. Go to Service Accounts and Grant Access to this account
  6. Click Add user on window above
  7. Generate OAuth service account in Google Developer Console
  8. Create JSON (NOT p12) keyfile and Save as key.json in the project directory
  9. That’s it

For development or local (5005 port)

For staging or testing (5005 port)

Optionally you can use supervisor/staging_android_version_checker.conf supervisor program config.

For production (Debian or Ubuntu + NGINX + Gunicorn)

For example I use /var/www/android-version-checker as project folder.

1. Install virtualenv

2. From project folder

3. Set up virtualenv

4. Update pip and install gunicorn

5. Install dependencies

7. If everything is good — test gunicorn

8. Create a systemd Unit File (don’t forget modify path). Group must be www-data otherwise nginx can not access to sock file.

9. Deactivate environment and start gunicorn process

9.5 [Ubuntu only] Open up port 5005 or another port

10. Configure nginx

Service API reference

By default API runs on 5005 port.

Returns app version by package id

  • id — Required field. Android Package identifier
  • mask — Optional field. Mask for version format. The following characters are recognized in the format parameter string: «H — Major, L- Minor, P-Patch, I-ignore». By default «HILPIII»

Example of version number: 2.5.3

Credentials file corrupted or empty (501 BAD REQUEST)

Look at configuration. Maybe you haven’t credential file.

Google don’t now about your package or you don’t upload any version yet (422 BAD REQUEST)

Читайте также:  Sakura swimming club андроид

Look at Google Play Developer Console. You may have an error on it.

Your package has unusual version number convention (400 BAD REQUEST)

This service support apk version like 2005304 or 100004

The package id argument undefined (400 BAD REQUEST)

Check your Google Play Developer Console. Do you upload apk file?

The package id argument undefined (400 BAD REQUEST)

id — Required field.

Common error (400 BAD REQUEST)

Something else happened. Maybe your server don’t have stable internet connection.

All contributions are more than welcome.

Distributed under the MIT license

About

Robust Android Play Market App version checker. Using Google Play Developer Console API written in Python.

Источник

Get started with the Navigation component

This topic shows you how to set up and work with the Navigation component. For a high level overview of the Navigation component, see the Navigation overview.

Set up your environment

To include Navigation support in your project, add the following dependencies to your app’s build.gradle file:

Groovy

Kotlin

For information on adding other Architecture Components to your project, see Adding components to your project.

Create a navigation graph

Navigation occurs between your app’s destinations—that is, anywhere in your app to which users can navigate. These destinations are connected via actions.

A navigation graph is a resource file that contains all of your destinations and actions. The graph represents all of your app’s navigation paths.

Figure 1 shows a visual representation of a navigation graph for a sample app containing six destinations connected by five actions. Each destination is represented by a preview thumbnail, and connecting actions are represented by arrows that show how users can navigate from one destination to another.

Figure 1. A navigation graph that shows previews of six different destinations that are connected via five actions.

  1. Destinations are the different content areas in your app.
  2. Actions are logical connections between your destinations that represent paths that users can take.

To add a navigation graph to your project, do the following:

  1. In the Project window, right-click on the res directory and select New > Android Resource File. The New Resource File dialog appears.
  2. Type a name in the File name field, such as «nav_graph».
  3. Select Navigation from the Resource type drop-down list, and then click OK.

When you add your first navigation graph, Android Studio creates a navigation resource directory within the res directory. This directory contains your navigation graph resource file ( nav_graph.xml , for example).

After adding a graph, Android Studio opens the graph in the Navigation Editor. In the Navigation Editor, you can visually edit navigation graphs or directly edit the underlying XML.

Figure 2. The Navigation Editor

  1. Destinations panel: Lists your navigation host and all destinations currently in the Graph Editor.
  2. Graph Editor: Contains a visual representation of your navigation graph. You can switch between Design view and the underlying XML representation in the Text view.
  3. Attributes: Shows attributes for the currently-selected item in the navigation graph.
Читайте также:  Groove machine mobile андроид

Click the Text tab to see the corresponding XML, which should look similar to the following snippet:

Источник

List of Android version names

Android versions up to Android 10! 10 got, additionally to their nummeric version number, a code-name, which was assigned by Google. Like the naming of Ubuntu versions (names of animals with an adjective [1] ), Android version names were names of, mostly american, sweets, where the first letter was in alphabetical order.

The assignment of numeric and textual version names are not always consistent. Android 4.0 and Android 4.1, for example, have different version names, but Android 5.0, 5.1 and 5.1.1 share the same version name.

Starting with Android 10! 10, Android versions do not get a codename anymore. Since then, the Android versions will be released with their version number only. [2] [3] [4] [5]

Содержание

Cupcake

The Android version 1500! 1.5 Cupcake is the first version, which got a name assigned, which is Cupcake. Cupcakes are muffin-like cakes, which mostly has a creamy hood.

Donut

Version 1600! 1.6 Donut was given the name Donut.

Eclair

Android-Version 2000! 2 Eclair and 2100! 2.1 Eclair share the same name, Eclair. Eclairs are longly biscuits overdrawn with chocolate.

Froyo

Frozen Yogurt is a ice-like dessert made with milk and yogurt and is also the name of the Android version 2200! 2.2 Froyo.

Gingerbread

The name of Android version 2300! 2.3 «Gingerbread» is Gingerbread, which are cake-like biscuits mostly eaten around christmas time.

Honeycomb

The android version mostly made for tablets, Android 3000! 3.0 Honeycomb, is called Honeycomb. The bootanimation of this android version is also made like a honeycomb.

Ice Cream Sandwich

Android 4.0 is called after a sweet, which is made of delicious ice cream bewtween two biscuits: an Ice Cream Sandwhich.

Jelly Bean

Jelly beans are colorful, mostly made out of sugar, sweets, which have a hard shell and are filled with jelly. The following android versions share this name:

KitKat

KitKat is a brand from Nestle, and is a chocolate bar filled with waffles. Android 4.4 is named after this sweet: 4.4! 4.4 «KitKat».

Lollipop

Lollipops are sweets in different flavors on a stalk and is also the name of the following android versions:

Marshmallow

The android version 6.0, announced at 17th of august in 2015 is called after the sweet Marshmallow.

Nougat

Android 7, also called Android N, officialy got the name Nougat.

Android 8, also called Android O, carries the name Oreo, which are two crispy chocolate cookies with a vanilla cream center.

Android 9, also called Android Pie, carries the name Pie, which is the name of different sweet dishes.

The version 9! 9 was the last Android version which got a codename assigned.

Android 10

Google announced that a new Android Version will be officially known as Android 10.

Источник

Оцените статью