nwrkbiz / android-xserver

Maintaining the original project to make it work again with new Android versions.
MIT License
179 stars 21 forks source link

Update project structure #3

Closed IriaSomobu closed 4 years ago

IriaSomobu commented 4 years ago

This PR changes structure of project to follow modern Android development practices:

So with this PR applied you can just open this project with Android Studio and everything will work out-of-the-box.

nwrkbiz commented 4 years ago

I am fine with this, as I do not have any android studio/gardle experience.

I may readd a makefile based build that works with the new structure besides the up to date gardle setup, because this allows building the project with vanilla debian packages.

IriaSomobu commented 4 years ago

Sure you can, but:

Of course gradle has some flaws: if you dont have system-wide gradle and using ./gradlew from project folder, it'll load at first launch about 150mb of own build tools, but I think this is reasonable price for such convenience.

nwrkbiz commented 4 years ago

Ok, then I'll try to educate myself and start using gradle. Is there a way to add a assets folder using this build system (Without the need to install Android Studio)? I use this project to launch some of my C++ FLTK programs and for this I usually copy the binaries to the assets folder. (Maybe you know a better trick?)

IriaSomobu commented 4 years ago

Another approach to run binaries on Android is to compie them into shared library and communicate with them via JNI. But I'm not sure that it is better trick because JNI is complicated on C side.

As for assets/ folder within .apk file, you can simply create assets/ folder near the res/. All files from here will be copied into corresponding folder in .apk.

Click here to see screenshot ![image](https://user-images.githubusercontent.com/17745136/89439370-c4f67e00-d752-11ea-85bf-e654b34e411d.png)
nwrkbiz commented 4 years ago

Ok thanks, I already messed around with the jni stuff, but for my current project i really just want to execute a normal elf executable. (I basically wrap this XServer around my binary and start it using the java processbuilder).