huangcd
huangcd

Reputation: 2449

Is that safe to keep only armeabi-v7a for an android apk

I have an android APK that use a native library (snappydb). The native libraries takes a lot of spaces, so I want to keep only the snappydb for armeabi-v7a architectures?

I know it's not 100% safe to remove snappydb for other architectures, so my question is: how unsafe it is? (how many devices/users will I lost?)

Just for reference, the minimal sdk version that my app support is 16 (JELLY_BEAN).

Upvotes: 7

Views: 4825

Answers (2)

Alex Cohn
Alex Cohn

Reputation: 57173

You will probably not gain too much from arm-v7a optimization, and currently there is no compelling reason to include 64-bit build. But MIPS and X86 owners will thank you if you keep their devices covered.

Upvotes: 0

Nabil Hachicha
Nabil Hachicha

Reputation: 216

I suggest using Gradle's productFlavors to produce different APKs per ABI, as some ABI may include some assembly code optimization (SSE4, SSE5, Arm Neon etc,)

android {
    ...

    flavorDimensions "abi", "version"

    productFlavors {
        freeapp {
            flavorDimension "version"
            ...
        }

        x86 {
            flavorDimension "abi"
            ...
        }
    }
 }

Or if you're using the experimental Gradle plugin 'com.android.tools.build:gradle-experimental:0.1.0'

android.productFlavors {
        create ("arm7") {
            ndk.abiFilters += "armeabi-v7a"
        }
        create ("arm8") {
            ndk.abiFilters += "arm64-v8a"
        }
        create ("x86-32") {
            ndk.abiFilters += "x86"
        }
        // for detailed abiFilter descriptions, refer to "Supported ABIs" @
        // https://developer.android.com/ndk/guides/abis.html#sa
        // build one including all productFlavors
        create("fat")
    }

Upvotes: 2

Related Questions