Making a background service is really easy. We just need to extend Service() class in any of our class to make it a service. Implement its method and you are done. And just one more thing, don't forget to call it from your main activity using Intent.
In this post, the JParsingInBackground class which extends Service will continuously run in background and will hit the URL and fetch JSON data every 60 sec.
MainActivity.java
package com.example.jsoninbackground;
import android.app.Activity;
import...
Calculator in Android with Source Code
This is a complete source code for a simple calculator. It is a very basic calculator for beginners in Android. It works fine but we can enter only two numbers simultaneously. It uses simple operators for addition, multiplication, division and subtraction.
My next post will be on calculator with more functionality using stack which is considered a good practice.
MainActivity.java
package com.example.calculator;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import...