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

Offline Asmin

  • Squaddie
  • *
  • Posts: 1
    • View Profile
Android Port (SDL2)
« on: January 06, 2013, 03:52:36 pm »
Any updates?
I bet a lot of people would love to run openxcom on their androids!
Have a great holidays ;)
« Last Edit: February 12, 2014, 05:34:22 am by SupSuper »

Offline HappyCat

  • Sergeant
  • **
  • Posts: 24
    • View Profile
Re: Android Port
« Reply #1 on: May 22, 2013, 01:27:18 pm »
With 0.9 it becomes interesting again. Sadly, I have almost no experience in android programming myself.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Android Port
« Reply #2 on: May 24, 2013, 07:54:57 pm »
SDL is cross-platform so it shouldn't be too hard, seems it's already been done for other SDL projects: https://libsdl-android.sourceforge.net/

I dread to think how OpenXcom performs on mobile devices though...

Offline Amunak

  • Colonel
  • ****
  • Posts: 101
    • View Profile
    • My homepage (czech only)
Re: Android Port
« Reply #3 on: May 25, 2013, 05:09:09 pm »
SDL is cross-platform so it shouldn't be too hard, seems it's already been done for other SDL projects: https://libsdl-android.sourceforge.net/

I dread to think how OpenXcom performs on mobile devices though...

Better than emulated in DosBox I'd guess :)

Offline xracer

  • Commander
  • *****
  • Posts: 565
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: Android Port
« Reply #4 on: May 28, 2013, 07:56:00 pm »
how will it work, with the required data?

would we have to compile, insert the data and the create the .apk?

I think that for us lowly non-programmer people that will be trouble some.

And i know that you guys do not want to distribute the original artwork.

What are your thoughts Sup?

Offline HappyCat

  • Sergeant
  • **
  • Posts: 24
    • View Profile
Re: Android Port
« Reply #5 on: September 05, 2013, 12:20:09 pm »
As far as I can see, it's possible to require user to provide folder with original data on the first run.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Android Port
« Reply #6 on: September 06, 2013, 05:45:52 am »
You can still access external data on the memory card, much like ScummVM and DosBOX do, no need to embed it into the APK.

Offline sidav

  • Sergeant
  • **
  • Posts: 19
    • View Profile
Re: Android Port
« Reply #7 on: November 02, 2013, 07:02:00 pm »
Is there still hope for the port?

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Android Port
« Reply #8 on: November 03, 2013, 01:17:27 am »
Probably the best chance would be porting to SDL2, as it's the least disrupting option, but it would still require a fair amount of change.

Offline page

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Re: Android Port
« Reply #9 on: November 22, 2013, 01:22:52 pm »

Offline starwindz

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: Android Port
« Reply #10 on: November 22, 2013, 03:17:38 pm »
There is hope: https://www.youtube.com/watch?v=ImQyW7A8hcw  ;)
This is a real hope! I am looking forward to see 1.0 version of apk release. :)

Offline starwindz

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: Android Port
« Reply #11 on: November 24, 2013, 05:09:39 am »
There is hope: https://www.youtube.com/watch?v=ImQyW7A8hcw  ;)

Splendid job! I strongly would like to know the following information and run OpenXcom on my Android smartphone and tablet PC.

1. How to merge 'SupSuper's the latest git master' and 'your android code'?
2. How to set up the android compile environment and how to compile the source code?
3. How to install .apk file and how to run OpenXcom-android?

Thank you very much.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Android Port
« Reply #12 on: November 24, 2013, 08:36:18 am »
There is hope: https://www.youtube.com/watch?v=ImQyW7A8hcw  ;)
Nice job, surprised to see it actually works. :)

I noticed your text colors seem off though. You probably need to update Surface::paletteShift to copy SDL_Color's new alpha field. There might be other places where you need to check this (I assume you already corrected the palettes to be fully opaque).
« Last Edit: November 24, 2013, 08:38:24 am by SupSuper »

Offline page

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Re: Android Port
« Reply #13 on: November 24, 2013, 07:09:52 pm »
Splendid job! I strongly would like to know the following information and run OpenXcom on my Android smartphone and tablet PC.

1. How to merge 'SupSuper's the latest git master' and 'your android code'?
2. How to set up the android compile environment and how to compile the source code?
3. How to install .apk file and how to run OpenXcom-android?

Thank you very much.
Thanks. To explain in detail all that would require more than a forum post, but I can give you some hints:
1. Basically you fetch both branches (they're both in github) and git merge. I guess I'll do that myself anyway, sooner than later, to prevent the branches from diverging too much.
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
3. Run 'ant debug install' and you're set.

You can google for details about all those steps. There are many step by step guides if you're starting.

Offline page

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Re: Android Port
« Reply #14 on: November 24, 2013, 07:16:53 pm »
Nice job, surprised to see it actually works. :)

I noticed your text colors seem off though. You probably need to update Surface::paletteShift to copy SDL_Color's new alpha field. There might be other places where you need to check this (I assume you already corrected the palettes to be fully opaque).
Yep, text rendering is indeed broken. For now I've just made enough changes to achieve a somewhat working state, so I haven't even checked what might be wrong. Thanks for the hint!