aliens

Author Topic: OpenXcom for Android - new official thread  (Read 308365 times)

Offline Syrion

  • Sergeant
  • **
  • Posts: 16
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #105 on: May 24, 2015, 08:54:45 pm »
After nearly a year of playing on and off, I have now finished my first game of (Open)Xcom, always using version 1.0 and the latest available version of the android port. As I said before, the only bigger issue I faced is the "sticky button" bug, which can even cause unwanted movement orders to happen with just one tap. But, I noticed it is related to general lag on my Xperia ZL. By closing all unnecessary apps before playing the problem is far less grave.
Next up is an Experienced Ironman run :)

I really hope sfalexrog will continue working on this port, especially one the next major OpenXcom release is out. Although he hasn't been on these forums for half a year :/

Offline Fenrir007

  • Squaddie
  • *
  • Posts: 1
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #106 on: June 08, 2015, 05:57:34 am »
What happened to the link to the nightly in the OP? Seems to be dead.

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #107 on: June 23, 2015, 12:09:51 am »
Huh, about time I showed up.

Well, first of all, I'm sorry I've been away and silent for so long. I didn't want to drop the project, but some life stuff came in the way. Anyway, I've played with some new shiny tools available to Android developers, and tried to split the Android Java portions from OpenXcom sources. The result is this Android Studio project: https://github.com/sfalexrog/openxcom-android. It should be a bit easier to pick up than the previous Ant-based build system.

Since Android code is now in a separate project, the most recent SDL2-ified version of OpenXcom is now in https://github.com/sfalexrog/OpenXcom/tree/sdl2. There's a lot of ugly #ifdef __ANDROID__ lines, which I really should replace by #ifdef __MOBILE__, because this code should work as well on iOS and Windows tablets. I'm yet to release a library pack for Windows compilation, but for now it works just fine and feels like SDL1.2 build.

I've checked the modsite (and uploaded a newer version), but encountered the same error. Apparently something's up with the inner workings, as I've encountered similar errors with OpenXcom Extended mod.

And now, to the good parts:
Well, as I've mentioned, I didn't really make much progress with OpenXcom. Still no mobile interface, still no "force fire" button. Still, there are some improvements deep under the hood:
  • I've tried to ease the process of running the game for the first time. Many people got confused by where the data should be put. With the FileMap update that tidied the file structure but made it incompatible with what we had before, I realized that I should redo the folder configuration a bit. Now it should do a better job at telling you what's your data status.
  • Since Android now supports 64-bit architectures, the apk is now slightly larger due to x86-64 version of the game. I'm not really aware of any device actually running this kind of CPU and system, but it's required for the 64-bit emulator, so here you go.
  • There are a few interface tweaks here and there: lists are now finger-scrollable (you don't have to use the scrollbars, but it's not kinematic, so scrollbars are still your friends for large lists), items in the inventory are now drag-droppable.
  • The game is based on 894263b upstream.

Direct download link in case the modsite acts up: https://dl.dropboxusercontent.com/u/732324/OpenXcom-1.0-g9bc2050.apk.zip

Offline Passerine

  • Squaddie
  • *
  • Posts: 1
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #108 on: June 24, 2015, 10:34:56 am »
On trying to run the game (the build linked in the previous post), I'm getting this error: "dlopen failed: cannot locate symbol 'rand' referenced by 'libmain.so'...[cut-off]"

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #109 on: June 24, 2015, 11:06:25 am »
I'm getting this error: "dlopen failed: cannot locate symbol 'rand' referenced by 'libmain.so'"

Now that's curious. Apparently, Google has decided to change its C library in some breaking way in Android 5.0: https://stackoverflow.com/questions/28504875/android-ndk-cannot-load-libc-shared-so-gets-cannot-locate-symbol-rand-refe (last answer), https://stackoverflow.com/questions/27091001/how-to-use-mkfifo-using-androids-ndk. I've missed this since my test device runs Android 5.0, so I'm rebuilding the app right now to use older headers. Sorry for the inconvenience!

By the way, when something like that happens, be sure to also name your device and Android version. It might not be much, but it might help figuring out what went wrong.

EDIT: Try this one: https://dl.dropboxusercontent.com/u/732324/OpenXcom-1.0-g9bc2050-api19.apk.zip, it _should_ work with pre-5.0 devices.
« Last Edit: June 24, 2015, 01:09:10 pm by sfalexrog »

Offline Syrion

  • Sergeant
  • **
  • Posts: 16
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #110 on: June 24, 2015, 01:09:22 pm »
Welcome back! :)

I have another little feature request: Can you make it so ordering your soldiers in a craft works by drag&sropping as well? Especially with the sticky button bug it can be quite time-consuming to bring soldiers in the right order tap by tap.

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #111 on: June 24, 2015, 01:34:28 pm »
...sticky button bug...

Huh, so that's still a thing? I'm at a loss about what might cause this thing.

Anyway, I'll try to, but there would only be either scrolling or drag-dropping.

Offline Syrion

  • Sergeant
  • **
  • Posts: 16
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #112 on: June 24, 2015, 10:28:03 pm »
On my Xperia ZL with Android 4.4.4 it is, although I haven't tried your most recent release, yet. Also, if that helps, I'm using OXC 1.0, no nightlies.

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #113 on: June 24, 2015, 11:09:54 pm »
On my Xperia ZL with Android 4.4.4 it is, although I haven't tried your most recent release, yet.

