Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build apk in c# application?

Tags:

android

ant

So im making a C# application which I want to be like a small configuration GUI where the user can input his own parameters and select some features, and according to those a xml file will be made and put in a prebuilt ready-to-build android project (in the asset folder). Now i'm struggling with the part where the C# application should compile the project and make a final apk. I tried to use ant but fail hard at understanding how to use it. Any help would be appreciated, but please be detailed im new to this kind of stuff.

like image 944
adnan_e Avatar asked Sep 19 '25 18:09

adnan_e


1 Answers

This is a rather old question, but I'm going to answer it with my final solution.

I created a builder in C# by including the free apktool (and required files) in my project, which could decompile and compile an apk.

So what I did was after making my app, decompile it with apk tool, and then include the decompiled project with my c# project. The user generated a config file using the C# application, and it was deployed in the /assets/ folder of my app since my app expected it to be there.

Then I builded it again with apktool and signed using a debug keystore. (debug keystore is default if the user has no idea what that is, another keystore can be selected)

Keep in mind that, for this to work, the end user has to have java SE installed, I listed these 2 as "required" in my application (PC restart after installation recommended):

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html

Hope this helps anyone finding this, rather old, post!

like image 76
adnan_e Avatar answered Sep 21 '25 06:09

adnan_e