checking and Installing new update if internet connection available

Thread is closed for posting
2 posts, 0 answers
  1. Ashfaq
    Ashfaq avatar
    1 posts
    Member since:
    Feb 2015

    Posted 14 Feb 2015 Link to this post

    Dear friends,
    I have an application to display some details in the main activity all i want to do is check for update in play store and if there is update application automatically.Please help me to do so since im new in android.
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.view.animation.AnimationUtils;
    import android.widget.Button;
    import android.widget.ImageView;
    import android.widget.Toast;

    public class Ongoing extends Fragment {
    // flag for Internet connection status
        Boolean isInternetPresent = false;
        // Connection detector class
        ConnectionDetector cd;
    public Ongoing(){}

        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
    getActivity().setTitle("Ongoing Projects");
            View rootView = inflater.inflate(R.layout.ongoing_frag, container, false);
            cd = new ConnectionDetector(getActivity()); 
            isInternetPresent = cd.isConnectingToInternet();
            if (isInternetPresent) {
                // Internet Connection is Present
                // make HTTP requests
            Toast.makeText(getActivity(), "You have Internet", Toast.LENGTH_SHORT).show();
            } else {
                // Internet connection is not present
                // Ask user to connect to Internet
            Toast.makeText(getActivity(), "You dont Internet", Toast.LENGTH_SHORT).show();
            return rootView;


  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 18 Feb 2015 Link to this post

    Hello Ashfaq,

    If you are building a hybrid app, then you will need a plugin for this task. If this code is from a custom plugin you are building, I would suggest posting your query on the Android developer forums.

    If you are looking for a general approach to updating your hybrid application from within Google Play, then you can define a service that regularly checks for updates of your app and when a new update is detected, prompts the user to install it. You can use the Market Cordova plugin to open Google Play or AppStore from within your application.

    Tina Stancheva

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top