AOSP prebuilt aar not added to frameworks - jar

I have a simple aar file I would like to include as a prebuilt library to deploy with the AOSP build. The goal is to deploy the aar file in system/framework so that 3rd party developers can utilise it.
Running mm on the same folder as my Android.mk file does exactly what I am expecting, including the creations of intermediates in obj/JAVA_LIBRARIES and the addition of the file in the PRODUCT/system/framework folder.
However, when I run /m to build the image, the above files are not created and as a result the files are missing from the image.
Placing an on purpose error in my Android.mk and testing a full build does through an error, so my Android.mk is correctly being used in the main build.
I have also added the aar module name in the PRODUCT_BOOT_JARS to ensure the class path is updated to allow development and running of APKs developed with these. Just mentioning, although I do not think it plays a role here (past AOSP builds with jar files worked fine without it for deploying at least)
My Android.mk
# include $(CLEAR_VARS)
# LOCAL_MODULE := mylib
# LOCAL_SRC_FILES := mylib.aar
# LOCAL_MODULE_CLASS := JAVA_LIBRARIES
# LOCAL_MODULE_SUFFIX := .aar

I think you need to add your module to PRODUCT_PACKAGES variable in makefile, ex:
PRODUCT_PACKAGES += \
... \
mylib
The make file you can modify to add your module maybe build/make/target/product/base.mk or build/target/product/core.mk or some other files depend on your custom build system.

Related

Set sbt options in build.sbt

I'm working on an SBT project that has to be built with the options like:
-Xmx2G -Xss256M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
This means that every new developer has to read the readme and assign the options to SBT_OPTS in bash profile or put them in the sbtopts file. Similarly, this has to be configured on Jenkins and this applies to all the projects (so if someone wants to use -XX:+UseG1GC with other projects it becomes an issue). Is it possible to specify the required options in the build file itself? This seems logical to me, as the options are project-specific and without them, you cannot build the project.
Create a .sbtopts file at the root of the build with contents:
-J-Xmx2G
-J-Xss256M
-J-XX:+UseConcMarkSweepGC
-J-XX:+CMSClassUnloadingEnabled

How to use extensions

Could someone please explain how one uses the premake extensions. I added the eclipse extension in a directory under my premake installation. And in the premake script I added recuire "eclipse".
Running the script with premake5 eclipse, I get an error module "eclipse.lua" not found.
I added the path of the modules directory to my environment variables.
I'm using premake (premake5) on Windows 8.
Thanks
addons need to reside in a folder. You need to create a "eclipse" folder, then copy all the files in it, and the "eclipse" folder should be located where premake can load it (either next the executable or some other place handled through environment variables)
I got this working by adding the full path to the require statement.
require "C:/premake/eclipse/eclipse"
and running the command as premake5 eclipse
Note: This plugin does not generate project files that one can import into Eclipse.

How to deploy audio/video files together with iOS/Android app? Using Qt 5.3

I have learned that I can not bundle audio/video files within resource file in order to play them in my qml.
So, I have tried to use DEPLOYMENTFOLDERS in .pro file it does not copy the files.
It seems that QtCreator does not generate necessary code contents using DEPLOYMENTFOLDERS in .pri file.
Is there an easy way to say copy these files into build output location?
Visual studio C# has this option just saying one true/false to do this.
It should not be this hard. :-)
"Is there an easy way to say copy these files into build output location?" - this is a different task. You may achieve that with QMAKE_POST_LINK and writing a Makefile rule to copy the required files to the the output directory.
To copy the required file into the iOS bundle use QMAKE_BUNDLE_DATA. See https://qt-project.org/doc/qt-5-snapshot/platform-notes-ios.html
To copy the required file into the Andoid APK you need to write INSTALLS rules like that:
android {
...
assets.path = /assets
assets.files += LIST_OF_FILES
INSTALLS += assets
}

How to create a qt application for all unix versions?

I have been able create an application that depends on webkit and scripts in Qt5.2.1.But i was able to create a deb package for 14.04 version Ubuntu .But how can i make it as stand alone application .I have seen static and dynamic build .I tried static build but I don't kon w how to include webkit for static build.Also is it possible with shared library approach for creating a standalone application.Please help me out here..
Deploying a dynamically linked Qt application :
You should place Qt so files along the release version of your executable. These are libQtCore.so, libQtGui.so and possibly the ones for other modules that you have used. These so files are in your installed Qt directory in lib folder or in the directory /usr/lib/i386-linux-gnu. If you are using plugins you should place their so files in a folder named plugins beside your binary. In case of using icons and images you should ship their so files like libqico.so and libqsvg.so in a folder named imageformats.
Gathering required shared libraries :
If you want your application to run independently on a bare installed Linux, you should gather all dependent shared libraries and put them in your application directory. You can simply do it by a shell script named cpld. You can easily copy all dependencies to a folder.
It's worthy to note that you can put this in your .pro file to cause the dynamic linker to look in the same directory as your Qt application at runtime in Linux :
unix:{
# suppress the default RPATH if you wish
QMAKE_LFLAGS_RPATH=
# add your own with quoting gyrations to make sure $ORIGIN gets to the command line unexpanded
QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
}

Qt 5.2 Including External File into an Android Package?

How to include an external file into 'apk' ?
Example:
There is "123.txt" in the main directory where .pro file exists. What should I add to pro file to put "123.txt" into apk.
I tried DEPLOYMENT, DEPLOYMENTFOLDERS. But they only works with Symbian and Windows CE.
There are two ways to do it, both mentioned under "Porting an Existing Qt Application" on Qt 5.1 Documentation For Android.
Bundle them into a qrc file (works cross platform)
Add them to the "assets:" directory (Android specific)
For #2:
The "assets" directory will be created when you build the project. I have found it easiest to use the "INSTALLS" qmake variable to copy the files into the directory before it is packaged into an apk. The following is from a qmake file for a project I made. Note that for INSTALLS, the path to assets reads "/assets", not "assets" as you would expect. (It actually ends up in a subdirectory of the Android build workspace.)
To access the directory from the code in android, you use "assets:". (In the example, /assets/Samples ==> assets:/Samples.)
# - setup the correct location to install to and load from
android {
# android platform
# From: http://community.kde.org/Necessitas/Assets
SAMPLES_INSTALL_PATH=/assets/Samples
} else {
# other platforms
SAMPLES_INSTALL_PATH=$$OUT_PWD/Samples
}
# - setup the 'make install' step
samples.path = $$SAMPLES_INSTALL_PATH
samples.files += $$SAMPLE_FILES
samples.depends += FORCE
INSTALLS += samples
You can use the Qt Resource system. By default, all Qt applications can access the contents of a qrc file using the ":/" prefix or the URL scheme prefix, "qrc:".
The other approach is to deploy the resources into the package's assets directory. It is the best option if you want to achieve better interoperability with the Android APIs. You can access all resources in the directory using the "assets:" prefix. Unlike qrc, this approach is not a cross-platform solution.
When you build your project, a folder named "assets" is created in the Build-Directory/android-build/. After copying your files in the assets directory, you can add these to your pro:
deployment.files += MyFile1
deployment.files += MyFile2
...
deployment.path = /assets
INSTALLS += deployment
The files in assets are readonly. So you should first copy it to some other location if you want to change them:
QFile dfile("assets:/MyFile1");
if (dfile.exists())
{
dfile.copy("./MyFile1");
QFile::setPermissions("./MyFile1",QFile::WriteOwner | QFile::ReadOwner);
}
Specific to User2400925
In QT 5.1 I had used to copy the database from Assets folder to the home folder of the user, if the file does not exist. Which can be used by the App.
You may go through this link
One more simple way to do that:
1) Add this string into your .pro
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources
2) Create android-sources folder in your proj folder. Put anything you need into android-sources/assets/. You can also put there any other files, such as AndroidManifest.xml or android-sources/res/drawable/icon.png that you want to be copied and updated into the target bundle.
One more simple way to do that:
Add this string into your .pro
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources
Create android-sources folder in your proj folder. Put anything you need into android-sources/assets/. You can also put there any other files, such as AndroidManifest.xml or android-sources/res/drawable/icon.png that you want to be copied and updated into the target bundle.

Resources