Posts mit dem Label Android werden angezeigt. Alle Posts anzeigen
Posts mit dem Label Android werden angezeigt. Alle Posts anzeigen

Mittwoch, 27. Juni 2012

Android-Binding for GNU Smalltalk ready!

Essentially it's no big thing - just a few lines of Smalltalk-code: i created a GNU Smalltalk star Package including the "Android" class that gives access to the full Android API via SL4A.
Usage is simple. First file in the package with:

PackageLoader fileInPackage: 'Android'.

Then you can use it like this:

| android |
android := Android new.
android makeToast: 'Hello World!'.

A more complex example, using some dialogs, is included in the smalltalk_for_android.apk (you can use the QR-Code below to install the apk - but remember that you need to install sl4a before. See my previous blog-post).
To get an idea what is possible, see the the API reference. I think it is a wonderful perspective to write full blown Android apps with Smalltalk.
Coding Smalltalk on a phone or tablet is fun - the sl4a editor is a big help because it contains an api reference. If you want to hack more complex scripts, you can remote control your phone or emulator, just follow this instructions. Only one difference: you need to set the environment-variable AP_HANDSHAKE to some arbitrary value.
With this setup you can execute your script with "gst myscript.st" or just call the api via the gst console.
Sourcecode etc. is available on github.


Mittwoch, 13. Juni 2012

GNU Smalltalk on Android

I crosscompiled GNU Smalltalk 3.2.4 with the Android NDK (r8).
Because interaction with GST on Android was complicated (couldn't read stdout/ stderr reliable), i decided to use the Android Scripting Framework.
So if you want to try it, first you need to install SL4A. You should install the sl4a_r5.apk (not r4!)
After installing SL4A, you can download and install smalltall_for_android.apk. Remember to allow installation from untrusted sources.
I tested "smalltalk for android" with an android virtual device running Android 2.3.3. The Screenshot was made on my Samsung Galaxy S3.
Currently there is no binding for the SL4A API - you can execute Smalltalk code, but there is no interaction with the Android API.
So, if anyone would like to help implementing the JSON-RPC bridge to SL4A - that would be really great.
The Source is on github.

Sonntag, 18. April 2010

Squeak on Android

Seit geraumer Zeit arbeite ich am "Squeak on Android" Projekt mit: http://code.google.com/p/squeak-android-vm/ - ich möchte hier nur kurz auf den hohen Coolness-Faktor hinweisen.
Wenn das alles richtige funktioniert, kann man mit Squeak/ Smalltalk (die beste Programmiersprache der Welt) auf einfache Weise Anwendungen für das Android-Betriebssystem entwickeln.
Ich glaube, dass das Android OS seinen Marktanteil als Betriebssystemen für Mobiltelefone in Zukunft erheblich steigern wird und dass es sicherlich demnächst sowas ähnliches wie das iPad von Apple auch von Google geben wird. Es lohnt sich sicher, sich mit dieser Plattform näher auseinanderzusetzen.
Außerdem ist mir Android viel sympatischer als die meisten anderen Plattformen für die Entwicklung mobiler Anwendungen, incl. iPhone etc. - Android ist ein offenes System, es gibt komfortable/ freie Entwicklungsumgebungen für die Entwicklung von nativen Anwendungen und für die Entwicklung mit einer Java-API, außerdem gute Dokumentationen und Diskussionsforen.
Aber der Hauptgrund, warum ich das mache: Weil ich Spaß daran habe.