пятница, 3 октября 2008 г.

android.text...

Did you know that android.text package has 93 classes in it?
Classes in there is super-useful, all that lovely spans stuff and layout and even Multitap!
But I feel that I'm reaching some J2ME limit in terms of complexity. I already have 250+ classes, and this do not include SE library! Seems that I will be needing some really hard optimization work...

PS. J2ME-Polish has 400 classes.

вторник, 30 сентября 2008 г.

Trap

OK, I'm getting in this trap over and over again.
I think I need big sign in front of me, saying:
"Even when you have source code, reimplementing can be better option then porting. First estimate then start working."

PS. I parsed AndroidManifest.xml and resolved MAIN activity, but I'm having problems in putting it all together.

вторник, 23 сентября 2008 г.

Stub!

Wow, android.jar cut down to 2737Kb (from 11Mb).
How did they do it?

They just throw new RuntimeException("Stub!")!

Oh well. Back to work with 0.9.

PS. Hope they eventually release that beautiful, 'Stubbizing' tool :)

New SDK

Hooray, new SDK!
I hope they didn't change much...

Windowing

Windowing in Android is too complex to just "port" it, I mean, get source, hack it here and there, and voila. No voila for me. I need to re-implement it. Ohh.

понедельник, 22 сентября 2008 г.

Exceptions and nulls

Argh, I'm irritated at Android's inconsistency when dealing with errors.
Consider loading a drawable (bitmap).
If you load bitmap by yourself via BitmapFactory.decodeFile, you will get null in case of error.
If you load bitmap drawable via Resources.getDrawable, and there is a problem, you will get NotFoundException with nested IOException.
You can also load via Drawable.createFromPath, and you will again get Drawable or null.

I will add 'Throw' versions of some functions (decodeFileThrow) that will throw exceptions.

System resources

There are many references to android.R class which represents system resources, so for Android4ME we would need 'stripped down' version of system resources (it would not be hard, thanks for lib/res folder). I am thinking of taking drawables for controls from M3 release, as our target resolution is 240x320.