Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phonegap mobile apps and version control and updates

I have currently built an application using phone gap targeting the android and blackberry platforms.

I use a combination of Jquery mobile and Phonegap for my application, since both are open source frameworks and improvements as well as bug fixes keep happening I wanted to know what would be a good solution for alerting my users to update their application when I upgrade the above frameworks in my application.

One solution I had in mind is maintain a version numbering on my server for the apps, when the app is loaded on the users device we can make an ajax call to check for version update and then alert the user to upgrade their application.

Android market also has an auto update feature how does that work! How do I go about this what would be a good approach.

like image 234
user160108 Avatar asked Nov 04 '22 18:11

user160108


1 Answers

If you are planning to build "native", in this case localy installed apps. You don't have to worry about informing the user. As soon as you uplad the new versions to the Android market or App World the App market systems will let the users know automatically.

I think (in most cases) it is not necessary to let the user know about updates within the app. Some apps do that but I see it less often since it really does not make much sense.

But in case you want to build such a feature, I would store a version number somwhere in the code and make a server request eg. when the app starts which then compares the latest version number of your app stored on your server.

Eg.

Client:

    $.ajax({
              url: webservice_host + '&callback=?',
              dataType: 'jsonp',
              success: function (data) {
               //data -> remote version

               var local_version;
               if (local_version < data ){
                   alert("There is a newer version available");
                 }

              }

            });

Server (php in this case):

<?php

print mysql_real_escape_string($_GET['callback']). '( 1.1 )';

?>

I didn't test the code for typos etc. But this should do the trick.

like image 138
j7nn7k Avatar answered Nov 12 '22 17:11

j7nn7k