NOTE:

NOTE: Of late, I have been getting requests for very trivial problems that many of you are facing in your day-to-day work. This blog is not to solve your "project" problems - surely not a "Support" site.
I just love to share my knowledge in my spare time and would appreciate any questions or feedback on the articles and code I have shared. I also do appreciate thought-provoking questions that would lead me to write more articles and share.
But please do not put your day-to-day trivial problems here. Even if you do, you most probably would not get a response here.
Thanks

Search This Blog

x

Monday, 30 July 2012

Android and its Fragmentation


Android has been making rapid strides into the Mobile market and has become a serious contender for the top 1 position in the mobile market (and is picking up on the tablet market quite quickly).

The fact that it was anopen platform allowing for lot of innovation and choice made the developer world and the mobile OEMs vouch for it and the inroads it madeinto the market was significant – significant enough for Apple to stand up, take note and even file a law suit J

However, this very fact is now slowly turning to be a bane for the Android platform, as it has led to a huge amount of fragmentation in the market. OpenSignalMaps has done a research in 195 countries and has come up with the graphic that clearly depicts the kind of fragmentation in Android devices.

Samsung has clearly take a lion share of the market followed by HTC, Sony Ericcson and Motorola. An interesting fact is that they have spotted 3997 distinct devices!

This very fact has brought down the euphoria around Android. Another study by Appcelerator and International Data Corporation (IDC) says:

The most significant finding in the Q2 2012 Developer Survey is Apple opening a dramatic 16% lead over Google’s Android as far as which OS will win in the enterprise marketplace, with 53.2% of developers saying iOS will win vs. 37.5% saying Android will win. This is a very significant change over only three quarters: in Q3 2011, developers viewed iOS and Android in a dead heat at 44% each.
The challenges of this fragmentation are around the varied screen sizes and the many OS versions which translate to the larger effort and investment into testing on the varied combinations to keep all customers happy.
A graphic that illustrates the varied resolutions:
and the number of device models:

The above statistics sound a bit unsettling around the fragmentation aspects of Android and would probably scare away developers from investing on this platform!
But in my opinion, this is no different from the fragmentation on PC (probably better than that) where the browsers, the CPU powers, the models etc. are varied and still we have lot of gaming apps that are developed for all of them.
Probably the good news is that Android right from the beginning is learning its lessons quickly and it introduced the concept of “fragments” to scale to varied screen sizes and designs.
Android is just going through the stabilization phase of a open platform and the good news from the same study by Appelerator and IDC says:
Android has arrested its decline in developer interest. After a noticeable erosion of developer interest over the last year, developers’ Android handset “very interested” levels stabilized in Q2 2012 compared to Q1 2012, and Android tablet “very interested” levels ticked up 2.9%.

So, in my opinion, Android with all its challenges is just grown over the hype cycle and is here to stay as a strong contender to other mobile OSes and would probably win the race. However, right from the beginning, developers have to keep these variations in mind and build apps that look as seamless as possible on multiple OSes.
And testers, if you are reading, here is your chance... A lot of opportunities around device coverage, OS version coverage, screen size coverage and so on.




Thursday, 19 April 2012

Android - Code Coverage - Unit Testing

This is a very small post for all those who have been strugling to generate the Android Test Coverage Using the ant scripts give by android sdk itself.


I am assuming that you have created one project containing the actual source code to be tested - assume it is called "MyProject" and you have created another test project that tests MyProject, that is named MyProjectTest.


Then, you have written jUnit tests using the inherent testing support framework with android. Now, you have run your unit tests and they run successfully in ecplise. You then, what to check on the code coverage of these unit tests. Here are the steps for the same:



  •    At the command prompt, change directory to the MyProject folder
  •    Rename the existing build.xml to build_orig.xml
  •    Run this command:
android update project -p . (including the last dot)
  •    Then change directory to cd ..\MyProjectTest
  •    Rename the existing build.xml to build_orig.xml
  •    Run this command:
android update test-project -m D:/..../source/MyProject -p .  (including the last dot and where you give your complete path to the MyProject folder after -m)
  •    Then, run the  command -
ant emma debug install test
This should generate a html report of the coverage under MyProjectTest/coverage


Troubleshooting:

  •    Incase you get an error "remote object coverage.ec does not exist" then start adb shell in another command prompt - in order to give write permissions to the sdcard for writing the coverage.ec file
  •    Then, run the following command at the shell
mount -o remount rw /sdcard
  •    Then you should be able to generate the report.