![]() |
|
Initial Android port committed to subversion |
J-Gamer
Member #12,491
January 2011
![]() |
I always perform a clean before rebuilding... I guess I'll have to rebuild allegro when I change those files? " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
Thomas Fjellstrom
Member #476
June 2000
![]() |
J-Gamer said: I guess I'll have to rebuild allegro when I change those files? A 'make && make install' should do the trick. Then of course, copy the libs back into your jni folder. I really do suggest trying to get that run.sh script to work with your setup. It really is quite handy. It handles all the stages of getting the android example compiled, installed, and running on the device with one command. -- |
Trent Gamblin
Member #261
April 2000
![]() |
I got the exact same error. When I built Allegro, it was not a debug build so I had liballegro.so etc. I edited AllegroActivity.java and removed the -debug on those two lines and it worked. But make sure you're copying the shared libraries into jni/armeabi*.
|
Thomas Fjellstrom
Member #476
June 2000
![]() |
Trent Gamblin said: I got the exact same error. When I built Allegro, it was not a debug build so I had liballegro.so etc. I edited AllegroActivity.java and removed the -debug on those two lines and it worked. But make sure you're copying the shared libraries into jni/armeabi*. I was pretty sure he did all that, hence my confusion. -- |
Trent Gamblin
Member #261
April 2000
![]() |
Just double checking. It's easy to forget something when all the steps are new to you. I had to rebuild everything from scratch a few times to get it to work on my device.
|
Thomas Fjellstrom
Member #476
June 2000
![]() |
You don't want to know how many times I've had to build it -- |
J-Gamer
Member #12,491
January 2011
![]() |
Now it won't even install... Although I have "Accept unknown sources" on. ***** " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Have you been able to try the run.sh script at all? Or something similar that would work in windows, if you use windows? It will need modifications regardless of which OS you use. -- |
J-Gamer
Member #12,491
January 2011
![]() |
I managed to get the run.sh to work(changed a few names in there, and it runs), but as soon as adb tries to install the allegro-example-debug.apk(which exists), I get that error. EDIT: 1#!/bin/bash
2
3#rsync --progress -r -t ~/allegro-5.1/android-project/ ~/android-project/
4
5cp ~/android-toolchain/user/armeabi-v7a/lib/liballegro-debug.so jni/armeabi-v7a/
6cp ~/android-toolchain/user/armeabi-v7a/lib/liballegro_primitives-debug.so jni/armeabi-v7a/
7
8export ANDROID_NDK_TOOLCHAIN_ROOT=~/android-toolchain
9V=1 ~/Android/android-ndk-r7/ndk-build clean
10V=1 ~/Android/android-ndk-r7/ndk-build
11
12ant clean
13ant debug
14
15echo uninstall
16adb -d uninstall com.comuf.jgames
17echo install
18adb -d install bin/allegro-example-debug.apk
19echo start
20adb -d shell 'am start -a android.intent.action.MAIN -n com.comuf.jgames/.AllegroActivity'
I had to comment out the rsync line because it overwrote my files, and thus tried to compile for android-15, which I don't have installed. " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Ack, sorry about the rsync line, I forgot to comment/remove that one again. The interesting thing, is I've been compiling for android-15, and it runs fine on my phone. All that states is what SDK you're using, not what device your phone is limited to. I seem to have missed the error you're talking about, can you repost it? -- |
J-Gamer
Member #12,491
January 2011
![]() |
oops... here it is: install 1497 KB/s (350031 bytes in 0.228s) pkg: /data/local/tmp/allegro-example-debug.apk Failure [INSTALL_FAILED_INVALID_APK]
EDIT: " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
Thomas Fjellstrom
Member #476
June 2000
![]() |
J-Gamer said: Could it be necessary to use a rooted phone? I haven't rooted mine yet. Nope. I've not yet rooted mine either. What device do you have? It seems that error may have to do with the architecture or some other incompatibility. -- |
Trent Gamblin
Member #261
April 2000
![]() |
I got the same error, and here's how I fixed it. My device only runs Android 1.6, which is SDK 4. I don't know about Ubuntu, but on Windows there is a 'package manager' for the Android SDK. I had to specifically install the Android 4 SDK. Then when I built everything, I made sure to change all 'armeabi-v7a' to 'armeabi' and also wherever a platform is required (including one of the .properties files, don't remember which) I used android-4. The code built before doing that wasn't compatible with my device. Probably not necessary for you, but I also #ifdefed all GLES2 code in Allegro (ogl_draw.c, ogl_display.c, prim_opengl.c) and didn't build the shader addon.
|
Thomas Fjellstrom
Member #476
June 2000
![]() |
If your device is Arm6, the only thing you should need to do is change armeabi-v7a to armeabi. AFAIK. It's perfectly all right to build an android app using a newer SDK that runs on an older device (I have 2.3.4, yet build using android-15 which is 4.0.1). -- |
J-Gamer
Member #12,491
January 2011
![]() |
I'm on a Samsung Galaxy 551. EDIT: " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Yeah, that's and ARM6 device. You need to bump everything down to armeabi rather than armeabi-v7a. The cool thing is you can make both versions, and include the binaries in different jni/ sub folders, one for each arch, and android will know what to do. -- |
J-Gamer
Member #12,491
January 2011
![]() |
Why do I have all the allegro libs double, even after ant clean? EDIT: " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Look in the allegro build stuff, you need to rebuild allegro as well. J-Gamer said: They're jni/armeabi AND in libs/armeabi ndk-build looks for user libs in jni/* and it installs them to libs/ in the apk. I just think ndk-build clean doesn't bother to clean up libs/. -- |
J-Gamer
Member #12,491
January 2011
![]() |
Why is it installing in armeabi-v7a while I used this command for cmake??? " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Ok, you also need to pass: -DARM_TARGETS=armeabi to cmake. Default is to compile with armeabi-v7a and install to armeabi-v7a, it seems the cmake code I stole and modified override CMAKE_INSTALL_PREFIX. I should probably fix that. -- |
Trent Gamblin
Member #261
April 2000
![]() |
I definitely did have to build with the 4 sdk. I built the exact code with 15 and it didn't work. Also, forgot this but I had to NOT link libandroid.so, which isn't available.
|
Thomas Fjellstrom
Member #476
June 2000
![]() |
I'll check to see what my settings are, but they are probably what are in svn at the moment. But I know the standalone toolchain is android-15 or w/e. -- |
Mark Oates
Member #1,146
March 2001
![]() |
This thread's gettin' me all randy. -- |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Mark Oates said: This thread's gettin' me all randy. Heh. Well so far its working pretty well. I started on the filesystem access stuff. might support accessing those funky packed data files android has. And I just had a thought, If there are any devices people want to make sure work, especially older ones, ones that run Android 1.6, or 2.0, or 2.1. I want to borrow such devices to make sure they all work, and so I can write up some decent documentation on how to get started working with Allegro on Android that works with all variants. My neighbour does have a 1.6 device, but I don't currently have the money to buy it off him (uber broke). Which is why I'm hoping people would be willing to temporarily lend older devices. -- |
MiquelFire
Member #3,110
January 2003
![]() |
Well, if it didn't burn itself up, I would have a 2.1 device you could test with in April. --- |
|
|