Sunday, May 30, 2010

The Dialog pain is to end!

Android API has one unpleasant feature which significantly spoils the pleasure of the development: No way to pass a not constant value to dialog after it recreates on a screen rotation.
Here is a workaround: disabling to stop the activity on orientation change.
It saves a day, thanks so much!

Tuesday, May 18, 2010

Meanwhile

My Nexus One has retired. Again. Hopefully the HTC will send me another replicant soon.
While waiting it back I decided to change the system to a Tattoo on my old good Kaiser because I get tired of that blurry resized image and already get used to the sharp and crispy off the Nexus.
Tattoo system has the same resolution as Kaiser - 320x200, so it should fit.
The install process went smoothly (I took the source from here). Then I found the Wi-Fi does not work. I took an update from here, but standard /sdcard/andboot/androidupdate.tar update did not help. Comparing I found out the sysinit.rc is still different, and placed it manually. Then WiFi started working.
Current issue - the market client can not connect to the server, throws
DEBUG/vending(5478): com.android.vending.api.FatalCommunicationException: Sent a bad request.

Repair update: HTC sends the replacement phone overnight in the same day as they receive the broken one. Outstanding!

Wednesday, May 5, 2010

tactile fail

Bought a new expensive screen protection film from skinomi.com
I say that's sucks. It's polyurethane made and rubberish, not slick and bubbles
are still there although I did everything what the instruction says.
I wish I just bought six those cheap instead for the same money, the ones I bought previous time which feels much better and I could change them each time in the case they peel off.

Monday, April 19, 2010

need features

C++ need to be improved at least in two things:
1. An ability to call the base class constructor in any place of the derived class constructor, not only in that special section.
2. An ability to declare the overridden virtual method explicitly, to let the compiler verify is there a corresponded base virtual method.
3. Separate read and write data members protection.

Tuesday, April 6, 2010

Speak up!

I hate Microsoft - because they think only how to wide up the buyers mass, not about the quality of the products. They ignore common sense and needs of IT people favors only crowd of users.
I hate Apple - because of hordes of followers not only among the end users but also the competitors.
I hate GNU - because I believe they disfigured the common sense about the idea of paid software.
I hate touchscreen PDAs and smartphones - because I'm not an octopus and not Davy Jones.
I hate priests - because mostly they are fat corrupted liars .

Web Browsers nightmare

There is a problem exist with modern web development. For somebody it may be not a problem at all, but I'm blocked up by ....... and have to face it. The problem is the coexisting of the web server session management and multiply open browser's tabs/windows. Each window should have its own session on the server. When a new window opens, the new, its own session has to be created.
It would be said loud, it's not a problem at all if browser's url contains all necessary information about what actual data is being browsed/edited. But sadly, not in this case.
I wonder, what the W3C thinks about that? They invented the sessionStorage object which is supported poorly (IE, Opera) or is not supported at all (WebKit) by modern browsers.
It seems my vision and needs are in contrary with the browser developers'. For instance, Opera has a feature called "clone tab", which creates an exact copy of an existed tab, of course with the sessionStorage object same values, ruining all my efforts to achieve independency of tabs.
Despite some advantages of the sessionStorage object it does not allow to solve the problem of independent session.
It's pity, to solve the problem it would be enough one simple extension to browsers API - session cookies stored separately in each window or tab.

Sunday, April 4, 2010

Exception fight

Yet again that java.lang.IllegalStateException occurs with "The content of the adapter has changed but ListView did not receive a notification".

Looking on the platform source, I see the following:

This is thrown in the ListView.layoutChildren() when adapter's getCount() is not equal to AdapterView<>.mItemCount.

AdapterDataSetObserver in an inner class of AdapterView<>, it assigns the AdapterView<>.mItemCount in own method onChanged() taking the value from the adapter (AdapterView.java:778).

An AdapterDataSetObserver instance is AbsListView.mDataSetObserver, created in ListView.setAdapter()

Where that onChanged() called from? It need to be called before the adapter starts reportn the new count number. I see it's called only on some header/footer adds and removes in the ListView class.

mDataSetObservable is created in BaseAdapter and notifyDataSetChanged() passed to it.

Assuming those objects are related, I just need to change the data in adapter in the UI thread on completion and then call notifyDataSetChanged()