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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:17:49+00:00 2026-06-11T04:17:49+00:00

I am developing a mobile app, for both Android and BlackBerry. I’ve uploaded my

  • 0

I am developing a mobile app, for both Android and BlackBerry.

I’ve uploaded my latest application for OTA installation by including version code and version name into a plain text file on the server.

Within my app, how do I convert code version and version name from the plain-text format on my server to a string. I want to do this so I can have the app compare it’s current version against what is available on the server, so that if a newer version on the server, the user will be offered an update to download.

  • 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-11T04:17:50+00:00Added an answer on June 11, 2026 at 4:17 am

    This answer is for the android part only.

    To get the app version number and name from your application, you can do the following (as suggested by @ColorWP.com

    Getting the app version and name:

    String version_number = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
    String version_name = getPackageManager().getPackageInfo(getPackageName(), 0).versionNumber;
    

    To read your file from the net:

    URL url = new URL("http://www.your.site/your.txt");
    URLConnection connect = url.openConnection();
    
    BufferedReader txtreader = new BufferedReader(new InputStreamReader(connect.getInputStream()));
    String line = txtreader.readLine();
    while (line != null) {
        /* Code to Read your variables in this loop 
          (let us assume these would be:
          server_app_version
          server_app_name)
        */
     }
    

    Make sure you add Internet permission, as suggested by @ColorWP.com

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

    Compare the version:

    if (server_app_version.compareTo(version_number) != 0 || server_app_name.compareTo(version_name) != 0){
        // Notify user to download the new version
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are developing a mobile app in Android and iPhone which has a server-side
We are developing a hybrid mobile app (code is written in HTML and runs
I am developing an android app. I have tested the app in mobile and
I m developing mobile web application for Android OS. Here, my requirement is to
I'm studying the best plataform for developing a mobile app (for Android, first) which
I'm developing a native mobile app for Android and iOS using PhoneGap.I have a
I'm developing application that would communicate with a mobile app. My problem is as
I am developing a mobile app for android, with eclipse as my platform. Whenever
We are developing a mobile application(iPhone, Android, WM) which mainly connects with the server
I'm developing a phonegap/jquery-mobile test application (I'm new in this technologies) for android and

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.