package com.hands;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
As the logcat explains, you are getting a NullPointerException when you call the method getDirectionData(). This method is not shown in the code above. Can you add this method so we can see what the problem is?
Edit: Thanks for adding your getDirectionData() method. Its still not clear where the problem is but one issue is the fact that you have an empty catch block - this will swallow exceptions and then you carry on processing code. For example, if the line
doc = db.parse(urlConnection.getInputStream());
throws an exception or returns null, then you try to get the NodeList from a null object - this would give you your null pointer exception. I recommend putting a breakpoint at the start of this method and stepping through it, examining the variables as you go. This will identify the source of the problem.