KoLMafia on Android?

razorboy

Member
Hey guys,
I'm getting more and more interested in Android development, and (of course) the first app I wish was available is Mafia!

I know the Java implementation in Android differs from the one that is used for the PC version, but I'm curious if anyone is thinking about this port at all?
 

fronobulax

Developer
Staff member
Will you get me an Android to experiment with? ;-)

The last time I overheard a discussion about this, a port did not really seem easy because mafia uses Swing and a serious amount of multithreading. If you want to point me to a listing of the differences between the Java environments I'll see if I can be more precise and/or correct my memory and impression.
 

Alhifar

Member
With a quick grep I've found that android is missing the following packages that we're using:
Code:
java.awt
java.beans
javax.swing
org.w3c.dom
awt, swing and (to a far lesser extent) beans are used heavily in the gui, but the entire gui would need to be rewritten anyways. org.w3c.dom is used in the Item, Debug, and Faxbot Databases, but at a cursory glance, it isn't used in the Item Database. I'm probably just missing something there.

EDIT: Also, if someone does happen to work on this, I'd be more than happy to help test it, obviously.
 

fronobulax

Developer
Staff member
Thanks for both the links and confirmation that a major rewrite of the GUI would be needed. My sense is that It Ain't Gonna Happen but that is an easy opinion to change if anyone (else) has figured out how to maintain a code base with Swing and AWT and automagically generate Android code from that. I don't think anyone wants to write a second GUI for Android but changing a elements of a Swing GUI so the result is automagically mapped into an Android GUI is something that could be considered.
 

StDoodle

Minion
Here's a wacky thought... and it's one of those "probably much harder than I can imagine as a non-programmer" ideas, but... would it be possible to just suppress the GUI in an app? I know I'm not the only one who uses the relay browser 90% of the time, and if a way could still be found to have the chat pane CLI I think I could play just fine without the regular GUI. I'd still want the GUI for a lot of my postprism-management and combat setup stuff, but I could easily do the bulk of my actual playing without it.

Of course, to me at least, the relay (and regular) browser for KoL has way too much going on with its frames. I think a big step towards playable KoL would be some way of mapping a frame-switch to the phone's menu button.
 

fronobulax

Developer
Staff member
Given that there is a "headless" (no GUI) mode the problem would be to figure out how to build mafia so that it didn't need certain Java classes at compile/build time knowing that they would not be needed at run. My sense is that this is unlikely to happen unless someone on the dev team gets an Android, someone with an Android joins the dev team, or some other project in the Java/Android universe solves the problem in a way that does not require significant code modifications to maintain versions for all supported platforms.

I'm sure veracity would share her PayPal ID in case someone wants to contribute towards the first option above ;-)
 

StDoodle

Minion
Heh, if it would mean a decent shot at Android KoLmafia, I'd probably give her my original Motorola Droid when & if I ever upgrade. ;)
 

Veracity

Developer
Staff member
No thanks. It would take WAY more time and effort than I will probably ever have available.
 
C

chadnibal

Guest
There's a headless command line option? I would think making a fork of the code that deleted huge chunks to get it to compile and run cleanly as a relay browser only app would be do-able... it might be a little hard to get to work properly, but seems much harder to do a nice clean maintainable make options written into the codebase. Of course, if I could prove that you could get something running, someone else less lazy might well go back and clean it up.

It seems that Apache Harmony has java.beans implemented under Apache license which means you can port and use the classes as long as you have the license information in the source code... awt and swing seems much harder, I have a friend who is a swing goddess, but I don't touch the stuff.

KolChat 0.3 or KolChatter has been released by starwed, who was talking about a full app....

Given that there is a "headless" (no GUI) mode the problem would be to figure out how to build mafia so that it didn't need certain Java classes at compile/build time knowing that they would not be needed at run. My sense is that this is unlikely to happen unless someone on the dev team gets an Android, someone with an Android joins the dev team, or some other project in the Java/Android universe solves the problem in a way that does not require significant code modifications to maintain versions for all supported platforms.

I'm sure veracity would share her PayPal ID in case someone wants to contribute towards the first option above ;-)
 

fronobulax

Developer
Staff member
See this post for a place to start if you are interested in headless.

Appreciate and understand your comments about forking the code. I think the bottom line on this is that none of the current devs have any real interest in forking or have an Android and thus a personal stake in the project. However if someone else stepped up and took it on...
 

razorboy

Member
I've been interested in getting started in Android developement. Maybe I'll fiddle around with it.

Android has been ported to x86. http://www.android-x86.org/ (I don't know anything more about it, other than there is a website, and it seems to have stuff on it.)

I might mess around and see if I can get headless to work. Anyone else interested in helping me?
 

Theraze

Active member
I will stand on the sidelines and cheer you on but I need to own an Android before I will be motivated to do much more ;-)

Agreed... since I don't own one, and I've been unable to convince my friends with Androids to come back to KoL since they quit back long before NS13 or any of that, eventually having it be supported interests me but doesn't drive me personally. Yet.
 

Mr_Crac

Member
It's been a while. Any updates on the Android front? (or iOS, for that matter)

I wonder how well separated KoLmafia's GUI is from the rest of the program. I know, I could look at it myself... I just didn't, yet. :)

If KoLmafia for mobile devices is ever to become a reality, I think it can only work if the GUI and the core program logic (which needs frequent updates due to how the game changes) can be handled/developed separately from one another.
 
Last edited:

Theraze

Active member
Isn't this sort of technically available through allowing the relay browser to allow remote sessions?
 

ajoshi

Member
Hey people who are obvs still clamoring for an Android app and have not given up after 5 years! Guess what I managed to get running (for some value of running) today? Mafia on my phone! Logged in and ... um... well, it's my mall multi so I can't do much on it, but I logged in! And the 'status' command works! As do 'help' and 'win game'- the only 3 commands you really should be using anyway.
The app is clearly 100% done and totes perfect, and you can see it has a modern UI with a hamburglar menu and Hipsterly unhelpful titles like "Section 1", so that's a bonus!

http://imgur.com/47W5F14 (Sorry, image was too big to post here)
 

ajoshi

Member
Thanks! I can run scripts, maximize, concoct, and (technically) use the relay browser. Scripts take forever to run (obviously) and the browser doesn't contain any of the easy click links it does on desktop. I had to remove that because as far as I could tell, it's done using RequestEditorKit which extends a Swing class. So not much I can do there quickly. Anyway, I'll be on vacation for a month, so I'll get to test out the app a lot! ;)
 
Top