Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#19 Android Build

closed
Jaka Kranjc
None
5
2013-01-05
2013-01-02
Trasd
No

Hi,

I noticed 0.7.2 of GemRB has been released (for awhile) for all but Android; may I ask why? Is Android development going to continue?

I am getting so desperate, I even tried to compile the apk myself - no luck.

I love playing BG on my tablet and purchased BG1 and BG2 just for this purpose, but there are a few annoying bugs that greatly limit my enjoyability.

Do you have a beta or personal build you could send me (with the accompanying scripts and overrides)?

Any help would be greatly appreciated. As far as compiling, I have used Borland for more years than I care to recount and have no access to MSVC, which it looks like the package is compiled with.

Thank you, and please don't give up on this project. If the reviews by people who cannot figure out how to make it work are discouraging you, I'd be happy to write a how-to manual - if that's what it takes to get you back on the project.

Discussion

  • Jaka Kranjc
    Jaka Kranjc
    2013-01-02

    Thanks for the effort, we really are lacking people to make new builds - both previous builders are currently lacking time and the platform itself has problems of its own (SDL2). There are newer builds here on sourceforge, but those are old by now too.

    You don't need msvc to compile it though, the current android builds probably use gcc or less likely clang (both cmake and autotools as build systems should work). It would be interesting to see if we are compatible with borland's compiler, so if you want to give it a try, please pop on IRC later and we can discuss and debug your problems.

     
  • Trasd
    Trasd
    2013-01-02

    Thanks for the quick response.

    Over the years I have tried to port C/C++ code written for other compilers over to Borland (new company name now, but I can never remember it) with varying levels of success. Unfortunately, I have not had the time to learn anything about programming on the Android OS and I think this would not be the best project for me to cut my teeth on. Plus, we have just moved, lock, stock and barrel, not to mention a new infant in the house (grandchild) - needless to say, I am short on time myself!

    Throw into the mix the fact (I'm almost positive) the Android version was compiled using peyla's SDL version, not the standard SDL, this would make it very difficult for me to successfully compile.

    But, this does not mean I will not try! Once things settle down, and if no one with more knowledge has built a newer Android version, I will commit a couple weeks to determine if it is within my abilities. I do so enjoy a good programming challenge, but as I've only programmed for DOS and Windows, this project may far exceeded my reach for the foreseeable future.

    If I make any progress I will let the project know, but it may be awhile and I may have many questions!

     
  • Jaka Kranjc
    Jaka Kranjc
    2013-01-02

    First, I don't expect much trouble using borland's compiler, since we already support such ancients as msvc6. But this is completely optional and I mentioned it only since you said you have a preference for it.

    As for the last builds, it is true, they were made with pelya's sdl1.2 or sdl1.3 build, but there was already plenty of experimenting with vanilla sdl2, which supports android natively and is needed for much of the touch-oriented goodness. This is the way to go.

    This is really a build challenge, not so much a programming one.

     
  • Trasd
    Trasd
    2013-01-02

    Sorry, I did understand the Borland build was optional... I do have a couple other ANSI compilers anyway, or access to them. But if and when I know the project better, I will see if it compiles under Borland, just to see.

    Personally, I like peyla's SDL because of the custom button abilities; does the stock SDL have any keyboard button placement customizations? I'm pretty sure 2.0 doesn't, but my memory isn't always that good.

    So, if it is a build project, as opposed to a programming project, are there many things that need to be changed to have it compile an apk?

     
  • Jaka Kranjc
    Jaka Kranjc
    2013-01-02

    No idea about the difference in SDL.

    The whole reason we don't have updated apk's is that we don't know the procedure to generate them. They should build just fine though, since some other platforms use SDL2 as well.

     
  • Trasd
    Trasd
    2013-01-03

    Oh no, that's not good - you guys not knowing the procedure to generate APKs because, that was my next question! Currently, I haven't the slightest idea, either.

    I know it has to do with Android's NDK (I'm pretty sure, anyway), but like I said, I have yet to study the OS in earnest.

    Alright, this does give me a starting point; a specific goal to concentrate on. Give me some time and I'll see what I can come up with.

    I discovered beholder's contact email is no longer valid, so I guess there is no way for me to get a hold of his/her work - that would have been a little easier....

     
  • Jaka Kranjc
    Jaka Kranjc
    2013-01-03

    You can contact Alex (gmail: alx3apps), who did the sourceforge builds - he should be able to give instructions. Beholder visits us on irc, but very rarely.

     
  • Trasd
    Trasd
    2013-01-03

    OK, thanks.

    I will see what I can get together, but I am still concerned about my current time restraints. I would really like to get the Android version up to speed, so I may try to move it up in my priority list. I'm pretty sure, given enough time, I can figure it out, especially if someone like Alex, who has built it for Android before, helps out - even if it's just a little.

    Oh boy, another time-consuming project! LOL. I will jump over to IRC sometime today and poke around there.

     
  • Trasd
    Trasd
    2013-01-03

    BTW, my original entry is worded the way it is because it is a copy of the mail I tried to send to beholder and I wasn't sure I would get active feedback here, or I would have written it better.

     
  • Trasd
    Trasd
    2013-01-05

    • assigned_to: nobody --> lynxlupodian
     
  • Trasd
    Trasd
    2013-01-05

    I have been in contact with Alex and he graciously provided me with the basics on building an APK.

    It is a bit convoluted and, as I thought, it will take awhile for me to figure it all out. He does not recommend starting with trying to build GemRB on a Windows system, but unless I use C4Droid for the main build, to include its custom SDL (at least to begin with), I have no choice but to use Windows. I have a machine I set aside for Linux, but in the three years since I downloaded and created a Linux CD to install, I haven't had the time to get it up and running.

    Thanks for all the help and I will get back to you when I can. As I stated, though, it may be awhile. When you start seeing me on GemRB's IRC alot, you know I have gotten around to devoting time to the project. I will pick at it in the meantime.

     
  • Trasd
    Trasd
    2013-01-05

    • status: open --> closed
     
  • Jaka Kranjc
    Jaka Kranjc
    2013-01-18

    Can you post the instructions here? There has been renewed interest from others to help as well.

     
  • Trasd
    Trasd
    2013-01-18

    Sure, that shouldn't be a problem, but as it's Alex's work (the instructions), I want to check with him first.

    I do have one problem though, there are a couple of files included with the instructions and I have no idea where I can put them for public access. Will the "Attached File" option work?

    To be honest, I've turned my computer on only once since I got the instructions so, I am relieved that others are interested. Hopefully someone with a better understanding can make an updated apk.

     
  • Jaka Kranjc
    Jaka Kranjc
    2013-01-18

    Try it, otherwise use something like http://filebin.ca .

     
  • Trasd
    Trasd
    2013-01-21

    Hey,

    I have decided to reproduce Alex's directions verbatim rather than try to translate them and possibly mess something up. Please be aware there are two different sets of instructions that accomplish the same task: the one he sent me; another older set he sent someone else awhile back (posted somewhere on the from gibberlings3 forums.

    Directions to build a GemRB Android APK Alex sent me:

    I'm writing instructions without much description, feel free to ask any questions. I'm using linux, mac os x should work as well. Windows is supported for building, but I never tried it and won't recommend it for the first builds.

    Prerequisites:
    - git http://git-scm.com/

    - JDK http://www.oracle.com/technetwork/java/javase/downloads/index.html

    - Ant http://ant.apache.org/

    - Android SDK (only SDK itself, eclipse and its plugins are not needed) http://developer.android.com/sdk/index.html

    - old modified version of android NDK http://www.crystax.net/en/android/ndk/4

    (latest official version should be used for latest builds http://developer.android.com/tools/sdk/ndk/index.html
    but I haven't tried it)

    1) build simple android application using the same environment, as used with gemrb
    - clone this project https://github.com/pelya/commandergenius
    , it will be used as build-factory for other android projects
    - checkout it to ac1f2e9 revision
    - change project/jni/application/src symlink to ballfield application
    - run: ./ChangeApplicationSettings.sh -a (answer "no" if needed)
    - run: android update project -p project -t android-17
    - add NDK directory to $PATH
    - run: ./build.sh - ballfield project should be built into ./bin/MainActivity-debug.apk
    - install it on android device and check it works (shows flying balls)

    2) build old version of gemrb
    - change project/jni/application/src symlink to gemrb application
    - cd into it and clone git://gemrb.git.sourceforge.net/gitroot/gemrb/gemrb
    into gemrb (it will be application/gemrb/gemrb/gemrb/GemRB.cpp)
    - checkout b15159f revision (of gemrb submodule, not commandergenius)
    - apply patch from attachment (it's also exist here https://gist.github.com/2016179
    but I had problems with its format)
    - update .zip files in application/gemrb/AndroidData with override and GUISripts folders contents from b15159f of gemrb
    - run: ./ChangeApplicationSettings.sh -a (answer "no" if needed)
    - run: android update project -p project -t android-17
    - run: ./build.sh if everything is all right, it should fail with "undefined reference to `PyCallable_Check'" - it doesn't matter
    - run ./build.sh second time - it should succeed
    - install MainActivity-debug.apk (it should be like one I 've just built and attached to this mail) and check revision number in main menu

    3) build up to date version of gemrb (not tested, only my thoughts)
    - use latest official NDK (r8d)
    - use HEAD revision of commandergenius
    - use HEAD revision of gemrb (patch must be changed)

    Directions to build a GemRB Android APK Alex originally posted on the gibberlings3 forums:

    I've also checked my personal messenger on gibberlings3 forums (whole site was down when I wrote last time) and retrieved old instruction about android build I wrote to someone on forums. Copying here, it may be out of date:

    1) android SDK
    - download android sdk from here http://developer.android.com/sdk/index.html

    - run 'android' and install packages:
    a. Android SDK Tools, revision 12
    b. Android SDK Platform-tools, revision 6
    c. SDK Platform Android 3.2, AP 13, revision 1

    2) android NDK
    Download NDK r4-crystax from here - http://www.crystax.net/en/android/ndk/4

    (building also should work with any crystax ndk r4+ and with any official ndk r5+, but I had problems with that versions)

    3) download apache ant from here http://ant.apache.org/bindownload.cgi
    and setup it

    4) pelya's project
    - clone this project https://github.com/pelya/commandergenius
    . There are many projects inside, gemrb is one of them.
    - projects lies in project/jni/application/ folder. There are also a symlink src, that points to project that will be used in builing. Make new folder like gemrb-git and set up src symlink to it.
    - you also should add your NDK location to build.sh file

    5) gemrb
    - version should be adjusted in gemrb/includes/globals.h line 37
    - in file gemrb/GemRB.cpp on line 46 (it seems line number changes in latest versions) change audio.h to Audio.h (it seem's, beholder is using windows)
    - copy files from gemrb project git (additional symlink may not work during the build) to project/jni/application/gemrb-git according to current gemrb layout in pelya's project (not all files needed, and GUIScripts and override must be packaged to ZIP archives). Copy additional files from pelya's gemrb

    6) build (all commands from pelya's project root)
    - run ./ChangeApplicationSettings.sh -a
    - run android update project -p project -t android-13
    - if you want a completely clean build, run rm -rf project/object/local
    - run ./build.sh
    - if compilation fails with "cannot find Py_Something...", rerun build.sh (I think there is a problem with libraries build order)
    - if everything is ok, APK file will be in project/bin/DemoActivity-debug.apk
    - I'm not using adb and android emulator, but think, that it may take hours to load gemrb saved game in emulator - it's extremely slow

    I hope someone can build a newer version (hopefully using pelya's SDL), if not I will work on it when I can.

     
  • Trasd
    Trasd
    2013-01-21

    lynxlupodian, I tried to email you the two files Alex attached to the instructions - I also sent you an email via sourceforge with my email address.

    Let me know if there are any problems. With Admin rights, I'm hoping you can attach the files - if not, set the status back to Open and I will see if I can upload them.