I like the Android platform. Actually, with some friends, we even participate to the ADC with the Spoxt project.
But Java is not my favourite language at all. We are working on a S60 version and this platform has a nice Python API. Of course there is nothing official about Python on Android, but since Jython exists, does anybody know a way to let the snake and the robot work together ?
There is also the new ASE project, it looks awesome, and has some integration with native Android components. Android Scripting Environment [1]
[1] http://www.talkandroid.com/1225-android-scripting-environment/
ACCEPTED]
How about Kivy?
http://kivy.org/#home
"Open source library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps."
"Kivy is running on Linux, Windows, MacOSX and Android. You can run the same [python] code on all supported platforms."
Kivy Showcase app
https://market.android.com/details?id=org.kivy.showcase&hl=en
[1]
YES! [1]
An example via Matt Cutts [2] -- "here’s a barcode scanner written in six lines of Python code:
import android
droid = android.Android()
code = droid.scanBarcode()
isbn = int(code['result']['SCAN_RESULT'])
url = "http://books.google.com?q=%d" % isbn
droid.startActivity('android.intent.action.VIEW', url)
[1] http://google-opensource.blogspot.com/2009/06/introducing-android-scripting.htmlimport android as a;d=a.Android();d.startActivity('android.intent.action.VIEW',"http://books.google.com?q=%d"%int(d.scanBarcode()['result']['SCAN_RESULT'])) - Alex L
"The Pygame Subset for Android [1] is a port of a subset of Pygame functionality to the Android platform. The goal of the project is to allow the creation of Android-specific games, and to ease the porting of games from PC-like platforms to Android."
The examples include a complete game packaged in an APK, which is pretty interesting.
[1] http://www.renpy.org/pygame/I just posted some directions for cross compiling Python 2.4.5 for Android [1]. It takes some patching, and not all modules are supported, but the basics are there.
[1] http://www.damonkohler.com/2008/12/python-on-android.htmlAs a python lover and Android programmer, I am sad to say this is not really a good way to go. There's two problems.
One problem is that there is a lot more than just a programming language to the Android development tools. A lot of the Android graphics involve XML files to configure the display, similar to HTML. The built-in java objects are really integrated with this XML layout, and it's a lot easier than writing your own code to go from logic to bitmap.
The other problem is that the G1 (and probably other android devices for the near future) are really not that fast. 200 Mhz processors, and RAM is very limited. Even in Java you have to do a decent amount of rewriting-to-avoid-more-object-creation if you want to make your app perfectly smooth. Python is going to be too slow for a while still on mobile devices.
I've posted instructions and a patch for cross compiling Python 2.7.2 for Android, you can get it at my blog here: http://mdqinc.com/blog/2011/09/cross-compiling-python-for-android/
EDIT: I've open sourced Ignifuga [1], my 2D Game Engine, it's Python/SDL based and it cross compiles for Android. Even if you don't use it for games, you might get useful ideas from the code and the builder utility (named Schafer, after Tim...you know who).
[1] http://ignifuga.orgNot at the moment and you would be lucky to get Jython to work soon. If you're planning to start your development now you would be better off with just sticking to Java for now on.
Check out this blog here that explains how to install and run python and a simple webserver written in python on Android.
http://www.saffirecorp.com/?p=113
SL4A [1] does what you want and is actively developed. You can install it on your droid easily from their site, and don't need root.
It supports a range of languages, Python support is currently for version 2.6, but the owner, Robbie, is personally working on Python3.
SL4A scripts have a library available for each supported language that gives you an interface to the Android API as a single Android object:
import android
droid = android.Android()
# say "hello world" using the text to speech facade
droid.ttsSpeak('hello world')
Each language has the pretty much the same API, and you can even access the device with JavaScript inside a webview or something:
var droid = new Android();
droid.ttsSpeak('hello from js');
SL4A URL: http://code.google.com/p/android-scripting/
Update
Using SL4A [1] (which has already been mentioned by itself in other answers) you can run [2] a full-blown web2py [3] instance (other python web frameworks [4] are likely candidates as well). SL4A doesn't allow you to do native UI components (buttons, scroll bars, and the like), but it does support WebViews [5]. A WebView is basically nothing more than a striped down web browser pointed at a fixed address. I believe the native Gmail app uses a WebView instead of going the regular widget route.
This route would have some interesting features:
From the Python for android [1] site:
[1] https://github.com/kivy/python-for-androidPython for android is a project to create your own Python distribution including the modules you want, and create an apk including python, libs, and your application.
Yet another attempt: https://code.google.com/p/android-python27/
This one embed directly the Python interpretter in your app apk.
There's also python-on-a-chip possibly running mosync:
[1] http://groups.google.com/group/python-on-a-chip/browse_thread/thread/df1c837bae2200f2/02992219b9c0003e?lnk=gst&q=mosync#02992219b9c0003eYou can run your python code using sl4a [1]. sl4a supports Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl, and shell script.
You can learn sl4a Python Examples [2]
[1] http://code.google.com/p/android-scripting/There is a wonderful project called the Scripting Layer for Android (SL4A) that is bringing scripting languages to the Android platform and providing a working alternative to Java development.
To get started, you need a copy of the Android SDK running on your computer, and you need a Java VM. Although you aren't going to program your Android app with Java, you still need a Java runtime upon which to execute the Android emulator, which is part of the SDK. The inclusion of the Android emulator gives you a sandboxed testbed to play in while you create your app.
Then you need to download and install Sl4A. You can download a copy from here. http://code.google.com/p/android-scripting/