How do I publish a specific APK for Android versions greater than $API?

Asked

Viewed 574 times

2

I have an application in the Play Store that uses the Crosswalk plugin. However, for Android versions from 5.0 upwards, I want to be able to provide a build without the plugin Crosswalk. Only versions below 5.0 with build which includes the particular plugin.

  • How did you add Crosswalk to the project? Mine, even though it already is, when you wheel asks to download the crosswalk... Thanks.

  • @Ramos has a Crosswalk Cordova plugin

1 answer

3

One way to do this is to check the version of Build within its application using android.os.Build.VERSION, which is a static class that contains various information about the Android operating system.

Example

// Verifica está em uso a versão Android 5.0 +
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    // não usar o plugin Crosswalk.
} else {
    // usar o plugin Crosswalk.
}

android.os.Build.VERSION_CODES:

SDK_INT value        Build.VERSION_CODES        Human Version Name       
    1                  BASE                      Android 1.0 (no codename)
    2                  BASE_1_1                  Android 1.1 Petit Four
    3                  CUPCAKE                   Android 1.5 Cupcake
    4                  DONUT                     Android 1.6 Donut
    5                  ECLAIR                    Android 2.0 Eclair
    6                  ECLAIR_0_1                Android 2.0.1 Eclair                  
    7                  ECLAIR_MR1                Android 2.1 Eclair
    8                  FROYO                     Android 2.2 Froyo
    9                  GINGERBREAD               Android 2.3 Gingerbread
   10                  GINGERBREAD_MR1           Android 2.3.3 Gingerbread
   11                  HONEYCOMB                 Android 3.0 Honeycomb
   12                  HONEYCOMB_MR1             Android 3.1 Honeycomb
   13                  HONEYCOMB_MR2             Android 3.2 Honeycomb
   14                  ICE_CREAM_SANDWICH        Android 4.0 Ice Cream Sandwich
   15                  ICE_CREAM_SANDWICH_MR1    Android 4.0.3 Ice Cream Sandwich
   16                  JELLY_BEAN                Android 4.1 Jellybean
   17                  JELLY_BEAN_MR1            Android 4.2 Jellybean
   18                  JELLY_BEAN_MR2            Android 4.3 Jellybean
   19                  KITKAT                    Android 4.4 KitKat
   20                  KITKAT_WATCH              Android 4.4 KitKat Watch
   21                  LOLLIPOP                  Android 5.0 Lollipop
   22                  LOLLIPOP_MR1              Android 5.1 Lollipop
   23                  M                         Android 6.0 Marshmallow
   24                  N                         Android 7.0 Nougat
  10000                CUR_DEVELOPMENT           Current Development Build

Details

  • 1

    forgot to mention that I am using the Cordova project. It is nothing more than a template for an android app project for Webview

  • How did you add Crosswalk to the project? Mine, even though it already is, when the wheel asks to download the crosswalk... Thanks.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.