Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9024311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:58:32+00:00 2026-06-16T05:58:32+00:00

I need to deploy and update various enterprise applications to Android devices given to

  • 0

I need to deploy and update various enterprise applications to Android devices given to a limited number of users.

These applications are not supposed to be published on Google Play but must be distributed via a separate channel.

What I need to do is an “enterprise package manager” application to automatically check for new apps/updates and automatically trigger installation of new or updated APKs without asking user consent first.

I know that, by design, Android doesn’t allow 3rd party applications to interact with installed applications. I also know that rooted phones don’t have this problem because you can inject any APK into the device.

  • If I cook a ROM (even based on CWM) with the “enterprise package manager” installed as system application, but without su binary (it’s still an enterprise phone…), will that program be able to install new apps automatically?
  • How am I supposed to install an application without asking for consent? I mean, I need a basic code sample and permissions, if required
  • Anyway, do system apps run as root user? I remember so
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:58:35+00:00Added an answer on June 16, 2026 at 5:58 am

    If you want to check for your application which is on somewhere on your server you have to check for Update in every 24 hour once, if there is any update available then it will navigate to the async task where your updated version build will get installed

    public void checkforUpdate() {
    
            /* Get Last Update Time from Preferences */
            SharedPreferences prefs = getPreferences(0);
            lastUpdateTime = prefs.getLong("lastUpdateTime", 0);
            if ((lastUpdateTime + CommonString.timeCheckDuration) < System.currentTimeMillis() && System.currentTimeMillis()>lastUpdateTime) {
                // Asynch task
                new VersionCheckTask().execute();
            }
            else{
                // do nothing
            }
        }
    

    now it will navigate to:

    private class VersionCheckTask extends AsyncTask<Void, Void, Void> {
            ProgressDialog progressDialog;
            @Override
            protected void onPreExecute() {
                super.onPreExecute();
                try {
                    progressDialog = new ProgressDialog(Login.this, android.R.style.Theme_Holo_Light_Dialog);
                    //progressDialog.setTitle("AppName");
                    progressDialog.setMessage("Checking for updates...");
                    progressDialog.setCancelable(false);
                    progressDialog.setIndeterminate(true);
                    progressDialog.show();
                } catch (Exception e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            protected Void doInBackground(Void... params) {
                /**
                 *  Simulates a background job.
                 */
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                }
    
                HashMap<String, String> map = new HashMap<String, String>();
                map.put("build",CommonString.buildVersion);
                map.put("en", CommonString.en);
    
                responce = CommonFunction.PostRequest("updateCheck", map);
                return null;
            }
    
            @Override
            protected void onPostExecute(Void result) {
                if (progressDialog != null && progressDialog.isShowing())
                    progressDialog.dismiss();
                if(!CommonFunction.isNetworkAvailable()){
                    Toast.makeText(ClaimColonyApplication.getAppContext(), CommonString.NO_NETWORK, Toast.LENGTH_SHORT).show();
                    return;
                }
                ParseUpdateResponse(responce);
                if(rCodeUpdate == 100 && ApkLink.length() >0){
                    new AlertDialog.Builder(Login.this,android.R.style.Theme_Holo_Light_Dialog)
                    .setIcon(R.drawable.ic_launcher)
                    .setTitle("Update Available")
                    .setMessage(""+UpdateMessage)
                    .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int whichButton) {
                             //User clicked OK so do some stuff 
                            new VersionCheckTaskDialog().execute();
                        }
                    })
                    .setNegativeButton("No", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int whichButton) {
                             //User clicked Cancel 
                            finish();
                        }
                    })
                    .show();
                }else{
                    if(rCodeUpdate == 100){
                        lastUpdateTime = System.currentTimeMillis();
                        SharedPreferences.Editor editor = getPreferences(0).edit();
                        editor.putLong("lastUpdateTime", lastUpdateTime);
    
                        editor.commit();
                    }
                }
                super.onPostExecute(result);
            }
        }
    
        private class VersionCheckTaskDialog extends AsyncTask<Void, Void, Void> {
            ProgressDialog progressDialogUpdate;
            @Override
            protected void onPreExecute() {
                super.onPreExecute();
                try {
                    progressDialogUpdate = new ProgressDialog(Login.this, android.R.style.Theme_Holo_Light_Dialog);
                    //progressDialog.setTitle("AppName");
                    progressDialogUpdate.setMessage("Fetching updates...");
                    progressDialogUpdate.setCancelable(false);
                    progressDialogUpdate.setIndeterminate(true);
                    progressDialogUpdate.show();
                } catch (Exception e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            protected Void doInBackground(Void... params) {
                /**
                 *  Simulates a background job.
                 */
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                }
    
                String extStorageDirectory =    Environment.getExternalStorageDirectory().toString();
                File folder = new File(extStorageDirectory, "pdf");
                folder.mkdir();
                File file = new File(folder, "AppName."+"apk");
                try {
                        file.createNewFile();
                } catch (IOException e1) {
                        e1.printStackTrace();
                }
                /**
                 * replace url to ApkLink
                 */
                 //DownloadFile(ApkLink, file);
                 DownloadFile("URL", file);
    
                return null;
            }
    
            @Override
            protected void onPostExecute(Void result) {
                if (progressDialogUpdate != null && progressDialogUpdate.isShowing())
                    progressDialogUpdate.dismiss();
                if(!CommonFunction.isNetworkAvailable()){
                    Toast.makeText(ClaimColonyApplication.getAppContext(), CommonString.NO_NETWORK, Toast.LENGTH_SHORT).show();
                    return;
                }
                try {
                    Intent intent = new Intent(Intent.ACTION_VIEW);
                    intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/pdf/" + "AppName.apk")), "application/vnd.android.package-archive");
                    startActivity(intent);
                    lastUpdateTime = System.currentTimeMillis();
                    SharedPreferences.Editor editor = getPreferences(0).edit();
                    editor.putLong("lastUpdateTime", lastUpdateTime);
    
                    editor.commit();
                } catch (Exception e) {
                    // TODO Auto-generated catch block
                    System.out.println("Exception in start intent for launch app-------: "+e.toString());
                    e.printStackTrace();
                } 
                super.onPostExecute(result);
            }
        }
    

    I am checking for update once in 24 hours, if there is any update available then it will show pop up to upgrade your application otherwise will save your last checking time in Preferences.
    Now this will allow you to update and install your application and this will check for next update after 24 hours, you may need to work on conditions to check for update. Please change name of your .apk file and URL.

    You will need following permissions:

    <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    

    Best of luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to deploy only the referenced classes in a very limited environment as
Tipically a deploy in production does not involve just a mere source code update
We typically deploy our software applications to our clients using Subversion (svn update on
I need to deploy a STS and an ASP.NET RP for several clients, all
I need to deploy an application onto some Windows machines for purposes of data
I need to deploy a set of configuration files to a hundred or more
I need to deploy a Windows Forms application using ClickOnce deployment. (VS2008, .NET 3.5)
I Need to deploy a web application on Stratos server. I went through this
I have an WCF RESTFull Service which i need to deploy on IIS6. I
I have an old .net 2.0 windows app I need to deploy on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.