I need to get my current location using GPS programmatically. How can i achieve it?
If you are creating new location projects for Android you should use the new Google Play location services. It is much more accurate and much simpler to use.
I have been working on an open source GPS tracker project, GpsTracker, for several years. I recently updated it to handle periodic updates from Android, iOS, Windows Phone and Java ME cell phones. It is fully functional and does what you need and has the MIT License.
The Android project within GpsTracker uses the new Google Play services and there are also two server stacks (ASP.NET and PHP) to allow you to track those phones.