Porting to Android

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Message
Author
Alexandus
Space Krill
Posts: 1
Joined: Sun Jul 17, 2011 2:58 pm

Porting to Android

#1 Post by Alexandus »

Hello community, was curious to see if it is possible to port this game to android? I have the asus tf101 tablet and use it at work, and would love to have a game like this to play! Any help would be greatly appreciated.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Porting to Android

#2 Post by Geoff the Medio »

I've never used an Android device or done any programming for one, but I imagine porting FreeOrion would be difficult and complicated, but is probably possible in some form.

There is some discussion of Ogre on Android, though I don't know how functional that is. In practice, it may require writing a new interface program instead of "porting" the existing interface. Doing that is quite possible and flexible, as, for example, the FreeOrion AIs have no visual interface at all and can play the game (to some degree).

The server and AI also need to be built if you want to play a single-player game. If it's possible to launch other processes and have them communicate with eachother on a single Android device, then that should work. If not, then you'd need to set up a separate server and connect to it to play a game.

Regardless of these details, an Android port or client for FreeOrion will probably only be possible if you are willing to do the porting (or can convince someone else). That's probably the biggest problem, unless you're an experienced developer with sufficient motivation to work through the platform-specific issues yourself.

User avatar
ChronicRat
Space Krill
Posts: 3
Joined: Sat Jun 13, 2015 8:29 am
Location: Russia

Re: Porting to Android

#3 Post by ChronicRat »

Well, I am professional C++ programmer with Android experience. :D So, the question of porting is still actual?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Porting to Android

#4 Post by Geoff the Medio »

ChronicRat wrote:So, the question of porting is still actual?
Not sure what that means, but the mention of Ogre on Android is not irrelevant as FreeOrion has switched (back) to SDL2 instead.

User avatar
ChronicRat
Space Krill
Posts: 3
Joined: Sat Jun 13, 2015 8:29 am
Location: Russia

Re: Porting to Android

#5 Post by ChronicRat »

I mean do you have Android port already? Or is it in progress?

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Porting to Android

#6 Post by MatGB »

Neither, this is the only mention of it ever that I'm aware of, the main team are certainly not going to be able to even look at the idea for some time.

If, on the other hand, someone wanted to do it then it should, in theory, be feasible, it runs on Linux which Android is, technically, a fork of, but you'd need to have a pretty high spec phone/tablet to make it viable unless you completely change the display mechanism (if you could get the game, as is, to run on a typical tablet, I expect the battery life to be measurable in minutes, for example).

At some point I plan to get an Android tablet, at which point I'd love to see this sort of thing. But given the core game itself doesn't really have enough devs, we're all volunteers in spare time, etc.

If you want to get started, um, yeah, go for it ;-)
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Porting to Android

#7 Post by Dilvish »

A slight clarification Mat-- Android is based on the Linux kernel, but lacks lots and lots of the software that a regular Linux distro includes; I expect that a lot of libraries we use are not normally available for Android. It could be that any we use that don't come with Android could be compiled for it, though.

To be clear, FO is set up to compile and run on Linux just fine, using the cmake build system, so that should help with any porting effort.

Also, it looks like there are a couple ways to get a fuller Linux installation onto a droid device, such as http://www.linux-magazine.com/Online/Fe ... e-to-Linux, and http://linuxonandroid.org/ , so if it's just that you're wanting to be able to play on your phone it could be that one of those routes might be (mostly) sufficient. Then you'd mostly just have to worry about how to try scaling the UI to something that works reasonably on a phone display.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
ChronicRat
Space Krill
Posts: 3
Joined: Sat Jun 13, 2015 8:29 am
Location: Russia

Re: Porting to Android

#8 Post by ChronicRat »

Yep, I thought about porting. But after code review, I think it won't be so easy as I supposed. I just haven't enough time for it. Sorry for disturbing, guys. =(

Apo
Space Squid
Posts: 89
Joined: Fri Apr 19, 2013 4:10 pm

Re: Porting to Android

#9 Post by Apo »

It appears there are already several guides out there that explain how you can run Debian or Ubuntu on your device.

http://forum.xda-developers.com/showthr ... ?t=2692270
http://forum.xda-developers.com/wiki/AS ... tu_Install

If you are able to install one of these Linux distributions, you could use the official Debian packages of FreeOrion for ARM devices.

https://packages.debian.org/sid/freeorion

meverik
Krill Swarm
Posts: 10
Joined: Mon Aug 17, 2015 9:56 am

Re: Porting to Android

#10 Post by meverik »

Hi,
I use Odroid SoC's running linux and have been wondering if building freeorion would be worth a try?
I have a GLES accelerated SDL2 and have been able to build a few projects against it (ufoai, caveexpress) so my question is what's the status of arm/gles port?

Thanks

(forgive my Hunic English)

Massa
Space Krill
Posts: 5
Joined: Tue Sep 01, 2015 12:33 pm

Re: Porting to Android

#11 Post by Massa »

I'm not sure how useful that might prove be to the FO devs or anyone attempting to port but it seems android support has been added to ptitSeb's glshim 2 days ago:

https://github.com/ptitSeb/glshim


And now for some language humour from earlier in the thread - some people use the word 'actual' in the sense of 'current', 'up-to-date' cause that's what it means in their own language.

clarke21
Space Krill
Posts: 1
Joined: Tue Dec 04, 2018 6:54 am

Re: Porting to Android

#12 Post by clarke21 »

You cant port to android but you can use cross-platform mobile application development.
It allows you to write a significant part of code using one language (for example, ReactNative created by Facebook developers uses JS). Subsequently, you can reuse as much as 50% to 80% of this code for both platforms. Moreover, this code will run as completely native on a device, so you won’t face poor performance or other issues.

You will only have to write those parts of the code using native language, which mostly concern UI and some design elements.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Porting to Android

#13 Post by Ophiuchus »

clarke21 wrote: Tue Dec 04, 2018 10:59 am You cant port to android but you can use cross-platform mobile application development.
I think compared to a mobile-app port it would be simpler and more useful to have some responsive browser client available which also would work on an android device (probably mobile-first approach, we already have a good desktop UI).

If you do not need the game to work offline you could simply connect to a game server. I think this will become easier and easier to self-host. See what Oleg did and what happens in the provider space.

Also e.g. even just being able to open the encyclopedia on your pad or phone (next to your main screen maybe) would be a win.

The map is the main UI artefact on the desktop. On small devices that is not useful but for giving orders you do not necessarily need the map.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Porting to Android

#14 Post by o01eg »

I've managed to build common and parser library for android: https://github.com/freeorion/freeorion/pull/3202

It's still need some fixes for Android's directories and some glue to Android JNI so some client could use them.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Oberlus
Cosmic Dragon
Posts: 5714
Joined: Mon Apr 10, 2017 4:25 pm

Re: Porting to Android

#15 Post by Oberlus »

That looks so good. Good job and keep it up.
I foresee hordes of people scrolling through their chunk of the galaxy and reviewing the state of their armies while commuting to their jobs.
That could make multiplayer slow games faster :lol:

Post Reply