Author Topic: Android Port (SDL2)  (Read 111576 times)

Offline sidav

  • Sergeant
  • **
  • Posts: 19
    • View Profile
Re: Android Port
« Reply #45 on: December 05, 2013, 10:25:04 am »
From what I understand, the porting itself is mostly complete
Yeah, but that port is 3 years old. Too old :(

Offline page

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Re: Android Port
« Reply #46 on: December 05, 2013, 11:13:22 am »
Erm, I don't know about any java port. What I did was port the current oxc to SDL2, which works on android, and from there start tweaking things to accommodate to the platform. The repo is here: https://github.com/cpages/OpenXcom/compare/master...android

Just to clarify, the codebase is the same for all platforms. You just build with gcc or msvc or whatever for pc, or cross-build with android's sdk+ndk.

Offline Tarvis

  • Colonel
  • ****
  • Posts: 111
    • View Profile
Re: Android Port
« Reply #47 on: December 05, 2013, 07:31:23 pm »
Oh wow, my bad. I didn't realize the most current development wasn't the same as in the OP.

Offline starwindz

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: Android Port
« Reply #48 on: December 07, 2013, 04:50:00 am »
Hi developers!
What is your operating system for android port development?
Linux(Ubuntu) or Windows or OSX?
« Last Edit: December 07, 2013, 07:52:00 am by starwindz »

Offline page

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Re: Android Port
« Reply #49 on: December 09, 2013, 11:38:57 pm »
Hi developers!
What is your operating system for android port development?
Linux(Ubuntu) or Windows or OSX?
I'm a NixOS user: https://nixos.org/

Offline Amunak

  • Colonel
  • ****
  • Posts: 101
    • View Profile
    • My homepage (czech only)
Re: Android Port
« Reply #50 on: December 10, 2013, 03:50:56 am »
Just some notes from my experience with lots of games and apps on my android phone:
  • You can move your fingers fast, but not precise (unlike mouse which is relatively slow, but precise) - therefore you need bigger buttons, but it's also less problematic to navigate menus (if the game is fast and doesn't have some stupid transition animations) and generally move the finger over the whole screen in no time
  • just touching  some exact place, especially on a map/terrain it's sometimes extremly difficult to work out where exactly you need to tuch. Therefore it's better to use some kind swipe movement (as for moving the unit/shooting cursor it'd be still nice if there were options - like swipe and click, or "doubleclick" - I'd prefer highlight and click; or doubleclick and press confirm
  • Too many hidden functions, especially long taps, can be extremly misleading. It must be somewhat easy to recognise what happens on touch and long press. If you hide a feature somewhere and not in other place, it'll be very confusing and there would be need for some kind of on-screen help overlay
  • it's a bad idea to try to port on all mobile devices at once. Better focus first on android, and let someone else make different port for iPhone/iOS.
  • it might be necessary to have a slightly different interface for mobiles and tablets. But if you make it clever you can probably avoid this.
  • All newer Android devices lack the "menu" button. In fact I believe that you would hardly run OpenXCOM on any of the older devices that have that button.
  • You can (and should) use the back button - the worst is when you (accidentally) press it and it just closews the game returning you to the previous screen (that happens when it has no function I believe). There should at least be confirmation
  • Please be kind to people who use the "switch active app" feature - sometimes games don't save their state properly, other times they unpause when they wake up (on battlescape you should always go to the slowest time mode on wakeup), and sometimes "sleeping" the game even for a second or two it forces you to load it all again for several seconds after waking it up
  • Make it highly configurable - I would, with my small screen, prefer little buttons - just some minimalistic, "everything-you-need" layout. But others, especially on tablets, may disagree

Also... You might consider merging the two hands together. Or display just one main, and make the other accessible through its menu or inventory. I bet most people 80% of the time use only one hand, one weapon.

What do you plan for controling the geoscape? I'd suggest make it drag-hold move, and with placing bases/intercept I think it'd be best to have the crosshair just centered, and you'd place it by rotating the globe. You could also make the globe zoom in an out by two-finger touch  and move, like in Google Maps.
« Last Edit: December 10, 2013, 03:54:57 am by Amunak »

Offline Tarvis

  • Colonel
  • ****
  • Posts: 111
    • View Profile
Re: Android Port
« Reply #51 on: December 12, 2013, 07:59:41 pm »
Read through the last few pages, we've pretty much discussed this (move/shoot cursors can be dragged around for precision and tapped again to confirm)

As for newer Android devices, with the navigation bar being part of the screen instead of separate buttons, I thought apps could call for a menu button to be shown on the right side? I don't have a phone like that so I can't quite confirm.

EDIT: Yes, but this is done by setting the app's targetSdkVersion to <11. I'm not sure what else that might affect though...

As for merging hands, how will you throw grenades then without putting your gun away first?
« Last Edit: December 12, 2013, 08:07:40 pm by Tarvis »

Offline Amunak

  • Colonel
  • ****
  • Posts: 101
    • View Profile
    • My homepage (czech only)
Re: Android Port
« Reply #52 on: December 12, 2013, 10:17:45 pm »
As for newer Android devices, with the navigation bar being part of the screen instead of separate buttons, I thought apps could call for a menu button to be shown on the right side? I don't have a phone like that so I can't quite confirm.

EDIT: Yes, but this is done by setting the app's targetSdkVersion to <11. I'm not sure what else that might affect though...
Yes, you can do that. But it doesn't look nice - the button is on the side, it really looks like "I don't want to be there" and it shouldn't really be present in modern apps. I think that using a button like in the original is the best solution, even if it takes some space.

As for merging hands, how will you throw grenades then without putting your gun away first?
I assume that all these popup menus would take up all the screen space (unlike just a part, like in the original). There should still be enough space to add something like "left hand: throw; left hand: auto fire; left hand: manual fire; ... And if not, you can add just one item/button/switch, that'd say "use the other hand". If you tapped that, you'd get the menu for the other weapon.

Or you could just make it accessible through the inventory screen only (maybe have there buttons like "make primary" (which would select that hand as primary and show it in the bottom of the screen), and "access this hand now" for one-time use. I guess the former idea is better, though.

Offline Tarvis

  • Colonel
  • ****
  • Posts: 111
    • View Profile
Re: Android Port
« Reply #53 on: December 16, 2013, 07:49:34 pm »
Yes, you can do that. But it doesn't look nice - the button is on the side, it really looks like "I don't want to be there" and it shouldn't really be present in modern apps. I think that using a button like in the original is the best solution, even if it takes some space.

It may look like an afterthought, but it's still there, and to me I think it's a lot less intrusive than taking up space in the top left corner, covering a bit of the map area. It could always use the Back button instead, though.

Offline Amunak

  • Colonel
  • ****
  • Posts: 101
    • View Profile
    • My homepage (czech only)
Re: Android Port
« Reply #54 on: December 17, 2013, 12:16:50 am »
It may look like an afterthought, but it's still there, and to me I think it's a lot less intrusive than taking up space in the top left corner, covering a bit of the map area. It could always use the Back button instead, though.
This.

Also, if you were to remove one of the "hands", you could easily put both buttons there.

Offline HappyCat

  • Sergeant
  • **
  • Posts: 24
    • View Profile
Re: Android Port
« Reply #55 on: December 25, 2013, 10:41:41 am »
Page, is there any chance for nightly/weekly/some-other-time-span builds?
Still not found time to fence with this, only got compiled small sdk apk out of the project(

Offline HappyCat

  • Sergeant
  • **
  • Posts: 24
    • View Profile
Re: Android Port
« Reply #56 on: January 12, 2014, 12:55:52 pm »
Thanks. To explain in detail all that would require more than a forum post, but I can give you some hints:
...
2. This depends on your o.s. but you need android's sdk and ndk. Then you put all the SDL libs in openxcom/android/jni (you need a special patch for SDL_gfx, which its author just added to the lib) and you're ready to go: cd android / ndk-build / ant debug
It might be a dumb question, but I don't see a ndk-build folder in github sources. What am I doing wrong?

Offline page

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Re: Android Port
« Reply #57 on: January 12, 2014, 01:00:30 pm »
It might be a dumb question, but I don't see a ndk-build folder in github sources. What am I doing wrong?

Sorry the instructions were a bit confusing. You are meant to run ndk-build and ant debug, from the android folder. Using '/' as a separator was a bit misleading :)

On a related note, though, here is my Christmas gift (with a bit of delay): https://www.ufopaedia.org/index.php?title=Android_port_(OpenXcom)

Offline HappyCat

  • Sergeant
  • **
  • Posts: 24
    • View Profile
Re: Android Port
« Reply #58 on: January 12, 2014, 02:15:03 pm »
Thanks a lot!
UPD: I am having a shifted pallete unless I am in a text edit mode or taking screenschot.
For example, I look at Earth floating in pink space and having blue surface, but when it is time to enter base name it's looking normal again.
Until I finish entering the name.
« Last Edit: January 12, 2014, 03:11:40 pm by HappyCat »

Offline mtwilight

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: Android Port
« Reply #59 on: January 13, 2014, 10:48:31 pm »
Hi,

I've been following you guys on this board because I love the project. When I saw you guys here discussing about doing the visual adaptations on OpenXCom to fit smaller screens I though I might have some to add, as a designer, just some suggestions, entirely open to be discussed:

- On smaller screens I think some UI elements will have to be out or subset in a menu, 'cos there's a lot on the screen now. A good start, in my opinion, is to match Apple design guidelines when they say to design for the 80% majority, which in this case means that commands used by 20% of the people could be put out. Viewing the main screen is always more important than having a non-standard option.

- For that above, I don't know if this was covered already, but the ideal case is to have a simpler version for smaller screens aside with a complete version for bigger screens. All good system/apps with multiple versions do so: the smaller the screen, the simpler the interface (simple in this case means 'with less features').

- Buttons like the "view all levels" and "help" could be cut out.

- The soldier stats and rank could be simplified or cut to open space. In the stats case, for the sake of briefness you could leave the numbers and cut the bars or, if possible, change the bars into something smaller.

- A clever idea is to eliminate all back and forth buttons (up and down too) that can be looped (level viewing, prev/next xcom operative).

- I don't think a toggle button with all four options (like the TU saving mode presented) is a good idea. People will try to press only the part they want, making it uneffective as a big button. Two ways to make it work: show only the current mode or don't use green background, but a html-radio-like above the options.
( I don't get why the crouch option have to be apart, but I must have bypassed it here... )

- Last, but not least, the soldier stats screen and the soldier ground screen could be called by pressing the soldier name/stats and both screens could have a button to call the other screen (stats/ground).

I made a quick screen of what I've been thinking, hope it helps somehow.

So that's it, keep up the great work guys  :)