Picasa iPhone Application Launched iPhone window.onorientationchange Code
Dec 24

Shai Almog has written about developing Android code tips using Netbeans, which offers his thoughts after porting the bean-properties project to the platform. bean-properties allows you to do things like:

Property<Integer> x = PropertyImpl.create()

First, one of my main problems with Android was the lack of some core Java SE classes that made compiling code to Android rather difficult.

This seemed like a huge porting problem until I realized: “Android is not Java…”. I then started placing the missing classes within my project in the java.* packages and javax.* packages and compiling my code against my own mockups. E.g. Android is missing java.awt.Graphics, which I don’t really need for the general functionality but I do need it for compilation. So I just created the java.awt.Graphics class and stub methods which allowed me to compile my code in a portable way.

I would appreciate something like “Android for MIDP developers” and “Android for Swing developers”, since the guys at Google seem to have changed so much in the naming convention area. So here is a basic cheat sheet for Swing/MIDP developers that I hope some people can build on:

View - Component for Swing or Item for MIDP developers. This is the basic visual element in Android.

Layout - Unlike Swing layouts or MIDP layouts the layout is usually a container, so you add View’s directly to the layout (a layout IS A View).

Adapter - this has no MIDP equivalent. This is closest to a Swing model with the addition of a renderer of sort. So in Android both concepts of a model and a renderer are unified. Android will ask the Adapter for a view which it uses to render the model information, it will then return the view to the Adapter for “recycling” which seems odd for Swing developers used to the renderer concept but it makes some sense.

Leave a Reply

Spam is a pain, we are sorry to have to do this to you, but can you answer the question below? If so, the comment will go through!

Spam Question: What is the first letter of this site?

Your Answer: