[squeak-dev] Re: [Pharo-project] cog vm for iOS

Andreas Raab andreas.raab at gmx.de
Fri May 27 08:43:28 UTC 2011


On 5/27/2011 2:09, Chris Cunnington wrote:
>> About Android: A Squeak version by Andreas Raab (proof of concept)
>> made it to the market, but seems to be unmaintained. Is there any
>> information, about how it was done, what the caveats are and how this
>> might leverage smalltalk development on Android?
>
> http://code.google.com/p/squeak-android-vm/
>
> I bought a Xoom on Monday and downloaded Squeak onto it from Android
> Market. It works. It's very small. And there's no keyboard. There
> is no Squeak on the Apple App Store and likely will never be. I'm beyond
> caring at this point.
>
> You need to download the Android SDK and then because you're building a
> non-Java app you need to download the NDK (N for Native.)
> All of this is built into Eclipse.
>
> Andreas provides all the files you load into the NDK/jni compiling
> suite. You get a set of vm C files for compiling. He wrote one
> that bridges to Android called squeakvm.c. Then you compile a file
> called libsqueakvm.so.
>
> He's included an image, which for reasons I haven't reached yet has been
> sliced into 12 1M pieces.

Because for some inexplicable reason, you could not load assets larger 
than 1MB in a chunk when I tried. So I said #@!$%^W^W^W^W thank you 
Google, and split 'em up :-)

> He also wrote some Java files, which
> act as a wrapper between Android and Squeak. They handle the Android
> "Aspect" and "Intent" or something. I just got the books so it's a
> bit hazy.

It's basically dealing with the UI aspects of Android. "Intents" have 
little to do with it actually; intents are more like DDE verbs (i.e., 
"open", "edit" etc) describing the kind of activity you're trying to do 
with some bit of data.

> Oh, the Dalvik debugger is essential. And RFB is used for some reason I
> can't fathom yet. And development happens using an
> emulator provided by the Android SDK. Whether I'm supposed to build or
> find the device description (the AVD - for Android Virtual
> Device) at this point that describes the Xoom, I'm not sure.

RFB can be useful if you're trying to run the app in the background. 
some people had been playing with it.

> It's a pretty fun exploration. Now you know all I do. Really, I just
> want to make the screen bigger. That's related to this in squeakvm.c:
>
> sqInt ioScreenSize(void) {
> return ( 800<< 16 ) | (600)
> }
>
> I have no idea how a left bit shift produces a screen size near the
> 300x200 pixels that I get on my Xoom. But if I knew what I was doing
> I wouldn't do it.

Hm .... this should be in org.squeak.android.SqueakView.java. If you 
change the initialization you should get a proper display bitmap.

Cheers,
   - Andreas



More information about the Squeak-dev mailing list