0

I have searched to the point of confusion, so I need some guidance. I want to make a game on Android with Python - ONLY using my android device.

I'm confused in the difference between Kivy and Sl4a and what steps i need to take in order to be able to program and run my game on my phone. I seem to only be able to find outdated or misleading information, so i apologize if this is simple.

Any guidance is much appreciated. Thanks!

  • 8
    Why would you want to do this to yourself? – Blender Nov 18 '13 at 23:59
  • I doubt you will be able to... I think theres a limited functionality python parser in the app-store also if you just want a shell\ – Joran Beasley Nov 19 '13 at 00:00
  • I don't know if there's an Android equivalent of the iOS app [Pythonista](http://omz-software.com/pythonista/). But, even if there is, as cool as Pythonista is, it's much easier to type and edit code, use the interactive shell, run unit tests, … on my laptop than on my iPhone, and unless your Android device is some weird laptop, I'm sure the same is true for you. – abarnert Nov 19 '13 at 00:04
  • My laptop just took a dive so I need a temporary fix. I know it's possible with AIDE but I'm trying to avoid learning java.. – user3006746 Nov 19 '13 at 00:30
  • Not sure how my questions say I'm looking for opinions. They were direct and I received my answer. Neither here nor there, I suppose. Thanks for the replies! – user3006746 Nov 20 '13 at 15:03

1 Answers1

3

I have searched to the point of confusion, so I need some guidance. I want to make a game on Android with Python - ONLY using my android device.

As others have said, this is somewhere between 'really hard and annoying' and 'impossible'. Especially without a computer to do any of the process!

I'm confused in the difference between Kivy and Sl4a

Kivy is a cross-platform (linux, windows, osx, android, ios, maybe more) graphical framework for python. The same developers maintain a python-for-android project that lets you very easily compile a kivy program to an android apk. You can also do java api interaction etc. using the pyjnius project, which is also maintained by the same devs, and some apis (vibrate, accelerometer etc.) are already abstracted as a python module so you don't have to touch java.

sl4a was originally (I think) a way to run python scripts on android. It has its own way to do some stuff with the android apis, but I don't know the details or what is possible. There are also some ways to package as an apk or to do some kinds of graphical work, but I'm not familiar with this either - I think they're much more limited as a graphical framework than kivy is (not that it sets out to be a full framework in the same way), but I don't know much about it, and at the very least the graphical stuff works in a quite different way that has advantages of its own.

(Edit: Notice all the 'I think' in the previous paragraph? That's because I really don't know for sure and don't want to say something wrong. Don't take my word for it, try it!)

Overall, kivy and sl4a (plus both of their related projects) are separate projects, with different focuses and technical capabilities. I personally think kivy is a more obvious choice for purposes other than basic scripting (though even simple sl4a scripts are useful to make tasker scripts etc.), but while some of kivy's advantages are arguably objective, some of my opinion is subjective.

what steps i need to take in order to be able to program and run my game on my phone

This is really a big topic on its own. Already knowing kivy, I reckon I could throw together a process to do it, but I'd absolutely not want to because it would need a horribly painful mishmash of other tools interacting in ways that are not a good user experience. In essence, I'd use text editors to create android files to run with kivy's interactive launcher (which is on the play store), and can probably in principle compile to an apk using kivy's online buildozer tools. However, I'll really stress that this is only in principle possible and I can't recommend trying - I think android really does not have a good set of tools for general purpose programming of this sort, and the os doesn't fit well with the multitasking of coding.

If you just want to write scripts and run them, you may have more luck. You can look at apps like qpython and codepad2 lite, along with the sl4a stuff (and probably other apps, these are just a couple I've seen or tried recently) for apps that can let you edit and run these kinds of scripts. This might be usable for certain things, but even then I don't think it would be a fun experience if you also need to switch between reading docs in a different app etc.

So overall...certain things are possible, but building full apps with (say) kivy is not likely to be an easy or pleasant experience with the current tools. Since you say you're constrained by circumstance and not choice, I suggest playing with qpython etc. and seeing what happens, but you aren't missing some fabulous ide that takes all the pain away.

inclement
  • 29,124
  • 4
  • 48
  • 60
  • That was a great response, inclement. Thank you and I am now more enlightened. I have a note 3 and I was hoping to turn it into a pc of sorts in order to continue on my learning path. I even considered loading Linux on it and attempt to code. I wonder now if I can accomplish much with AIDE and Java...or what other options I have. – user3006746 Nov 19 '13 at 01:57