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

  • SEARCH
  • Home
  • 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 6560835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:30:45+00:00 2026-05-25T13:30:45+00:00

Download file already success but when install it has an error application-not-installed I already

  • 0

Download file already success but when install it has an error “application-not-installed”
I already use INSTALL_NON_MARKET_APPS permission
Install prompt already there but everytime I tried , it’s always “application-not-installed” error.

public void Update(String apkurl){
    try {
          URL url = new URL(apkurl); 
          HttpURLConnection c = (HttpURLConnection) url.openConnection();
          c.setRequestMethod("GET");
          c.setDoOutput(true);
          try{
          c.connect();
          } catch (Exception e) {
              Toast.makeText(getApplicationContext(),e.getMessage() , Toast.LENGTH_LONG).show();
          }
          String PATH = Environment.getExternalStorageDirectory() + "/download/";
          File file = new File(PATH);
          file.mkdirs();
          File outputFile = new File(file, "prov1.apk");
          FileOutputStream fos = new FileOutputStream(outputFile);

          InputStream is = c.getInputStream();

          byte[] buffer = new byte[1024];
          int len1 = 0; 
          while ((len1 = is.read(buffer)) != -1) {
              fos.write(buffer, 0, len1);
          } 
          fos.close();
          is.close();//till here, it works fine - .apk is download to my sdcard in download file

          Intent intent = new Intent(Intent.ACTION_VIEW);  
          intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

          intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "prov1.apk")), "application/vnd.android.package-archive");

          startActivity(intent);   

      } catch (IOException e) {
          Toast.makeText(getApplicationContext(), "Update error!", Toast.LENGTH_LONG).show();
      }
}  

I already read another question about this topic but still stuck. I am really thank for your help.

  • 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-05-25T13:30:46+00:00Added an answer on May 25, 2026 at 1:30 pm

    One of the problems it could be that you already have some app with the same package name.
    For example if you try to install com.something.prov1 the same package it might already exist. if that is the case than first uninstall the app

    adb uninstall com.something.prov1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a link <a id=DownloadLink href='controller/action' target=_blank>Download File</a> that has to open a
I created a file download script in PHP, it works, but web browsers report
i want to download a file from a remote server. i already tried fopen
I want script to download xml file from ftp, already written small script for
My program download a.sqlite3 file in server and b.sqlite3 file is already in local
I need to download file from FTP server and make some changes on it
I cannot download file using java if the url contains special characters. eg:-http://something.com/something/this+this+this.html http://something.com/something/this%20this%20this.html
I hope to display the download file size by reading http header. I know
How do I download a file from the internet in a Flex based AIR
I want to download a file and need to check the response status code

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.