Google InApp billing library for one time purchase.
After starting project you have need to setup inapp perchase in developer console and add product. After creating product you have need to set product id in MainActivity.java line number 80 accourding to this code.