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 8097133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:39:47+00:00 2026-06-05T21:39:47+00:00

I have been trying to implement an upgrade plan for my Android app which

  • 0

I have been trying to implement an upgrade plan for my Android app which will not be released on the Android market.

The designed application work flow is as follows:

  1. User is validated at login and the main menu activity is launched.
  2. A request is sent from the main menu activity to my website for
    latest version code value (Stor in an SQL database on the server).
  3. The returned version code value is compared against the version code
    value of the apk installed on the device.
  4. If the returned version code value is different, then the new apk file which is located on
    the server is downloaded and installed.

It is also important to make sure that the following tasks have been completed before the upgrade work flow will work.

  1. The new version of the apk must be compiled singed for release with an updated versionCode value
  2. The value stored in the website database for the versionCode value must be updated
  3. The newly compiled apk file must be uploaded to the correct location on the web server

I have implemented the first 3 stages of my work flow but when I try to implement the 4th part I end up getting the “Parse Error: There is an issue parsing the package” error.

Below is the offending code:

protected void upgradeApplication() {
    StringBuilder urlBuilder = new StringBuilder(getString(R.string.website_ip) + "/" + getString(R.string.application_middleware) + "/" + getString(R.string.apk_folder) + "/"); 

    File file = new File(urlBuilder.toString(), getString(R.string.apk_file));

    Intent intent = new Intent(Intent.ACTION_VIEW);

    intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");

    startActivity(intent);
}

I have tested that the apk will install correctly by downloading the apk directly though the devices web browser and installing it from the downloads folder. But when I try to install from within the application I get the posted error.

“Parse Error: There is aproblem parsing the package”

Any help would be appreciated

  • 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-05T21:39:49+00:00Added an answer on June 5, 2026 at 9:39 pm

    If with this line

    File file = new File(urlBuilder.toString(), getString(R.string.apk_file));
    

    you’re trying to download the file by passing the url as an argument, then it won’t work. The File constructor cannot download a file.

    You should use an AsyncTask to download the apk, wait before it’s done then only you can install it.

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

Sidebar

Related Questions

Good Evening, I have been trying to implement a simple Android(tm) application that utilizes
I have been trying to implement a small SERVER - CLIENT app but ran
I have been trying to implement a comment engine in my app (UItableView) but
I have been trying to implement the camera into my application following this tutorial
I have been trying this for so long, but was not able to implement
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
I have been trying to implement an efficient string comparing algorithm that will given
I have been trying to implement a box blur algorithm in android. The code
Hello guys, I have been trying to implement the DSUM function but failed to
Im trying to implement an Observer/Observable pattern on an EC2 instance. I have been

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.