Ray Wenderlich has made a great tutorial explaining all of the steps involved, maybe you could check that out: http://www.raywenderlich.com/32954/how- ... 2-x-part-1
It's based on cocos2d-x but the method should be similar for other SDKs. For libGDX specific things I think the libGDX forum might be more helpful.