I came across few sample android socket code where they had created 2 threads like
I don't know what those apps did, but in your case the server isn't even in Java, much less running on the same machine as the client, so there'll be no thread in the JVM for it.
But I have written the client socket in Java to read the data from server.
What do you mean, "but"? If you already have the client code, then all is well from the networking perspective, no?
I need to plot a graph in the view with the data and test in emulator. So I was wondering how should I incorporate the above written code in the view and plot the graph.
Plotting data is a wholly different issue than client/server communication, and
you should start a new topic about this. Let this topic be about how you can receive all data you need from the server. Once you have that working, start worrying about how to display it. If you mix both you'll just end up confusing yourself.