OpenBOR for Android [APK]

CRxTRDude

Member
Alright guys, I'm posting my status regarding the Android mod here. Now that the mod is an official part of the source code, you can now compile yourself the Android mod in the official repo.

Installation:

  • Make sure that you uninstall any build that you have in your phone/tablet
  • Copy the apk to your phone (either by cable or by SD card, whichever works for you)
  • Install the apk, place paks on /mnt/sdcard/openbor/paks and you're good to go!

DOWNLOADS:
The newest build is available here. Now with WebM support and various improvements.

This build is the last build to be compiled separately:
OpenBOR 3.0 4100 APK 1.3.3
Mediafire



Old build:
4099 1.3.2
Mediafire

4086 1.3.0
Mediafire

4082 1.1.2
Mediafire  |  Dropbox

4082 1.1
Dropbox  |  Mediafire

The original build
Dropbox
Mirrors:
Sendspace - Thanks O Ilusionista!  |  Mediafire

Requirements: Android 2.3.5 +

Tested on my crappy China-made phone and tablet. Phone is Android 2.3.5 while the tablet is Android 4.0.3 for those who want their numbers.



Release Notes:
1.4.2
- Plombo: Add WebM support and compile with -Werror like the other platforms
- Plombo: Simplify Android video code. There are a lot of things that the SDL render API can do for us that the existing code was trying to do by itself.
- Fixed all dependencies (source and includes) in Android.mk especially WebM support
- Test compile worked as it should and, as shown on logs, WebM was detected and is not played

1.4.1
- Plombo: Clean up Android video code a bit
- Plombo: Add libvpx to Android port WebM is still not supported yet, but at least the configuration side is taken care of now.
- Plombo: Migrate from libvorbis to tremor

1.4.0
- Rewritten video.c to add support to new functions by Plombo.
- Fixed video bugs Android-side brought about by rewrite.

1.3.4
- Updated the SDLActivity.java to support external buttons.

1.3.3
- Updated SDL to SDL2 2.0.1, the last of the SDL2 series to support Android 2.3.3 API out of the box. I also figured out the way to finally disable accelerometer without doing additional code, which I've done already in this release. Tested on the phone and it works perfectly.

1.3.2
- Updated the static library for libpng to 1.6.15. Removed the libz static library because libpng is now set up so it does not need it anymore, (it instead uses the zlib already present in the Android OS)

1.3.1
- Updated the static library for libogg to 1.3.2 and libvorbis to 1.3.4.

1.3
- SUCCESSFULLY added a wake lock which prevents OpenBOR to be destroyed by the OS itself during screen lock. (Note that the CPU still keeps running, so you will need to pause your game before you turn off the screen, otherwise the game keeps on going and kill your character.)
- Fixed the accelerometer by hardcoding it to be disabled in the first place.

1.1.2
- Added FLAG_KEEP_SCREEN_ON to prevent the game from exiting, so you can watch the cutscenes without the worry about the app exiting on you (on the sacrifice of your battery power of course because the screen keeps on running).
- Modified androidmanifest.xml to reflect changes (versioning and cleanup)
- Various directory modifications and minor fixes.

1.1
- Modified the buttons to make them look better.

1.0
- Original port by UTunnels.



As part of the community, I would like you guys to check this out and leave your comments.

Greets go out to:

  • uTunnels for the original Android port, ericavd101 for his take on compiling the APK (and the recipe he used for it),  Plombo for his help compiling libvpx and adding WebM support for the Android port.
  • Stack Overflow users, especially Jongware, that helped regarding the image header edit problem
  • JMWD WUERZBURG for the arcade style buttons
  • CyanogenMod for their Android ports of libogg and libvorbis
  • LearnOpenGLES.com for the tutorial on compiling the libpng for Android
  • The entire community at Chrono Crash for their support and bug spotting.
 
Thanks! Glad to hear it. I added my name BTW in the credits for the app, just for vanity yet, but I'll be remaking the background for the game menu to make it streamlined. The buttons BTW are from JMWD, Simple Icon for the shot button icon and all done in photoshop, then passed over to mbin2h.
 
Now that I'm now proceeding to making the menus, I'm now working more on the resources folder and found a gif file called LogViewer_320x240.gif which is essentially the background for the log viewer when you press the jump buttons. I was wondering why it's not used in the menu code.

That out of the way, on to the menu, here's the preliminary look:



Edit: How do i use an attached image for '
 
Great work - I might even wind up giving OpenBOR a try on Android for the first time. :)

I have a top of the line Galaxy S4 Active that should rip right through it. Not really a fair test. But... I've also got a Galaxy Tab 3 and that thing is pure garbage. Crashes so often you'd think Micheal Bay designed the hardware; I can't even believe the same company made both of them. If it can run your APK smoothly anything can.

DC
 
I just hit a snag unfortunately. Apparently the menus, icons and other resources in the resource folder are in a different structure, it looked like it's hex code but it's different.

Check it out: (very high concepts, if you're a programmer or just want to read it anyway, you can proceed)

The first few statements for the image starting from 0x89 to the last letter 'R'.

Here's what mbin2h would spit out:
Code:
0x89, 'P', 'N', 'G', 0xD, 0xA, 0x1A, 0xA, 0x0, 0x0, 0x0, 0xD, 'I', 'H', 'D', 'R'

Here's the original header from OpenBOR_Menu_480x272_png.h
Code:
"\x89""PNG""\15\12\32\12\0\0\0\15""IHDR"

Apparently it is converted from its hexadecimal to its decimal (numerical) form, except for 1A, which is 26 and in place of it is 32, all numbers add 2 to each every digit.


In other words, this uses another type of image conversion to put into place.


Tried to compile but it keeps on giving errors, saying that there are 'missing braces around initializer' and such.
 
About the menu screen, there is something in Android version which doesn't makes much sense: the buttons are assigned like a keyboard (a,s,d,f) but they should be renamed A, J, S, A2, etc.

I can't even believe the same company made both of them.
Its Samsung curse. They fill their roms with bloatware. From all custom android roms, their are the worst.
 
O Ilusionista said:
About the menu screen, there is something in Android version which doesn't makes much sense: the buttons are assigned like a keyboard (a,s,d,f) but they should be renamed A, J, S, A2, etc.

That I solved in the menu by hardcoding the text from it. I added ifdefs set to ANDROID, which is probably the variable used to distinguish the android devices, copy/pasted code from the original code, then edited the text manually. If you play the BGM player in the APK, it will appropriately switch text as well similar to the other builds.

O Ilusionista said:
I can't even believe the same company made both of them.
Its Samsung curse. They fill their roms with bloatware. From all custom android roms, their are the worst.

That's where CyanogenMod comes in along with the XnaDevelopers website. The problem now is Samsung is a member of the Open Handset Alliance*. They should conform to defaults that Google, et. al. implemented. *GULP*

*Dude sez: For those who don't know the Open Handset Alliance is a consortium/group of companies who develop and maintain Android. Samsung is one member, as well as Google, LG, HTC and whole others who develop Android-related software or hardware. Phew, that's a long disclaimer.
 
I'm going to put my brain cells to rest for a while, I'm going to solve the menu thing tomorrow (time here's 3:25 AM).

DC, is the menu image already there when you stepped in as developer for OpenBOR? I'm just curious probably you have some info about this, I think.
 
I've been a dev since ~2006, so obviously I predate Android itself, never mind our port to it. Thing is, ports tend to be independent projects from the main team and this one was no exception. IOW, I haven't so much as cracked open a folder for the Android port.

uTunnels was the last person to work on Android. Send him a PM. He seems to be long gone, but once he took a two year break and came back so you never know.

DC

 
I'm back and my braincells are fully charged again (I slept a 3/4ths of a bagel and got coffee, so I'm good)

Now I'm going to answer stuff:

Firstly for people who don't have access to Dropbox:

Mediafire: OpenBOR-debug-4082.apk - 1.08 MB

I almost forgot that I got a mediafire account. Will also update there as a mirror. Main downloading will be on Dropbox, and if possible at Chrono Crash.

Secondly:
Damon Caskey said:
I've been a dev since ~2006, so obviously I predate Android itself, never mind our port to it. Thing is, ports tend to be independent projects from the main team and this one was no exception. IOW, I haven't so much as cracked open a folder for the Android port.

uTunnels was the last person to work on Android. Send him a PM. He seems to be long gone, but once he took a two year break and came back so you never know.

DC

I PM'd uTunnels, but since he worked for the Android part, which was solved, I guess he can answer some stuff if he comes back as well. But what I meant was the general resource folder (/engine/resources) where everything stems, the OpenBOR icons, folders and the version lists for all platforms are there, sorry if I wasn't clear about that part.
 
I've actually posted the problem on StackExchange Converting PNG to C header for SDL and one of them commented regarding the values, they are the same, except the original code is actually is a mix of Octal, not in Decimal, and hex values. That's why their value is different. With that knowledge in mind, I'm going to find a way to convert the hex values into octal ones.

EDIT: It's not just octals that are in there but also hex as well, so it's convoluted.
 
I finally solved it! I used the same technique as what I did for the android buttons, plus editing the initMenu function:

Code:
// Read Logo or Menu from Array.
	if(!type)
		bgscreen = pngToScreen(isWide ? (void*) openbor_logo_480x272_png.data : (void*) openbor_logo_320x240_png.data);
	else
		//CRxTRDude - Removed '.data' since it doesn't use it anyway.
		bgscreen = pngToScreen(isWide ? (void*) openbor_menu_480x272_png : (void*) openbor_menu_320x240_png);

Compiled it and it worked! Since I didn't use the data pointer anyway, I just removed .data and used the char as is. Now the new menu is up and running! I've uploaded the new APKs in Dropbox and Mediafire and it's on the first post! Check it out!
 
so you did all this to just replace buttons? you can do that easily cause utunnels gave us png buttons image , you can place it in data folder of your game and should work i think, or saves folder, anyway just look up android thread by utunnels and you have answers there.
 
Well, you can say I did all that for just one thing, but then, it became more than just the buttons, it also became changing the UI as well. Not that I have anything against Fightin Words' menu screen or uTunnel's buttons, I just want to update it to make it nice and sleek, plus added the new default buttons, it seems good IMHO. Plus it gives a sense of acomplishment anyway that you edited the default images in code level, even if it's fussy and all that.

EDIT: Saw what you meant via search. You can edit the leyout through touch.txt, also saw that in the code as well. The button layout, I'm going to try.
 
you are doing some cool things for the android port!
can you create one modified apk that allow us to have more than one openbor installed on android devices?
so we can have different build releases for different .paks
can openbor run from external sd card instead of the default one? i never tested it
 
I think I can't do that one, to be honest, I only just edited the menu and the buttons and nothing else. There is a way though to do that, like Mame4Droid, which has separate APKs for older but widely used version of Mame and the newer version too, but I doubt what version you mean by old since there are many revisions to version 3.0 and they have many features implemented as well as bugs (emphasizing bugs there).

It's better to just update the paks instead of playing them as is, since it's more feasible in the long run, than having different apks to different builds of compatibility.
To prevent this to be misunderstood: Update your pak modules instead of making different apks for different builds that WILL NOT encourage using new techniques and new features.
~Sorry if I'm not that clear DC~

About the external sd card thing, that's a good idea though, we can use 'external_sd/', which is what i have in my android tablet along with most others to read the contents of SD card. That might be a little task, but still daunting. I'm going to research on that next.
 
CRxTRDude said:
It's better to just update the paks instead of playing them as is, since it's more feasible in the long run, than having different apks to different builds of compatibility.

This. It's bad enough to version hop with one hand and want support with the other. Why ask us to keep backward compatibility if you're just going to thumb your nose at the current release anyway and not help us debug? Still, that's your right. But to expect a build that does it for you? No. Just no. If I caught someone trying to add such a feature, I'd have to exercise lead dev privileges and block it from the source.

DC
 
Back
Top Bottom