Wednesday, July 18, 2012

Android Development Tools plugin for eclipse conflicting dependancy issue

When you are trying to install Android Development Tools (ADT) plugin for eclipse you might face with an error like "Cannot complete the install because of a conflicting dependency".

You can rectify this issue first by trying to run Check for updates in eclipse (above image). Most probably you will get a list of components needing update. Try to update each listed module one by one. After each successful update try to install ADT plugin again until you can successfully install it. For example, after successful update of "Eclipse IDE for Java Developers" I was able to install ADT plugin. The update process fixes the conflict dependency.

Sunday, July 15, 2012

Scrum, a new hope!

A long time ago in this universe not far away....
 A new hope!
 It’s the period of customer unrest. Most of the time development team is behind schedule. Product management department nagging all the time. Sales department promote a feature and promises on time release without development team having even the slightest clue what is the feature....

 Our company’s main methodology for software development is RUP.

 The whole thing started when a former colleague paid a visit. In our discussion he pointed out that they are developing based on Scrum. That was the start of the whole thing. Maybe that's the path to salvation for us! Salvation from what? Well, our customers were not satisfied by the way we delivered the change requests. The reason for that was, most of the new features were developed and delivered in one big iteration of 6 month to 1 year after the user had initiated the change request.
Although that delivery was a big release with many features but it was quite late. Time to market was the big issue. A very important factor fostering this late delivery was complication and the scope of the requested feature. Most of the time we miss calculate the actual time needed for the development. This miss calculation was the key for late delivery.

Common understanding can mitigate the risks involved in the production. Although we could have continued with RUP and tried to go through the elaboration phase more accurately but we decided to move to Scrum for the reasons I'm going to discuss.

We are now in our second sprint. Well, if I want to give you a summary of what we experienced in our first sprint I should say we failed to break down each user story into small tasks with maximum 16 hours per task allocation. We had tasks of about 40 hours. This was an indication that this task was composed of many smaller tasks and we should have broken it down. The burn down chart always showed us the deviation which was not acceptable.

There were also some positive result as well. For example, we collaborated with one another more often. Communication between team members flourished. And the last thing that we enjoyed was pair programming. By programming in pairs we shared our knowledge, we were more active and somehow we almost doubled our speed in some areas.

Overall, for the first sprint it was quite good experience.

If I want to conclude I should say there is much less stress in our team. We have high level of collaboration. By looking at the story board we can instantly know the state of the project. In our daily standup's everybody know about the state of each task. If there a complication in each task people can share and seek help. By this way, we can avoid move on faster.  Burn down chart represent how much work is left and how well we are progressing.


Wednesday, July 11, 2012

Location Finder - My first experience with Android

I started my career as a Java EE developer. Recently, my attention was drawn to the domain of hand-held devices. That was intriguing for me . Well, being a Java developer Android was a fine choice. 
I began by:
  • Learning the basics
  • Developing a project with Android
    • Define the boundaries of the project
    • Code and test
After spending some time on the basics I decided to get my hands dirty. My project is called Location Finder.

  • Pinpointing all the points of interest in a radius given by the user on a map. Point of interest could be a specific keyword such as restaurant or a more broad one such as food which might include restaurants, confectioneries or etc.
  • All points of interest should be clickable. After clicking the overlaid icons, name and address of the place must be shown in a dialog box to the user.
So, my choice was a program capable of advising a user of nearest point of interest.

For this project I used 2 API's from Google. Google Map, Google Places and of course GPS on the device. There are so many good tutorials on how to integrate Google map into your code so I'm not going to delve in to that. I think this is sufficient to say that you have to sign up with the service and include a key in your View in order to use Google map services. That key is given by Google.

Business process is demonstrated below:
Diagram 1-Location finder activity diagram
  The diagram is created by Violet uml editor.

MainController class loads my main layout. It incorporates a very simple UI with one EditText,  a SeekBar and 2 TextViews acting as labels. Finally we have 2 Buttons (Find and Cancel). The design is depicted in the class diagram.

Diagram 2-Location finder class diagram

When the find button is clicked an Intent triggers the onCreate method of GMapActivity. The detail can be followed on the diagram 3 which is one possible sequence diagram of this application.
Diagram 3-Location finder sequence diagram

Source Code:

Monday, July 9, 2012

Android, emulator control is disabled under devices section of Dalvik Debug Monitor Server (DDMS) in eclipse

Problem :
Sometimes you can't communicate with your running emulator  although its up and running. There is nothing listed under "Devices" section of the DDMS view in eclipse. The "Location controls" section under Emulator control is also disabled. 

Why you need that ? For example, you want to have your location using GPS on your emulator. That can be achieved by simulating GPS coordinates using DDMS view > Emulator Control > Location Controls. There you can assign longitude and latitude.

Try listing your running processes on your computer. On Mac you can use "Activity monitor". There you can find a process named "adb" (Android debug bridge). When you find it, kill the process and watch your eclipse console output for following message:

[2012-07-09 19:16:16 - DeviceMonitor] Connection attempts: 1

After few attempts you should have your connection to the emulator back. There should be an emulator listed under devices sections automatically.

Tuesday, July 3, 2012

A complication with embedding Axis2 in a webapp

There was a need to develop a web service in our web project in order to make it interoperable with other system specially written in languages other than Java. We had number of options to choose from such as Metro which is part of GlashFish Community and Axis2 which is from The Apache Software Foundation.
We carried out a memory test. We developed a class with a method returning a byte[10000000] worth of data. Then exposing them with both Metro and Axis2. Our web service clients called the services in a loop of 100 with Thread.Sleep(1000) in between of each call. With the aid of VisualVM which offers JVM profiling and monitoring we monitored the memory usage and garbage collection. Both services were used just out of the box (without any additional configuration and tuning). They were almost the same in terms of memory usage. Annotation is the beauty of Metro. If you have your class then your are 2 steps from making your class act as a service. First annotate the class with @WebService and second annotate a method with @WebMethod. That's All. Isn't it easy!
 Here is a simple guide Building a simple Metro application you can give it a try.

With regard to ease of use, Axis2 was a bit problematic. I'm going to explain more on the problem and the approach I took to solve it.

The problem:

When my class was ready, I added axis2 Servlet to web.xml. Then,  exposing the class by adding service.xml to the folder hierarchy under WEB-INF as:

 service.xml defines the the description of the service. At the final step, I tried to add all the necessary jar files to the classpath of the server. Everything seemed ok but the service was not deployed. There was no error in the logs. I checked my service by trying to checkout the WSDL on the browser. The response was an error indicating "No service is available at this URL" or "The service cannot be found for the endpoint reference (EPR) " without any further clue or any other exceptions on the server.

The solution:

 axis2-web is a "collection of JSPs that make up the Axis2 administration application "

I tried to list my service by using axis2-web at the address below by deploying the application in my Servlet engine.


After calling the address above I found out there is a missing class causing malfunction. Although nothing was in the log files indicating ClassNotFoundException