-1

Since Crosswalk is over 40mb. I have decide split my apk to reduce apk size...

I have know how to publish differenk apk on Google Play Store...I have readed documantations...

Documentation says:

Supporting multiple CPU architectures When using the Android NDK, you can create a single APK that supports multiple CPU architectures by declaring each of the desired architectures with the APP_ABI variable in the Application.mk file.

For example, here's an Application.mk file that declares support for three different CPU architectures:

APP_ABI := armeabi armeabi-v7a mips APP_PLATFORM := android-9

NDK Application Documantation says

The Application.mk file is really a tiny GNU Makefile fragment that defines several variables for compilation. It usually resides under $PROJECT/jni/, where $PROJECT points to your application's project directory. Another alternative is to place it under a sub-directory of the top-level $NDK/apps/ directory. For example: $NDK/apps//Application.mk Here, is a short name used to describe your app to the NDK build system. It doesn't actually go into your generated shared libraries or your final packages

I have no experience for NDK...watched some videos...

In this question latest answer told

For arm you'd put this line in Application.mk :

APP_ABI := armeabi armeabi-v7a

And for intel x86 :

APP_ABI := x86

And you have to change AndroidManifest.xml to have a different version for each platform (following the instructions in the link you provided).

Be carefull, if you run cordova build android again, it will probably replace all the content of platforms/android, and your changes will be lost.

To build the project use

platforms\android\cordova\build.bat -release

So if I do integrate my app with NDK and puting APP_ABI variable will split apk cpu architecture?

is there a easy way for this? do I have to do additional steps?

Community
  • 1
  • 1
Ucdemir
  • 2,852
  • 2
  • 26
  • 44
  • 1
    if you are using Crosswalk only as library (.so files + .jar file) then all you need to do is use apk splits in gradle build script http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits – V-master May 31 '16 at 06:14

1 Answers1

0

Crosswalk library for single architecture will increase the APK size by 20M. If you find it's over 40M, the library maybe for both of x86 and ARM.

If you are using official packaging tools of Crosswalk, you can choose targeting architecture. If you are using Crosswalk as library reference, you can download the library for different architecture separately from official website.

lincsoon
  • 401
  • 3
  • 3
  • 1
    My question is, how to split apk for CPU Arhitecture for arm and x86... For example: There will be Croswalk Arm Library for Arm Cpu arhitecture.same as x86 – Ucdemir Jun 06 '16 at 08:37