Compile Android Build

@bWWd @oldyz Ok hopefully this will work now. make sure you are running a 64 bit windows I tested on windows 8.1 x64.
  • remove any environment variables you added from following my tutorials.
  • download android sdk - command line tools and extract to folder "C:\android\sdk" so you have the path "C:\android\sdk\cmdline-tools\bin\sdkmanager.bat". If you already have this folder I recommend to delete it first.
  • install JAVA JDK 11 and confirm with "java -version" in command prompt that its working.
  • download 6391 and download my branch.
  • delete the android folder of 6391 and replace with the android folder from my branch
  • replace the file in 6391 "openbor/engine/source/gamelib/packfile.c" and replace with the one from my branch.
  • update the file in 6391 "openbor/engine/sdl/video.c" update the path to video.c with this #include "android/app/jni/openbor/video.c"
  • comment out the 64 bit build in the file "openbor/engine/android/app/build.gradle" like this "abiFilters 'armeabi-v7a'//, 'arm64-v8a'"
  • also comment out in the file "openbor/engine/android/app/jni/Application.mk" like this "APP_ABI := armeabi-v7a #arm64-v8a"
  • now run build.bat and everything should hopefully compile.
 
Last edited:
WORKED !
But, i think you had a typo cause it needs to be #include "android/app/jni/openbor/video.c" and you had android/jni/openbor/video.c" , the path is missing app folder.
It installs everything automatically without any ndk issues which is great , kinda like windows compiling, i had to run build.bat twice tho but worked, all you need to download is commandline and java 11 , the erst is done by build.bat (gradle,sdk,ndk),also i think java 11 adds path by itself so its recognized.
So i leave that info for myself in the future :
Wipe .andoid and .gradle in user directory.
jdk-11.0.14_windows-x64_bin.exe install
sdk-tools-windows-4333796.zip unpack so its C:\Android\sdk\cmdline-tools\bin
system variable :
ANDROID_HOME
C:\android\sdk


These are the only ones i used

Now ill try to build pak file inside apk , do i need some modifications or should i just place bor.pak file in assets ?
 
Last edited:
Thanks for the catch there i have updated the instructions. And i have not actually tested 6391 yet so give it a try and let me know if there are any issues.

You do not need ANDROID_HOME with this new method.
 
Last edited:
No, 6391 wont work, asks for ant and all... i tried to compile with pak file in assets but its still using openbor/paks folder to run the game , do i need some extra steps to have only on pak per apk , like actual game ?
Oh man now that i look at all this, you made it so easy, i really appreciate your willingness to help and givie away time , i have a kid too so i know its hard sometimes even to find 15 minutes of free time and this , i spent like 15 hours since 2 days with no succes on new builds, this will hopefully make it much easier in the future to compile apks.
 
Last edited:
Did you change the app name from org.openbor.engine that will force it to use the pak in assets.
 
IT WORKED !!! Thanks a lot, i just changed name and put bor.pak in android\app\src\main\assets (uppercase name of BOR.pak game me error before so i think thats important to keep it bor.pak)
I will create custom apks for each of my games, i wanted to do that many times but wiped hard drive long time ago and lost the src files for he-man.apk that was using something like this.
 
I have a question that might be offtopic, on android there is a split second moment when you run the engine and pak selector flashes once showing off pak selector menu despite having only one pak file , is there a way to disable it so it does not show at all when i only have one pak file ?
It doesnt happen on windows, only on android. I tried to find pak selector pngs in engine\resources folder and change all of them to black but that did not help, and it still shows that pak selector menu, it looks like its embed in one of the "h" files and not in pngs ?
Who created these header files for sdl and how ?
 
Last edited:
@msmalik681 & @bWWd -

i have managed to build 6391 version using the old files provided by Kratus, here is the record of what i did:


Code:
Oldyz workflow 64 bit components , windows 10 64 bit, Kratus files



Downloaded 32bit Java JDK 15.02
jdk-15.0.2_windows-x64_bin.exe

https://www.techspot.com/downloads/downloadnow/5552/?evp=a38814ad8b97456f590ac37ff0d22898&file=6304


Downloaded the Android SDK, "command line tools only" package for windows

commandlinetools-win-6858069_latest.zip
https://drive.google.com/file/d/1ZcNnNozNaAqWZlb42PDtoBoZWZvmt6eX/view

extracted the compressd contents of 'cmdline-tools' folder to
 C:\android\sdk\cmdline-tools\version
#########     NOTE sdk-setup.bat will ask for this path later  ##################
you will end up with a path structure like this:
C:\android\sdk\cmdline-tools\version\bin\sdkmanager.bat

Downloaded android-ndk-r21e-windows-x86_64.zip
https://dl.google.com/android/repository/android-ndk-r21e-windows-x86_64.zip
 extracted all contents inside the compressed folder android-ndk-r21 folder to:
C:\android\ndk
you will end up with a path structure like this:
C:\android\ndk\ --  11 folders & 9 files


setup the environment variables, used the search bar to search for "advanced system settings"
that window will have a button at the bottom for "Environment Variables" now select "New" under "user variable":

################# DO NOT USE QUOTES  #########


    "ANDROID_HOME" = "C:\android\sdk"
    ANDROID_NDK_HOME =  C:\android\ndk

#####  oldyz note, value equals path  ######

