Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Android Port Question.

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Android Port Question.
AMCerasoli
Member #11,955
May 2010
avatar

Alohomora! ;D

I haven't been here for a while and I was thinking on developing some apps using Allegro on an Android device.

The thing is that I was reading the readme file and I have found that there is no audio support? I don't care about the rest.

Thomas Fjellstrom
Member #476
June 2000
avatar

There is indeed audio support.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

AMCerasoli
Member #11,955
May 2010
avatar

Oh that's cool! Well I'll try to do something. I'll be using the NDKr8d let's see. Thanks for the port Thomas.

Thomas Fjellstrom
Member #476
June 2000
avatar

Also thank Trent and Peter. Trent has put in a serious amount of work into it, as has Peter.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

AMCerasoli
Member #11,955
May 2010
avatar

Hmm I didn't know that, I thought Trent was more on the iOS port and Peter on general stuffs. Thank you all then!

kazzmir
Member #1,786
December 2001
avatar

Where do you see it says android doesn't support audio?

Trent Gamblin
Member #261
April 2000
avatar

Don't forget to credit Jon kazzmir. He wrote the OpenSL audio driver for Android. :P... I don't think any portion of Allegro is a one man job.

AMCerasoli
Member #11,955
May 2010
avatar

kazzmir said:

Where do you see it says android doesn't support audio?

I read it in the android readme file.

TODO:
* accelerometer support
* screen rotation
* support more than just armv7a
* sound of any kind
* mouse emulation (is this even really needed?)
* joystick emulation (at least till there is a more generic input api)
* properly detecting screen sizes and modes
* filesystem access including SD card, and the app's own package/data folder.
* camera access
* tweak build scripts to handle debug/release versions better
* maybe make some kind of script that makes a customized version of the
  android-project directory from a template, so fewer things need to be edited.
* support static linking allegro if at all possible.
* potential multi display support

Would be possible to compile allegro for android on Windows? The NDK has already the pre-built binaries of arm-linux-androideabi-gcc.exe and arm-linux-androideabi-g++.exe but I don't know how to configure Cmake-GUI.

Trent Gamblin
Member #261
April 2000
avatar

Yes, it's possible to compile on Windows but more difficult. Not much I guess. I did it when the android port was new.

kazzmir
Member #1,786
December 2001
avatar

Ah oops I searched for 'audio' in the readme. I'll update it.

AMCerasoli
Member #11,955
May 2010
avatar

I didn't know there were so many people involved in the Android port.

Well I know is too soon to write about errors but the thing is that I'm getting at first the "Windows port requires DirectInput (not found)." Error but since I'm not compiling for Windows I'm not going to install that dependency.

But after checking WANT_ANDROID I get:

You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_C_COMPILER= C:/android-toolchain/bin/arm-linux-androideabi-gcc
CMAKE_CXX_COMPILER= C:/android-toolchain/bin/arm-linux-androideabi-g++

I have modified the Toolchain-android.cmake manually to add the C:/ in front. But even when I manage to delete the cache manually (by removing the files from the folder) I get:

The C compiler identification is unknown
The CXX compiler identification is unknown
Check for working C compiler: C:/android-toolchain/bin/arm-linux-androideabi-gcc
Check for working C compiler: C:/android-toolchain/bin/arm-linux-androideabi-gcc -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/android-toolchain/bin/arm-linux-androideabi-gcc" is not
  able to compile a simple test program.

Trent Gamblin
Member #261
April 2000
avatar

Unless it has changed... you used to have to use cygwin for Android on Windows.

AMCerasoli
Member #11,955
May 2010
avatar

Yhea that is what the NDK documentation says. But I would rather use Linux :-/. I have never used cygwin but for what I see there is MinGW available to download from its packages manager. I don't know which packages to download and all that. Which compiler would I be using if I decide to use cygwin? ohhh so many questions. hehehe I'm just starting let's see.

Trent Gamblin
Member #261
April 2000
avatar

I would prefer Linux over cygwin too. cygwin uses MinGW but when you're compiling android stuff you'll be using the gcc arm port, just through cygwin. The Allegro documentation outlines in general what you have to do but you'll have to do research on the cygwin specific steps. If you want, write them down and we'll add them to README_android.txt. :)

AMCerasoli
Member #11,955
May 2010
avatar

For what I have been reading so far, there is no need to use Cygwin anymore to compile native applications, it seems that the Android NDK comes with the pre-built tools for doing so.

The thing is, even if I manage to compile a native application using the NDK I still need to compile Allegro first, isn't it? I need the binaries of Allegro and I'm not sure if I can compile Allegro with the NDK, or if will need to use Cygwin for allegro anyway, that is my current interrogation.

Edit

In theory if I compile a normal C code with the NDK, shouldn't be possible to compile the entire Allegro library too?

Thomas Fjellstrom
Member #476
June 2000
avatar

Cygwin is generally needed for the extra tools. The NDK contains the cross compiler but not necessarily all of the other tools you might need to build things.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

AMCerasoli
Member #11,955
May 2010
avatar

