I'm building AOSP from source. What I would like to do is to include a few prebuilt files in the generated system.img as part of the make process. I'm trying to find the actual file that creates the system.img and add a few lines there. Any idea?
Thank you in advance.
A good way of adding custom files to the system.img is to add them under vendor/your_name/product_you_want_to_add_them/proprietary/your_files_go_here and add a custom make file called device-product_name.mk.
After that's done, just define which files are to be copied from the proprietary folder and inside (e.g. vendor/samsung/crespo/device-vendor.mk add to call your device make file).
Just put your source code to the Packages/apps directory,then make sure your project has a correct make file like other project in the apps directory.You will make the package prebuilt after finish the android build.
To add a prebuilt file to a build, find a .mk file which makes sense for your project and add the file under PRODUCT_COPY_FILE. It looks like this
PRODUCT_COPY_FILE += your/build/tree/$FILE:path/to/location/on/device/$FILE
Using a separate vendor tree is following good domain-driven principles...but is perhaps overkill for a single binary. Examine the makefiles you already use, there is often prebuilt apks already being added that you can piggyback on. device and existing vendor trees are good places to start looking. Maintaining an entirely new project is not something to be taken lightly, in my opinion.
If you want to add programs in the system.img, go to the vendor, then go to the operator, then go the app and enter the files inside the app
If you use the roms modification program, the program name is rom helper, it modifies prmission to 0755, and it modifies UserID 2000, thus adding the apk to rom
Related
I am compiling a ROM from source (say CM12.1)
I have obtained the source code and am ready to build.
However I wish to add an app (say ES file explorer) as a user app and another app(say Titanium) as a system app. Also I need to copy a file to one of the system folders.
How is this done?
I dont have the source code of those apps and hence cant compile from
source.
You will have to add the source code of the app the the packages/apps folder. Remove any precompiled files that exist.
Add the android.mk file. You can copy from it from the already available apps in the packages/apps folder and customize it for your app.
Add the app name to core.mk file in build/target/product
Build the ROM and it should have your file.
is it possible to replace .so file in android app without source code?
I am creating app which use some .so files under LGPL license v2.1 http://www.gnu.org/licenses/lgpl-2.1.html
License says: "...you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it..."
Is it possible to replace .so file and recompile app without source code e.g. in existing apk? I can't give user source codes. Or some option to give user .class files so he can create apk?
Is it even possible and if so, what are options?
Thank you!
Yes, you can replace a .so file in an apk. Just use 7zip to open the apk replace the file and you are done.
About gpl: you should have 2 libraries, one so for your code and one for the code you borrowed, this way the user can replace the so for the library, but your code cannot be changed. You can also put a check for the libs version and just exit if it was changed.
I am trying to build a branded Android app, that will have different resource files (mainly drawables) for different customers. The Java code in the apps will be the same, but the different apps will have a different look--meaning different color schemes and different logos etc. I have been told, and my research suggests that Ant is the best way to achieve this.
Where should I change the Android 'build.xml' file? What sort of Ant task should I use to achieve this?
For debugging, I would like to just use Eclipse and build with the default resources. But for production releases, I would like to run Ant on build.xml to produce multiple APKs from different /res folders. I do not even need any code snippets (although that would be nice), just even some tips from people that have done this before or something similar.
I ended up writing a Python script to reorganize the Android project before each build. I recommend avoiding the use of Ant for stuff like this. My 100-200 lines of Python achieved the equivalent of about 1000+ extra lines of Ant that was required in addition to the default Android build.xml Ant script.
I have encountered a similar issue where I want to compile the same code base with some changes as well as changes in the resource files. The solution I am pursuing at the moment is creating a library with the shared code/resources and separate "regular" projects for each of the different APK releases. Unfortunately, I don't have a functional final solution to the problem yet, so all I can give is these vague hints.
Requirement Setup
1. Go to the URL :
http://ant.apache.org/bindownload.cgi
and download the apache ant and extract it in to the any folder like d:/ant .
2. I think you already having the Android SDK path is like(D:/Android SDK/)
Now go to the Enviroment variables and check whether path variable is there is there add these in path otherwise create a new varible with name path and put it there in vaue
D:/ant/bin;D:/Android SDK/tools
done
Go to command prompt and navigate it to the root directory of your project and run the command
android update project -p /
Note: / if you are in the root directory of project else you need to give the path of root directory like d:/myworkspace/mysampleproject
this will generate and build.xml file in your project.
now run the command for this it is necessary to be in root directory of your project
ant debug
this will generate an apk file in bin folder signed with default debug key.
I've never made a program into an executable before, and I've been looking into how to do this for some time now. When I try to put it into a jar everything works fine but when I try to run it nothing happens.
How do I make my game into an executable so it can be run (on windows, not android)
I feel like I am not Linking it to the libraries or something... Not sure.
Thanks!
Edit:
I should add I get the error
JAR export finished with warnings. See details for additional information.
duplicate entry: com/badlogic/gdx/utils/arial-15.fnt
duplicate entry: com/badlogic/gdx/utils/arial-15.fnt
duplicate entry: com/badlogic/gdx/utils/arial-15.png
duplicate entry: com/badlogic/gdx/utils/arial-15.png
Jar export finished with problems.
See details for additional information.
Your problem is that when you use eclipse export as Executable jar file it does not include the assets (graphical, sounds ...) that you used in your gdx project. What you can do manually is either copy your assets folder right next to the generated jar file or include your assets folder in your jar file with your favorite zip management tool.
Another way would be to use this same eclipse export wizard and check "Save as ANT script" and then edit the generated ant file to include all the files and folders needed by your app.
Hope this helps
This is an old question, but if you are using a new version of LibGDX and Gradle you can use the command line to make an executable.
There are several commands, but these are for packaging:
Desktop
gradlew desktop:dist
Android (unsigned)
gradlew android:assembleRelease
iOS
gradlew ios:createIPA
Web
gradlew html:dist
Read more at https://github.com/libgdx/libgdx/wiki/Gradle-on-the-Commandline
I'm assuming your application is setup as the libgdx wiki page suggests (with a "main project" and separate "desktop" and "android" projects that share the sources from the "main" project).
Since your app is written in Java, it requires a JVM to run on a desktop. You have to decide if you want to package that up, or rely on a JVM already being installed by the user. I believe packaging up the JVM with Java class files is very complicated and raises a host of other issues (and it becomes very platform specific). So, I believe most libgdx-based games get distributed as an executable Jar file, which means the user must already have Java. (It works for Minecraft, so its probably good enough for you, too. :)
Eclipse makes that really easy: File -> Export ... -> Java -> Executable Jar File. There may be additional steps required to include assets like your app's images and sounds into this .jar file. (My game is currently "asset free", so I don't have any experience with this part.)
You might also consider side-stepping the desktop executable, and packaging your game as an applet and running it in a web browser so there is very little "installation" required by the folks you want to show it to. Here's a walkthrough for making an applet from a libgdx-based game. (I haven't actually tried this myself yet, but I do have a libgdx-based game that I'm planning on doing this for.)
If you're using Android Studio, you can create a custom configuration to distribute from within the program.
On the Run dropdown list select edit configurations.
Click the "+". Select Gradle.
On the right half of that screen give your configuration a Name.
Gradle Project: Use the browse button to select your desktop application. This will look something like (project name):desktop
Tasks: type "desktop:dist"
Apply.
Close the configuration editor and select your new configuration from the dropdown. Hit run and it should build your project.
Your new Jar file should be located in (ProjectName)/desktop/build/libs
The Native Code of the Android application is going alone with application as lib file in the APK file. Suppose if I want to share a native code between two different applications, Is there any trick avail apart from the below:
Adding the lib with every application
Copy the lib in to system/lib folder and dynamically link it with application. (If we build just only the applications then we cannot use this).
You can't copy anything onto /system unless you are root, so I'd suggest you just include your native library in every application that needs it.
You must create library project ant than create your activity and lib.so file. You may be added all project this library.(Such as vitamio)