Well, at some point in time I've added logging for touch events, so if you're willing, you might try hooking up your smartphone to a PC and try to look through logcat to see if there's any strange things happening (i.e. fingerdown events without corresponding fingerup events). It would be great if you could reliably reproduce this problem and supply the logs of what's happening at the time, I believe it would help isolate this bug and find out what's causing it.

Offline Syrion

  • Sergeant
  • **
  • Posts: 16
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #114 on: June 25, 2015, 12:35:42 pm »
Well, I've now got a different problem. I've updated to your most recent version, which first wants me to specify the game folders, but it doesn't recognise them. They are as follows:

Status: Not found (Incomplete installation)

Path to game data files: /storage/emulated/0/openxcom
Path to save game folder: /storage/emulated/0/openxcom
Path to configuration files: /storage/emulated/0/openxcom

That's the main folder, everything is in there and that's worked for the last year. I've tried using "/storage/emulated/0/openxcom/data" but that didn't work either.

As for the log file, I haven't been able to use logcat properly. I tried the catlog app on my phone as well as the adb tools on PC, but they didn't record anything. Guess I didn't do it right.

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #115 on: June 25, 2015, 03:14:32 pm »
I've updated to your most recent version, which first wants me to specify the game folders, but it doesn't recognise them.

Yeah, the directory organization has changed (see https://openxcom.org/2015/05/openxcom-is-broken-warboy-what-have-you-done/, https://openxcom.org/forum/index.php/topic,3617, relevant commit is https://github.com/SupSuper/OpenXcom/commit/e35a311e5ab17fb1129759485e02f19a7782190d in upstream), so I've tried to adapt to it. More to the point, there should be a button under the "Incomplete installation" message with a "Install from directory..." caption. It opens a file dialog that propts you to point to the folder containing game data (GEODATA, GEOGRAPH and other subfolders). If the data is found and correct, it will be copied to the correct location in your "game data files" folder.

As for the log file, I haven't been able to use logcat properly. I tried the catlog app on my phone as well as the adb tools on PC, but they didn't record anything. Guess I didn't do it right.

Logcat might be disabled on your device (some manufacturers do that), and you might want to check your USB debugging setting. Also, your device might ask if you want to allow USB debugging via the PC you're currently connected to. And this might be a driver issue (I got all sorts of these even on my Nexus 7 and Nexus 4 devices).

Offline Syrion

  • Sergeant
  • **
  • Posts: 16
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #116 on: June 25, 2015, 06:23:20 pm »
I did the "install" and it seemed to work (it said "Version 1.0? (without sound"), now the app won't start at all :( It switches to a black screen upon opening and then instantly closes.

Offline imcx22

  • Squaddie
  • *
  • Posts: 8
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #117 on: June 29, 2015, 12:12:11 am »
Hello

I use openXcom on a tablet with an external physical mouse and keyboard.

Mouse has two buttons, by default mouse2 is bound to "Back" in Android.

When I play Xcom in DosBox, mouse2 works correctly - for centering on map in Globe Mode, for turning into a specific direction without taking a step in Tactics Mode.

However, in openXcom (the api19 version for pre 5.0 you posted above, running 4.4.2 over here) it remains bound to "Back".

Please, make it possible for me to use my mouse fully.

I want to use it like in DosBox (mouse2 for turning of soldiers into specific direction and xcom interface, rather than "Back" which goes back to android interface and crashes the game).

If it's already possible, I kindly ask you direct me at the howto or suggest instructions.

Thanks so far for your work (awesome, minus tiny bugs).

I also encounter the "sloppy" focus - for example, when using mouse clicks in lists of products in Sell/Sack and Purchase/Hire menus - when I click the up/down arrow, it moves the list on it's own a few pixels up or down, like if I used the scroll wheel (which btw works perfectly in this game, thanks for that).

Maybe it's possible to squish this bug too and I'm happy to provide useful feedback.
« Last Edit: June 29, 2015, 12:14:24 am by imcx22 »

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #118 on: June 29, 2015, 01:02:15 am »
Please, make it possible for me to use my mouse fully.

As luck would have it, SDL2 had better mouse support on Android added somewhat recently, and even though it's disabled by default, you might try to get it back by changing Options -> System -> Mouse support: Extended. I'm not sure how it will work on your tablet, but it seems to register right clicks on my Nexus 7 with a Bluetooth mouse, though I'm using stock 5.0.2 Android. Anyway, you should try it, though it might cause some issues with a touchscreen.

I also encounter the "sloppy" focus - for example, when using mouse clicks in lists of products in Sell/Sack and Purchase/Hire menus - when I click the up/down arrow, it moves the list on it's own a few pixels up or down

And this is a bug on my side, thanks for reporting that! I can reproduce this one on my device, and will look into it.

Offline imcx22

  • Squaddie
  • *
  • Posts: 8
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #119 on: June 29, 2015, 01:07:19 am »
Cool that you want to look into the sloppy click bug.

For this tablet (stock Samsung Android 4.4.2 on Tab S 10,5) I see no such option.

Is it hidden or an Android 5.X improvement?

Samsung is taking its time updating this device for the area it was purchased in.

I know right click works fine in Dosbox Turbo though.

Edit: I just tried updating manually and it seems it's pulling an update. Maybe it's finally lollipop. Downloading right now.
« Last Edit: June 29, 2015, 01:10:57 am by imcx22 »