I have successfully installed Android Gingerbread 2.3.4 on Beagleboard XM, which is having Cortex A-8. How do I select Cortex -A-8 as target in Eclipse for cross compiling?
Thanks and regards,
Heshsham
You specify which ABIs to support in an ndk project by putting a line in your Application.mk file. If that portion of your source tree is in Eclipse's view of the project you should be able to edit the file from eclipse, otherwise you can use your favorite editor.
http://developer.android.com/sdk/ndk/index.html gives an example of how to include mips support:
APP_ABI := armeabi armeabi-v7a mips
For Cortex A-8 you'd basically just need to figure out the appropriate ABI name.
Related
From the last couple of days, I stuck in implementing MuPDF in android. It supports only
1 . armeabi-v7a
2 . armeabi
3 . mips
4 . x86
Not working in arm64-v8a type OS Architecture device.
PDF required opening within the APP
Can anyone help me out to find any alternate solution for it?
if needed any more information please let me know.
you can compile the binary yourself
follow the guide on the official site:
http://mupdf.com/docs/how-to-build-mupdf-for-android
then make the following changes to
..<mupdf_src>/platform/android/view/jni/Application.mk file
set the follwing variables:
APP_PLATFORM=android-21
APP_ABI := arm64-v8a
make sure you have the latest android ndk from here:
https://developer.android.com/ndk/downloads/index.html
under your ./ndk directory/toolchains
look for the number after all packages
for example mine was
aarch64-linux-android-4.9
then in Application.mk on the last line add the following:
NDK_TOOLCHAIN_VERSION=4.9
then do the ndk-build
now you should have the so file for arm64-v8a under libs directory.
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?
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.
We have an Android NDK project that has three different build configurations:
DEBUG - armeabi
DEBUG - armeabi-v7a
RELEASE - aremabi + armeabi-v7a
We specify separate aremabi and armeabi-v7 debug configurations due to a known bug in the Android loader, where if more than one EABI is specified, the debugger may launch the wrong EABI version of the App and no native breakpoints will ever hit (More details here, at the end of the document).
On the past, we edited the Application.mk file and specified the desired EABI by means of the APP_ABI variable.
We would like to avoid this manual editing and take advantage of Eclipse's Build Configurations and choose the proper EABI setting automatically.
So far, we have a working solution by adding conditionals to the Application.mk file
Here is how our Application.mk looks:
ifeq ($(BUILD_CONFIG),RELEASE)
APP_OPTIM := release
APP_ABI := armeabi armeabi-v7a
else ifeq ($(BUILD_CONFIG),ARMEABIV7A_DEBUG)
APP_OPTIM := debug
APP_ABI := armeabi-v7a
else ifeq ($(BUILD_CONFIG),ARMEABI_DEBUG)
APP_OPTIM := debug
APP_ABI := armeabi
endif
Additionally, we customised the compiler build command line in Eclipse so that the proper BUILD_CONFIG variable is passed to the make script.
This works very well for compilation purposes, but the problem begins when we try to debug the application. The thing is that we don't know how to pass the BUILD_CONFIG variable to the ndk-gdb script.
Running the ndk-build DUMP_APP_ABI command will always return ARMEABI (expected since we are not explicitly defining the BUILD_CONFIG parameter), and as far as I understand, this is the value that ndk-gdb is reading in order to decide which version of the application will be launched by the debugger.
Has anyone managed to get this working or have an alternative solution where we can get compilation and debugging working properly with Eclipse's Build Configurations? Running a command that patches or renames the Application.mk file is a possibility, but we don't know how to do that either.
Android 4.0 has bug. If you provide armeabi and armeabi-v7a code then armeabi code is loaded even if you have ARMv7 compatible CPU. Android 4.0 ignores armeabi-v7a when armeabi is available.
That is why you can create 2 versions of your lib targeted to armeabi (ARMv5)
But there is no ARMv5 CPUs (HTC Hero)
So most CPUs are ARMv6 or ARMv7
You should detect your CPU in Java and load proper native lib.
Doing these will give you control what .so loaded exactly.
You would be able to create lib with NEON support.
When using JNI in Android does the C code need to be compiled to adhere to all different types of ARM architectures? For instance if I compile ffmpeg for armeabi can I use it on all Android devices or do I need to compile it to different targets such as armeabi-v7a?
Having
APP_ABI := armeabi armeabi-v7a x86
inside your Application.mk will create 3 .so files which are bundled with your apk file. This should cover all relevant android devices out there. No extra work needed from us developers.
As to your question: if you compile for armeabi your app will work for both armeabi and armeabi-v7a. Thats because the latter is an extension of armeabi.
You can find a detailed explanation inside ndk.dir/docs/CPU-ARCH-ABIS.html.
I'm trying to build static FAT library for Android NDK which should contain armv6 and armv7 versions.
Tried libtool - doesn't help, cause on MacOS it is not compatible with Android ABI.
Tried ranlib that I found in my NDK folder also with no success.
As an option could someone explain how should I use Android.mk to specify an appropriate library for an architecture.
On Android you don't (at least currently) create fat binaries. Instead, your APK will contain 1:n binaries for the architectures you wish to support.
Your Application.mk (preferred) or Android.mk should define a APP_ABI variable for the architecture(s)
For example, to support ARM (generic) and ARMv7a:
APP_ABI := armeabi armeabi-v7a
See $(NDK)/docs/APPLICATION-MK.txt for more information.