Develop Android AOSP apps with gradle - android

I am building a custom app in Android AOSP and added it under packages/apps/Car/MyApp
Currently, the only way that I know how to integrate it into the build process is to create a Makefile Android.mk. Since adding dependencies/3rd party libraries with that approach is very tedious I would prefer being able to do it via gradle.
Is there any known solution how to use gradle as the build system for the app and trigger it with the Android.mk so it is still included in the overall build?

You can build it with gradle, and write Android.mk for your built apk. For adding prebuilt apk as system/privilege app, you can visit the stackoverflow question How to include prebuilt APK into AOSP with platform privileges

Related

DexGuard the submodule of a project

We have the following setup:
We build and ship an Library for our clients. The SDK is obfuscated with DexGuard
That Library is also used in our application. Our application should use the same AAR file that is shipped also to the clients that is obfuscated.
Till version 2.3.* of Android plugin it was building the AAR file and reusing then that library for the app. From version 3.0 it does not seems to be the case. I have the feeling that it is using directly the files.
Is there a way to force the same process - to build the AAR and then to use it from the app?
Thanks and Kind Regards

How to build a library from AOSP?

I need to build libjpeg-turbo library which is from android AOSP.
The repository contains this Android.bp file, and i have no idea how to build it. Before this, all of the libraries i've built had Android.mk file inside JNI folder and for the building i was using ndk-build command.
How can i succesfully build this library?
Some while ago, NDK and AOSP configuration scripts (Android.mk) looked very similar. Historically, NDK used the AOSP build system (based on GNU make). Since these early days, evolution of the two build systems went in different directions, and culminated in recent switch of AOSP to blueprint build system.
But even before this, you could use ndk-build with AOSP Android.mk files only occasionally. Many libraries, especially libraries with dependencies, could not be built this way.
Luckily, libjpeg-turbo is one of the subprojects of AOSP that don't have problematic dependencies. If you step back in git history for this library, you will be able to build it with ndk-build. You can even cherry-pick the relevant changes to your NDK-compatible branch.
Alternatively, you can use the official libjpeg-turbo repository instead of AOSP tree.

Building with Address Sanitizer on Android but with CMake

I am trying to build a .so for android and I want to build with address sanitizer but the only instructions I see are for Android NDK based Makefiles, but I am using the newer endorsed CMake setup. Just adding the flag -fsanitize=address wasn't enough as the clang runtime library was missing.
what is the correct thing to add in my CMakeLists for Android built libraries?
You also need to prepare your device as described in documentation. You have to run asan_device_setup script from NDK. It will put asan .so on the device.

Is Android SDK version relevant when compiling libraries using NDK?

First step: I use QtCreator to compile a bunch of libraries (.so files) + a GUI test program to test those libraries on an Android device.
Second step: After I tested them, I re-compile the libraries without the GUI test program and send them to a client who's going to integrate those .so file in its own Andoid application (generating and apk), not using QtCreator anymore. I do this step using QtCreator (because it's setup, very easy for me to just remove the GUI test program and hit compile), but I'm pretty sure they could also be compiled directly using ndk-build if I work on writting the correct make files for that.
When I re-compile the libraries, there's still a "Android build SDK" option under "Build Android APK" set to "android-22" in QtCreator. However, my client generates its final app for "android-19". And we are wondering if this could be a problem.
My understanding is that my .so files generated in "second step" are built using the NDK only (SDK is not used, so android API version "android-22" is irrelevant as I do not generate any APK...). So there should be no compatibility issue when those .so files are integrated in an application, as far as the same NDK version is used.
Am I right?

android automating build using Hudson + third party libraries

I am working alongside with two other developers in an android application. In the application we use other third-party libraries like SlidingMenu.
In eclipse we should include the SlidingMenu project and point our application to use this project as library.
Now I want to automate the building of the application using Hudson(Jenkins) but I have no Idea how I will deal with the dependence libraries like SlidingMenu.
Any Ideas
So long as you can build your app on the command line (e.g. using the Ant or Gradle build systems for Android), then you can build your app in Jenkins.
For the Ant build system, all you need to do is place your dependency JARs in the "libs" directory.
Or if you're using library projects, the Eclipse plugin should have already added the required entries to your project.properties file.

Categories

Resources