Now setup System Variables -> Path add these lines:

    "C:\Program Files\Java\jdk-15.0.2\bin"

value C:\Program Files\Java\jdk-15.0.2\bin



Downloaded the master branch here
https://github.com/DCurrent/openbor
as zip file

Ran the file "sdk-setup.bat" (found in root of openbor android folder)
it downloaded everything needed...

then run build.bat

success

###########   WEIRD   #############

you can skip sdk-setup.bat, & still compile well w master ?????
HACK?

- created a 'latest' folder inside
 C:\android\sdk\cmdline-tools\version, pasted all the contents of cmdline-tools inside latest, and ran this command to accept
the licences:   sdkmanager --licenses usig a command window.

after that ran build.bat (skipped sdk-setup.bat completely and the build went well for master build)

##################  End of weird  ####################

##############             6391 compile           ##############################
Downloaded the master branch here
https://github.com/DCurrent/openbor
as zip file
Download older build (6391 for this exmaple)
https://github.com/DCurrent/openbor/releases/tag/v6391

after you extract them to C:

go to this master build directoty:

C:\openbor-master\engine
 
copy the android folder

go to the 6391 (or older build) directory:

C:\openbor-6391\engine

delete Android folder

paste the new android folder



###########    Video.c patch ###########
https://youtu.be/i_zZrSQmNV4?t=849

go to this master build directory:
C:\openbor-master\engine\sdl

open video.c

copy this line:
#include "android/app/jni/openbor/video.c"

go the older build directoy:
C:\openbor-6391\engine\sdl
 
edit video.c

replace this line:
#include "android/jni/openbor/video.c"
with
#include "android/app/jni/openbor/video.c"

#####   packfile.c for older build  ########

go to this master build directory:
C:\openbor-master\engine\source\gamelib
copy packfile.c

go this older build directory:
C:\openbor-6391\engine\source\gamelib
 paste packfile.c


then ran build.bat
@bWWd, maybe this older method will get rid of the menu flash you are getting...

so far so good, i will attempt a custom pack next later on in the next few hours....
 
Last edited:
@oldyz when you say master your referring to my branch right ?
i have it here as:
openbor-master.zip
i got it a few days ago here:

it says updated 9 days ago by DC current.

now im wondering if it would be an issue with kratu's old files, since the openbor master i got currently is one i downloaded on the 23d of april 2022
 
AAAAAAannd now i see that you have your own branch here:
openbor/engine/android at Malik · DCurrent/openbor..

since i followed the video tutorial , if im not mistaken it is using the main branch

thats the one that works with the old files it seems...

i will do tests later in the week with your branch to see if there is any differences i suppose.....

i updated the "kratus" workflow with the master i used and links
 
Last edited:
Hey oldyz you want particular older version compiled to be compatible with particular mods ? Im happy with that mix of malik build but ill save your steps in case i want to experiment, and that screen blink, i dont think its related to particular engine revision ,its default behaviour since first android port till now, maybe it blinks pak selector on pc as well but its so fast you cant see it well, i just wanted to swap pak selector image to black image and default android button texture to transparent image, cause i dont need any of these in a game with single pak file, i use my own texture for buttons.
Why bother you ask, cause when i spend time to make my own stuff, graphics ,buttons ,sounds, then i dont want default buttons and menus to be the first thing to show , it just looks wrong.Its kinda like using own graphics for evertyhin and own sounds but leaving default bor fonts and default hitsparks,hitsounds... its just weird and screams UNPOLISHED.
 
i just wanted to swap pak selector image to black image and default android button texture to transparent image, cause i dont need any of these in a game with single pak file, i use my own texture for buttons
when i tested the hacks i made using Kratu's android games and apk tool, i never noticed a blinking selection screen, and the Nightslashers apk that was hacked from the old punchman neither (but that is a very old android build)
then again it may be way too fast to see & if one pays attention that mey be the case....
about the buttons, how are you making your buttons for your android ports? are they graphics layers inside your games themselves or are your somehow replacing the button assets before building?
there area couple of games where i want to help the creators feature custom buttons....
 
I think this knowledge should be compiled in one place , i mean how to customise whole android game
Make custom touch.txt file and texture png .
They need to be in data folder.Just replace whatever button with your icons and thats it, they dont really have to have any letters, you can use images of anything.
This is inside touch.txt, just change coords of a2,a3 etc, cause i gave them -99 cause i dont use them, first two numbers are X and Y coords , then you have scale ( 0.08), last number is according to corner so 0 is first corner ,1 is right corner or something like that, just test it., theres info about it on forums here, just search for touch.txt :

texture data/touch.png
button attack 0.15 0.1 0.08 2
button jump 0.35 0.1 0.08 2
button special -99 -99 0.08 0
button attack2 -99 -99 0.08 0
button attack3 -99 -99 0.08 0
button attack4 -99 -99 0.08 0
button esc -99 -99 0.08 0
button start 0.1 0.1 0.08 1
 

Attachments

  • touch.png
    touch.png
    90.6 KB · Views: 5
@bWWd, i see, there is a way for the APK to install these automatically, i dont know if you are doing this AFTER the install on android.

@msmalik681 i am having a weird issue, make-my-key.bat is not working for some reason, odd part is that back a few weeks i did make a key before attempting a custom build & it went well.
cant remember if other steps where taken before running it, (besides the edit)
 
Back
Top Bottom