Is there any way to connect smart phone and PC for java programming.i mean can i code same project using smart phone and PC?
Do not know If I understand your question. But this link should be helpful. It is focused on Using Hardware Devices in context of Android development.
http://developer.android.com/tools/device.html
Next time, give greater care when you create the question.