23 October 2012

Android development crusade part 6: 1000 downloads and v1.5 is out

Most people will laugh but i am very happy that my app had 1000 downloads.(Since July'2012)
WOW.
My target was 250 by end of the year.
I am impressed by my achievement.

Yes. I know. It seems to be nothing compare to multimillion downloaded apps on the web.
My workmates wrote apps, that has 200k (stopwatch)  and 20k(racing game),but i believe 1000 downloads for app that can be use once in rare cases sounds great.
I am really proud and happy with it.


I am surprised that I had only 9 crashes reports so far,which is not too bad either.
My app is runnable on all possible device,which will lead to serious problems . So far flashlight cause few problems thanks to Samsung and weird branded devices,who implement flashlight in .. weird way.
Recently I found another problem with some tests works,but initial settings are magically clean before and after test.It happens to my dodgy dodgy branded tablet only and i  haven't done enough debugging yet.
.

Recently user reports 3 problems:
1. Flashlight test do not crash,but ... hang .I assumed,that problem is
2. GPS crashed,but problem is
3.  Crash in Telephony info in Informations in Tools (cmda devices only)

Problems found by myself:
4.I found another problem with volume test
5. Odd behave on my tablet.


1) Good news is .. that my program do not crash on flashlight any more.It freezes instead.
I believe ,that my second fix should solve problem.
Program run little process in background to attempt to access camera's flashlight.If takes too long.Just inform user that his device is crap and done.
No Crash.No ANR.
This is theory.
How will looks in real world?I just need wait now and see.

2)
GPS case is bizzare.
First look what i see:

java.lang.IndexOutOfBoundsException: Invalid index 4, size is 3
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
at java.util.ArrayList.get(ArrayList.java:304)
at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:337)
at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:390)
at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
at android.widget.Spinner.makeAndAddView(Spinner.java:534)
at android.widget.Spinner.layout(Spinner.java:485)
at android.widget.Spinner.onLayout(Spinner.java:449)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4362)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1638)
at android.widget.TableRow.onLayout(TableRow.java:123)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4362)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
at android.widget.TableLayout.onLayout(TableLayout.java:444)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4362)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4362)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.widget.ScrollView.onLayout(ScrollView.java:1438)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4362)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4362)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4362)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4362)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1866)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1687)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)

As you can see , there is no any indication ,where in my app problem appear.
Report gives you a clue that it seems shit happen in  a ...  Spinner.
Spinner in Android cause few headaches in my beginning of development.

Unfortunately I used few of them.
To find which one i looked to trace and look how things fail
If you look to trace you will see that  spinner crashed in  LinearLayout and  LinearLayout  and etc.
And this is only clue ,which spinner could fail.
If you know which layout fail,then you know which activity/activities uses.
What you need to do is check all methods that access arraylist used by spinner
like : arrayList.get(i);  setSelection()

I found really cool explanation on stackoverflow.com
Source: ( http://stackoverflow.com/questions/4441883/weird-indexoubexception-using-buttons-inside-listview/4474652#4474652 )

This problem has (...) everything to do with the Spinner adapter.

When you click one of your buttons you call setSelection() on both spinners. If you check the code in AbsSpinner.setSelection(int) you'll see that it caches the integer index of the newly selected item and calls requestLayout() to redraw itself (at some later point).

When the UI thread processes the layout messages, it lays out everything in the view tree but blows up when laying out a Spinner because the index it cached earlier is no longer valid. Something has altered the adapter's list... this must have happened in response to a UI event such (as a Button onClick()) and which got processed before the layout message being processed.

which i believe applied somewhow to my case,but so far i don't know which line cause problem.


3. As I have limited possibility to test my app, so I expecting to see various interesting crashes
One of this example is ....my telephony info works fine if you use gsm or you don't have telephony support in your device,but ... what about cdma users. Well , my app simply ... crash.
I hope,that my fix (implement stuff for cmda case) will solve problem

4. Volume test seems to be worst implemented feature in my program.I cannot release new version without fixing something in this feature.
* Main reason is my lack of proper testing strategy.
* Another reason is few unique cases that i didn't think about it.
In this release. I fixed all known issue and add posibility to set volume max/mute all for all type of volume.
Almost.As on my tablet,this test seems to not work correctly.More details in next paragraph.

5. Odd behave on my tablet.

For some mysterious reasons.
Some my test cause troubles on my tablet (Flytouch tablet based on Crane).
When you start wifi test,then test starts from ... switching off wifi.In volume test,it mutes all volume.The same happen when you leave test (to go to next test,back to single test selection or just left app by pressing home button).
It works on other devices with Android 4.x, so ... i don't know,what caused problem.
I planning to spent some time to do proper debugging.


Next release plan.

Next release is planned on 11.11 and it will be bug fixing/code clean up and improvement).
No new features planned(As i want my program to be more stable).
My main focus will be on GPS which was in beta state but decided to add and .. it was a mistake.
It has couple issues.
* It crashes on leaving test (i think is sorted now).
* It crashes because spinner cause a exception.
* It has few minor bugs like it display GPS is detected on device that .. doesn't have GPS :).
* Information/status are very messy.
My code has lots unused code which i need to throw away,because they will cause a real problems.

I still think about add few features (USB info,Package installer,File Browser,dsLog*)

* it will log all activities and their result.No save.Export only