2014-01-18 Framework for Mobile Application
What framework to choose if you want to build a mobile application which
will save you some time while deploying on multiple phones?
(Android, Black Berry, iPhone, Windows Phone). I'm not sure
there is a perfect answer and it will probably change in a couple of months.
However, this what I found. I was looking for answers. Which phones does it support today?
Where can you develop your application? Which language? How to build?
How to deploy? Cost? I limited my study to the following frameworks
(according to a friend, the others are not as mature):
- Apache Cordova (or PhoneGaps):
This framework provides a common API in javascript/HTML
to access the API of each phone. The goal is to build application
for many phone based on the same code. It produces
a web application.
- Sencha Touch:
It contains more template javascript/HTML templates than Cordova.
The free framework does not seem to do more than
building a web application with javascript and HTML.
However, you can use both Cordova and Sencha Touch (see below).
- Titanium Mobile:
It is also a framework using javascript/HTML. The framework
can access the native API of each phone (as opposed to Cordova).
You might end up with a different version on each phone.
The framework should give more freedom than the first one.
- Xamarin (+ MvvmCross):
It proposes a way to build phone application written in C#
on every phone (using Mono for iOS and Android).
It gives an access the native API.
The framework also includes the possibility to design hosted on
a remote machine which can communicate with the phone application.
- kivy
A framework in Python (2.7, migration to Python 3 should happen some day).
It was not meant to develop phone application but it now proposes
a way to make it work on Android,
with pyjnius,
and iOS,
with pyobjus and kivy-ios.
This two libraries connect Python to java which accesses the phone
functionalities. There is no support for Windows Phone.
A last module plyer
gives access to some extra functionalities (GPS, text to speech).
more...
2014-01-01 Frameworks for games in Python
Implementing a simple game in Python is not too difficult if you consider using
a module such as pygame.
With the multiplicity of devices (computers, laptop, tablets, phones), we may wonder whether
or not the same code will work on many of them. So far, I was able to find a couple of modules to
implement a game. I mean display graphics, play music or videos, intercept events coming from the mouse
or the keyboard:
- pygame: very popular and bullet proof but it does not work with touchscreen (it
is based on SDL). There is no dependency.
- pysdl2: the development seems quite active, it is based
on SDL2 which needs to be retrieved first. It can handle touchscreens.
- pyglet: offers similar functionalities, however, the development
does not seem to be very active.
- PySide: very similar to
pyqt, the licence is different and gives more freedom.
If the game requires 3D graphics, those extensions will have to associated with
pyOpenGL. If my preference goes to
pygame
mostly because I know it, I would consider
pysdl2
because
SDL2 now supports Android and
iOS (iPad, iPhone).
GitHub and Bitbucket are now very popular. You can find examples just by searching the module you want to use:
pygame on github,
pygame on bitbucket.
However, there exist others solutions. They might need more effort to be used but they
seem promising as they could really make deployment on many platform easy.
kivy seems very promising. A game implemented with that framework
can be deployed on Linux, Windows, Android, iOS. It is also available on
Raspberry Pi. kivy allows the programmer to
interact the same way with any device.
The last one I found is pythonista. It was designed to
easily implement Python programs on iOS (iPad), not necessarily games.
It only works with Python 2.7 but I hope Python 3.x will be
soon supported.
A last solution would be to use a HTML/Javascript solution packaged in a service but maybe, it goes beyond python
and the scope of this post.