Android and all other writing has been transition over to fregrott.wordpress.com. Please change your bookmarks.
Archive for the ‘Java’ Category
I have been sifting through Chicago Android opportunities and wanted to share this little strange gem. I am keeping the firm name and person’s name undisclosed because it would somewhat be embarrassing to them but to say that this proves that the people who cannot code go into business management somewhat is an understatement.
Basically, we were discussing what the first steps of android developer executes in a new position and I brought up the fact that one obviously creates a utility library full of helper classes and UI widgets. The interviewer stated tha they do not do that as they want some UI widgets created via code and not xml. Now guess what basic java concept the interviewer does not get, and this folks is former java programmer doing the interviewing?
Well, by using method overriding one can have methods that create the UI widget via code and by xml in the same class. Not to mention that you can include such classes in an Android Project Library. Or even this gem of not understanding that the basic rule of not having non-UI stuff on UI threads all leads into why the Android Activity/Application life-cycle is the way it is as far as the difference between the Application context and the activity context.
Its interesting to go on interviews to see if people really get testing or not and its role in the agile process. For example, the set of ant-rules files that is distributed with the android sdk has had annoying little mistakes in key areas such as the coverage target inn test_rules, etc for awhile. My correction to the coverage target is in this Gist.
And those little mistakes are usually encountered by just executing the scripts and going through all the developer user cases…in other words functional testing of the ant scripts. Its the same testing of patience when you participate in interviews and receive the impression that the potential firm is not using testing.
If you are an android bug reporter please vote for the bug, issue 17305. Lets vote on enough of these bugs in the ant rules files included with the sdk that the ant scripts become extremely useful instead of half baked.
My settings for the apiviz javadoc ant task in a gist. If you are not on windows than you know what to change already and you have to obviously change the link to the packagelist in the link offline to point to your sdk.dir/docs/reference.
As you can the linkoffline will give the correct linking as you are using the 2nd parameter to supply the package-list file which i sin your installed sdk not via the developer reference link. Hack if you will to make it work.
Usually, a good portion of new android developers have trouble with Eclipse.ini settings as java VM settings have changed over the years and there is a mess of legacy and new settings. This gist of my eclipse.ini settings is for multi-core and tested on MS Vista 32-bit, AMD 2-cpu-core 2.6 GHZ, 4 gig ram, and Eclipse 3.7.
It seems that now the choice of GC is more important whereas the G1GC is somewhat problematic as far as performance. I ended up using -XX:UseParallelGC instead. To give you an idea, about 20 small projects in workspace and startup time to using the IDE is under 1 minute. Obviously, the more cpus would improve performance and bigger projects will impact the startup time due to the ADT plugin scanning/building the projects on startup.
On Linux with JDK6 I had used G1GC settings in the eclipse.ini and that was problematic as far as performance on the same exact computer hardware so I assume that changing to using ParallelGC instead for Linux should also work.
Seems like everyone did not get why Google choose not to demo Social at Google IO this year. Obviously, part of it is that they do not want any other parts distracting it.
But, the other part i believe is some focusing on what is coming for Android for rest of 2011. While we already know that GoogleTV Android Sdk addon is coming there are of course other items that have only been hinted at with brief one sentence paragraphs.
For example, the music store hinted at GoogleIO 2010 is somewhat late as it was slated for holidays 2010. However, the Android Market changes to pave the way for that in terms of better access, in-app payments,etc have been incorpoated into Android Market.
With Apple testing over-the-air iOS updates slated for full implementation possibly in iPhone 5 that means apple will have the means to attack the low-end as before that style of updating you had to have access to a desktop mac to do updates. This means Google and OHA has to offer something beyond the navigation and text to voice. That obviously could be finishing the UI/OS fragmentation work of moving everyone to the Honeycomb UI apis including OEMs as that would result in OEMs getting updates to mobile carriers in terms of weeks rather than months. Thus, that is something to look for in does Google show off an Android 2011 road-map or show a new version of android for phones with the new honeycomb UI apis being used.
But, no matter if those get fully addressed or not it should be an interesting Google IO.
Although refactoring features are already included in ADT and install sdk functionality might be appearing in ADT 11.0, you will rest of these adt-addons eclipse plugins useful to android development.
The one I use right now is adding sources to the android container in my android projects.
So Wabash is this set of ant scripts that I have been working on to support BDD and test instrumentation and some beginning MonkeyRunner stuff. The last set of steps is to switch to using the DroidDoclet the same one used by the android project.
This way I can combine different documents from child projects right in the same min-doc website along with the codeqa in a consistent manner. Plus for those projects where we might have jsdocs from webview and doxygen docs of C++ code makes it easy to incorporate that as well.
And than the final pain in the rear getting library project builds to work whereas the library project compiles first than the parent project.
Several firms including PivotalLabs have advocated choosing TDD for android development. Thus, one has to ask what have they forgot to mention is part of the android platform that will force most developers the other way?
Yes, TDD is faster if you execute the process as TDD..no that is not it. Android right now is a slightly crusted fragment platform. What is the most obvious choice to cope with that fragmentation? Let me put another way.
Do you have $1000 per month extra to pay deviceanywhere for their VirtualLab access? Show me the hands! What can act as a sieve to allow you to make the correct performance, etc choices to target a majority of android OS versions in the market in users hands?
It is these things; the android sdk emulator and some smart programming choices. Think about it, the emulator does not emulate multiple core cpus or gpus which means it perfectly mirrors the low end android device. Than by choosing BDD over TDD you are forcing yourself to examine those performance choices more closely as you will see them daily in operation as you execute all those BDD tests.
And to be blunt honest running BDD tests while coding in other areas is not that damn hard to make happen. Yes you kind of have to learn how your IDE operates so you can script some tasks, but so what?
Now lets go back to one of the first games on the G1, Replica Island. Guess what sieve they used to force them to make some performance and programming choices that happen to benefit the performance of the game? The sieve they used as the emulator and one G1 device which happen at the time to be very low end.
Now than look in the svn of ReplicaIsland you will see a game engine with very simple but powerful programming choice at its core. A modified mobile java singleton. With that and some other programming choices they got over 30fps on the G! devices.
Its not the agile process. Its going through every tool and process and asking does this tool or process fit within the constraints I have to work with. Now having stated that does an artificial sieve guarantee that you will make the right programming choices? NO, but you will see what happens if you do not right away right before your eyes as visual cues in that the application or game will run slow.