My weekend is over and I couldn't do it :'(. I think there is a problem with make.exe or something... I'm getting

Armando@Armando-Laptop ~/build
$ cmake .. -DANDROID_NDK_TOOLCHAIN_ROOT=/home/armando/android-toolchain -DWANT_ANDROID=on -DWANT_EXAMPLES=OFF -DWANT_DEMO=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXECUTABLE_SUFFIX=.exe
-- Selected Android toolchain: /home/armando/android-toolchain
-- The C compiler identification is GNU 4.6.0
-- The CXX compiler identification is GNU 4.6.0
-- Check for working C compiler: /home/armando/android-toolchain/bin/arm-linux-androideabi-gcc.exe
-- Check for working C compiler: /home/armando/android-toolchain/bin/arm-linux-androideabi-gcc.exe -- broken
CMake Error at /usr/share/cmake-2.8.9/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler
  "/home/armando/android-toolchain/bin/arm-linux-androideabi-gcc.exe" is not
  able to compile a simple test program.

  It fails with the following output:

   Change Dir: /home/Armando/build/CMakeFiles/CMakeTmp



  Run Build Command:/usr/bin/make.exe "cmTryCompileExec847836888/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec847836888.dir/build.make
  CMakeFiles/cmTryCompileExec847836888.dir/build

  make[1]: Entering directory `/home/Armando/build/CMakeFiles/CMakeTmp'

  /usr/bin/cmake.exe -E cmake_progress_report
  /home/Armando/build/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object
  CMakeFiles/cmTryCompileExec847836888.dir/testCCompiler.c.o

  /home/armando/android-toolchain/bin/arm-linux-androideabi-gcc.exe
  -DGL_GLEXT_PROTOTYPES -fPIC -DANDROID -mthumb -Wno-psabi -march=armv7-a
  -mfloat-abi=softfp -o
  CMakeFiles/cmTryCompileExec847836888.dir/testCCompiler.c.o -c
  /home/Armando/build/CMakeFiles/CMakeTmp/testCCompiler.c

  arm-linux-androideabi-gcc.exe: error:
  /home/Armando/build/CMakeFiles/CMakeTmp/testCCompiler.c: No such file or
  directory

  arm-linux-androideabi-gcc.exe: fatal error: no input files

  compilation terminated.

  CMakeFiles/cmTryCompileExec847836888.dir/build.make:60: recipe for target
  `CMakeFiles/cmTryCompileExec847836888.dir/testCCompiler.c.o' failed

  make[1]: Leaving directory `/home/Armando/build/CMakeFiles/CMakeTmp'

  make[1]: *** [CMakeFiles/cmTryCompileExec847836888.dir/testCCompiler.c.o]
  Error 1

  Makefile:117: recipe for target `cmTryCompileExec847836888/fast' failed

  make: *** [cmTryCompileExec847836888/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:37 (project)


-- Configuring incomplete, errors occurred!

alehbeer
Member #12,996
July 2011
avatar

If audio support exists, could someone please give a list of libraries and sdk/ndk versions that enable sound please?

Max Savenkov
Member #4,613
May 2004
avatar

I had the same problem a a while ago (https://www.allegro.cc/forums/thread/612102) and was unable to do anything about it. I think Windows compilation via CMake is broken somehow. You can follow my path, and use android-vs or its NVidia version from Android Tegra Developer Pack 2.0 to compile allegro and dependencies, or you can switch to Linux. OR spend some time learning about CMake and maybe fix the process for all of us :)

Thomas Fjellstrom
Member #476
June 2000
avatar

I think android development on windows is pretty stupid. The entire toolchain is developed from linux (and other opensource OSs), for a linux based system.

It's like programming windows only apps on linux. Not the most well supported path.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

AMCerasoli
Member #11,955
May 2010
avatar

The last time I tried to compile and run an Allegro game using Linux on my 6 years old laptop my graphic card wasn't not supported... All I saw was a black screen... That's stupid...

Thomas Fjellstrom
Member #476
June 2000
avatar

We're not talking standard linux, but android. So not applicable.

But, your graphics card should be supported via the opensource drivers. NVidia and AMD like to remove support for semi-old cards at regular intervals.

Also bugs happen. I had no end of issues with the intel drivers for a good year or so.

append: if linux graphics at all started up, you had some kind of support.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

AMCerasoli
Member #11,955
May 2010
avatar

We're not talking standard linux, but android. So not applicable.

It's semi-applicable :P because I would like to test my game on my developing machine and then on my Android device, that way I can work on the different input systems, displays and all that, but ohhhh I can't because Linux doesn't support your blah blah blah....

So that's my main reason for using Windows. Otherwise I would have to install Linux on another machine to see if I have some luck and it support my wireless card, graphics, sound, etc...

beoran
Member #12,636
March 2011

If your hardware is 1 year old or more , normally it will be supported OK on Linux these days. HW support on Linux has markedly improved over the last few years, IMO.

Thomas Fjellstrom
Member #476
June 2000
avatar

Yeah, I'm not entirely sure what your problem was, but at the very least it would pick your card up as vesa/vga. It'd be slow, and have no acceleration, but it'd work.

If you got nothing at all, it was probably a distro or user mistake. some form of misconfiguration, or just a really really rare and shitty card.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

 1   2 


Go to: