I would like to eventually port my game to Android, but I feel it is tricky to just get the examples running.
I was wondering if anyone has either:
A tutorial from start to finish on getting an example working with all the addons (Image, TTF, PhysFS, OGG, MindControl, etc)
Or possibly, build scripts for addons, template project files, etc.
Trent made something similar for iOS which was very, very useful for me.
I would be willing to send someone $10 via PayPal for some decent build scripts / template project.
Thanks!
Using Linux thesedays it is comparatively straight forward, tbh.
I can't speak about Windows, as I don't use it for Android Development.
I have no objection to using Linux (I use Mac which is *nix-like) But I still am not sure how to build the deps (aside from trivial ones like libpng) and how to get a basic example going.
I got the NDK, setup my toolchain, but build scripts would really help, if you have any advice I'd really appreciate it.
I'm kinda on the edge of my seat for the answer to this thread.
I'll kick in $10, too . PayPal or Bitcoin.
Having been there myself (see https://www.allegro.cc/forums/thread/615363)
The template thats come with Allegro via git are fine to use.
As of the last time I built for android on the 1st June 2015, I could build the following dependencies- (assuming you copied/git'd allegro to $HOME/allegro)
Note
export TC=$HOME/android-toolchain ($TC points to your android-toolchain)
The cross.cmake file that is used is as follows, Note you will have to change the home/yodhe... to match your directories on your system.
freetype-2.5.5
./configure --host=arm-linux-androideabi --disable-shared --enable-static --prefix=$HOME/allegro/build/deps --without png --without-zlib --without-harfbuzz
physfs-2.0.3 (turn off CD Options in cmake file to build)
cmake .. -DCMAKE_TOOLCHAIN_FILE=cross.cmake
-DCMAKE_INSTALL_PREFIX=$HOME/allegro/build/deps
DUMB-0.9.3
make CC=$TC/bin/arm-linux-androideabi-gcc AR=$TC/bin/arm-linux-androideabi-ar
PREFIX=$HOME/allegro/build/deps CFLAGS="-fPIC -mthumb -Wno-psabi -march=armv7a -mfloat-abi=softfp -I./include"
libogg-1.3.2 (DOESN'T WORK WITH API 19+ tested with Allegro 5.1.10, and previous)
./configure --host=arm-linux-androideabi --disable-shared --enable-static --prefix=$HOME/allegro/build/deps
libvorbis-1.3.5 (As above due to ogg dependency)
./configure --host=arm-linux-androideabi --without-ogg --disable-shared --enable-staic --prefix=$HOME/allegro/build/deps
libtheora-1.1.1 (See ogg issue)
./configure --host=arm-linux-androideabi --without-ogg --without-vorbis --disable-shared --enable-static --prefix=$HOME/allegro/build/deps --disable-examples --disable-float
Now I can't get the following two dependencies to build
Openal-soft-1.16.0 (RUNTIME ERROR lookupUINT function not found in adb log)
cmake.. -DCMAKE_TOOLCHAIN_FILE=cross.cmake
-DCMAKE_INSTALL_PREFIX=$HOME/allegro.build/deps
sudo make LDFLAGS=avoid-version
sudo make LDFLAGS=avoid-version install
Flac-1.3.1 (RUNTIME ERROR)
./configure --prefix=$HOME/allegro/build/deps --host=arm-linux-androideabi --disable-largefile --disable-thorough-tests --disable-doxygen-docs --disable-xmmsplugin --disable-ogg --disable-oggtest --enable-static --disable-shared --disable-cpplibs
If anyone can get Openal or Flac to work I would appreciate how they do it. I would also really appreciate if the "powers that develop" could fix OGG with Android 5+.
(And if people REALLY want to help me/give me cookies, I have an allegro (android) game coming out next month for £2.49 I would really appreciate people buying it a giving an honest review.)
Thank you very much, I will be sure to buy your game and review it! It might be in a month though as Ive only just recently ordered Android Tablets.
I had a quick question: that libogg issue, if you compile against < api 19, will the app still have sound on an api19+ device or is the problem only when you initially compile against api19+?
Ogg won't work with any Android version 5+ that I've tested (5, 5.02, and 5.1.1) and produces a runtime crash. It does work with 4.4.2 and less, but I haven't tested on any device running less than actually 4.0.
So if I compile vorbis with --without-ogg ill be alright,the sound will work or 4+?
Well you have to compile the dependencies "--without-ogg" anyway?
Sound works (.wav/.mp3), it just that when Allegro comes to playback an .ogg file it crashes at runtime (on aOS 5+, which i suspect is to due with the Dalvik change, but I am not sure). Loading the .ogg seems fine afaik.
My notes however are three months old, I merely have an * against the vorbis, and theora dependencies indicating they are seemingly dependent/error prone like libogg, but I don't know for sure. Perhaps you will have more luck than me, or find a suitable workaround, as my knowledge is probably less than stellar.
I did get the examples to work and documented this in detail on this Wiki page: