I want to post JSON string with HttpURLConnection api to the localhost server(WAMP) periodically every 60 seconds to be inserted in the database. Therefore, I am executing MyAs
You can create Service for your purpose and for every 60 seconds, you need not use Alarm Manager. Because Service is providing intent filter functionality to call service after every Minute.
for that you have to write following code when you will register your service:
ServiceDemo serviceDemo = new ServiceDemo();
IntentFilter s_intentFilter = new IntentFilter();
s_intentFilter.addAction(Intent.ACTION_TIME_TICK);
s_intentFilter.addAction(Intent.ACTION_TIME_CHANGED);
registerReceiver(serviceDemo , s_intentFilter);
Service will execute after every 60 seconds using this code.