0

I am a web developer and am new to mobile application development. I am using PhoneGap.

I have successfully created an application however when I make the changes in the html, css & js files and generate new apk file it asks me to re-install the application on my phone. I don't want that to happen; I want the updates or the new changes to be downloaded. How can I achieve this using either eclipse or phonegap?

I went through this link How to make your Android app auto update and now am confused if the application gets updated through Google PlayStore only. And in other cases you need to re-install them.

Thanks for your time.

Thanks,

Utpal

Community
  • 1
  • 1
Utpal - Ur Best Pal
  • 4,472
  • 3
  • 17
  • 28
  • changes in your html or css or js never ask re-install...this occur may be change your debug key or change in your development environment(means your system) – Aravin Sep 19 '14 at 14:39
  • Hi Aravin, once I make the changes I regenerate the apk after running the "cordova build" command in CLI. Let me know if I am doing something wrong. Thanks.. – Utpal - Ur Best Pal Sep 19 '14 at 17:51
  • i think regeneration of apk cant ask re-install...are you using eclipse for generate apk build.. – Aravin Sep 20 '14 at 04:28
  • yes I am using eclipse to generate the apk. – Utpal - Ur Best Pal Sep 20 '14 at 06:08
  • check this one http://stackoverflow.com/questions/17289430/eclipse-no-debug-keystore when this debug key change then only it asks reinstall and one more is when initially develop in one computer and import that into another machine the it asks re-install...otherwise it never asks reinstall.. – Aravin Sep 20 '14 at 09:03
  • thanks for the link Aravin will try it out.. – Utpal - Ur Best Pal Sep 22 '14 at 09:39
  • I tried modifying the version of the application to see if that helps to install the updates. I referred to this post http://stackoverflow.com/questions/8157128/phonegap-android-app-alter-version-number however when I run the "cordova build" in CLI it changes the version to original overriding the custom version. Any help will be highly appreciated. – Utpal - Ur Best Pal Sep 30 '14 at 13:46
  • i cant get you clearly..! – Aravin Sep 30 '14 at 14:12
  • I read somewhere that the application version requires to be changed in order to update the application. To do so I went into my /*application folder*/platforms/android/ in AndroidManifest.xml & edited the android:versionCode & android:versionName to a higher number. However after doing so when I re-build the app using "cordova build" in CLI; the default version number is restored. So am I doing the right thing by updating the version number? or is there any other method to do so using CLI – Utpal - Ur Best Pal Oct 01 '14 at 10:54
  • Yes you are doing right for android(i am also doing the same but i am using eclipse)..please go through this another way http://docs.phonegap.com/en/3.5.0/config_ref_index.md.html ( i am not clear about this) – Aravin Oct 01 '14 at 11:00
  • Thanks for the link; is there any comprehensive tutorial or book available to learn all the elements of phonegap 3.5 since it has a lots of learning curve & their doc is not as detailed as required. :( – Utpal - Ur Best Pal Oct 01 '14 at 12:05
  • i think there is no tutorial in internet i donno about books..you can use stackoverflow and phonegap community https://groups.google.com/forum/#!forum/phonegap for help.. – Aravin Oct 01 '14 at 12:09
  • I have now updated to Cordova 3.6 and the version is specified in the config.xml itself. When I download the updated apk file with a newer version and run it shows me the following message: The application that you are installing will replace another application. All previous user data will be saved. Does this mean it's updating and not overriding the previous version? Thanks – Utpal - Ur Best Pal Oct 04 '14 at 14:20
  • Your app will be updated all the data will be available from previuos app.And also current data`s are also included. – Aravin Oct 06 '14 at 08:17
  • 1
    Thanks Aravin :) So finally made it through this issue.. :D – Utpal - Ur Best Pal Oct 06 '14 at 16:08

1 Answers1

0

Got the solution for the above problem for cordova 3.6. Following are the steps:

1) Open the config.xml in your application folder "your-app-name/config.xml"

2) Find this line

<widget id="com.example.nightinglow" version="0.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

3) Change the version="0.0.2" to the desired version

4) Save the file

5) Run cordova build using CLI

Now when download the .apk file and run installation you see this message The application that you are installing will replace another application. All previous user data will be saved. This means that it saves the old data along with new updates.

Note: Tested only on android; not too sure about the iOS and Windows platform.

Hope this helps.

Thanks,

Utpal

Credits to https://stackoverflow.com/users/2541473/aravin for brainstorming it with me.

Community
  • 1
  • 1
Utpal - Ur Best Pal
  • 4,472
  • 3
  • 17
  • 28