B4A Library AppUpdating - automate apps updating from a webserver

Status
Not open for further replies.
Important note: since all the changes made to the Android OS the original code is to be considered outdated. Thanks to @Yayou49 you may find at post#290 a version of the class usable on Android 6+ versions.

Note: version 1.25 breaks existing code so, please, read changelog in post #60 below.


Hi all,

this is my first contributing lib to this great NG.
How do I dare to publish such a low-grade stuff in an area where generally you may find real masterpieces of programming? Well, to be honest, I hope in your help to upgrade my work to a status of "ready-made solution" for those who prefer to run their own webservers where to publish apps.
Secondly, I was asked (both privately and publicly) to overcome my legitimate embarassment and go on with the publication. So, here we are: AppUpdating 1.18!

Note: any valid code fragment comes from some other thread, while all the bad stuff is entirely mine ;-)

Please find attached both the library as is (yes, it works out of the box) and its source code.

On a following post I'm gonna describe the lib in greater detail and show how to use it.

Umberto

AppUpdating version history

* version 1.30 (read notes on post #228)
  • compiled with okHttp 1.01 and okHttpUtils 2.20
  • removed files for version 1.25

* version 1.26 (read notes on post #84)
  • added property WebChangeLog to read optional app's version changelog data
  • better management of versioning in the info file
  • removed files for version 1.18 to avoid confusion (still available on request)
* version 1.25
* version 1.18
  • initial release
 

Attachments

  • AppUpdating_126_ex.zip
    28.3 KB · Views: 1,195
  • AppUpdating_126.zip
    11.3 KB · Views: 1,259
  • AppUpdating_126_src.zip
    10.8 KB · Views: 1,014
  • AppUpdating_130.zip
    11.4 KB · Views: 1,229
  • AppUpdating_130_src.zip
    15.7 KB · Views: 1,144
  • AppUpdating_130_ex.zip
    33.4 KB · Views: 1,353
Last edited:

udg

Expert
Licensed User
Longtime User
Hi gruizelgruis,
nice suggestion! As soon as I'll be back from my vacation I'll take care of it.

Hi ruy,

version 1.26 is the most recent one using the standard httputils library, while version 1.27 makes use of the LFD (large file download) version of it from Erel.
Which methods are you missing?

udg
 

nibbo

Active Member
Licensed User
Longtime User
Eeeek,
Not sure what happened but when I tried to use this, the next time tried to load my project it said unable to load file key not found in dictionary.
I have now LOST loads of code, the main activity is the default one and all of my code in this activity has gone...!
 

DonManfred

Expert
Licensed User
Longtime User
Does not sound like an bug in this library! Does sound more like an problem with the B4A IDE or Java-Setup OR OR OR...
 

nibbo

Active Member
Licensed User
Longtime User
You may well be right but either way it looks a bit terminal.
The error message is below, does anyone know if this is recoverable?
I have a copy of the project from a couple of days ago but that means losing a lot of changes.
Thanks
Capture.PNG
 

nibbo

Active Member
Licensed User
Longtime User
I did look at it in notepad and as far as I can tell it looks intact; not that I really know what to look for.
I manually removed the changes put in for the app updates but still the same error.
Before I upload any files (they contain a lot of 'secret stuff') I will compare it with my old version and see if I can spot anything obvious.
Thanks
 

nibbo

Active Member
Licensed User
Longtime User
Well, I could not find anything obvious so have restored back to my old version.
I was able to compare the directories and quickly get back up to speed.
I need to make some more important changes right now so will complete those first, then take a secure copy and try to add the auto updater later on.
Will post back and let you know how it goes but could be a week or so...

Thanks for all the replies.
 

MbedAndroid

Well-Known Member
Licensed User
Longtime User
thanks for this wunderful lib.
I noticed that the lib doesnt check the out of range wifi or no wifi switched on. is there a way to detect wifi available, before entering the code?
 

udg

Expert
Licensed User
Longtime User
Hi all.

Firstly let me thank @DonManfred who is always helpful and keeps an eye on this thread more than I do.

@MbedAndroid : as already suggested, look for a library that lets you check whether wifi (or any other useful connection) is available and use that before calling the code in AppUpdating.

@nibbo : did you try the lib again? Any news?

@gruizelgruis : I still owe you the modified lib. Did you try the suggested code yourself in the meantime?

I recently read about a new version of Erel's http lib, so I guess the next release of AppUpdating will be based on it.

udg
 

MbedAndroid

Well-Known Member
Licensed User
Longtime User
yes thanks, i inserted already a few lines, that helps.
Somehow the download doesnt work all the time, will figure it out what cause the problem. Could also be a server problem. Otherwise i will dump the report to file to check
 

nibbo

Active Member
Licensed User
Longtime User
Hi all.

@nibbo : did you try the lib again? Any news?

udg

I have not tried this again yet... as I need to make some major amendments to my app.
I will revisit this soon but it will probably not be before October now.
Will post back here to let you all know if successful or if I encounter the same errors as before.
I am sure it was probably something I did...
There was a bit of confusion around the http2 service etc... but I cannot remember exactly what happened; will take notes next time.
Many thanks
 

nibbo

Active Member
Licensed User
Longtime User
OK, I tried this again and it seemed to work OK.
However, when I reloaded my project after exiting it something very strange happened.
The project would not compile due to 'Too many parameters' supplied to the HttpJob.PostData method.
I am guessing that this is due to the AppUpdater being pre-compiled with a different version of the Http2Utils service?
Not entirely sure but just a heads up if you have a project that uses Http2Utils then you may encounter similar problems to this.
 

udg

Expert
Licensed User
Longtime User
Hi nibbo,

may post#7 be related to your problem?
 

MarcoRome

Expert
Licensed User
Longtime User
Hi all.
One question Udg.
This library was compiled with the new version 2.01 of HttpUtils ( okHttp ) ?
Look OkHttp
Thank you
Marco
 

udg

Expert
Licensed User
Longtime User
Hi Marco,
the version currently published is compiled with the Httputils2's release available BEFORE okHttp introduction.
I'm planning a newer version as soon as I have some spare time.
Thank you for your interest in AppUpdating lib.

udg
 

MarcoRome

Expert
Licensed User
Longtime User
I try without okHttp and all work without problem ( AppUpdating 1.26 )

But i need this combination ( okHttp + HttpUtils 2.10 Library )

If you add okHttp + "Module" HttpUtils2Service + HttpJob you have error

B4X:
"HttpUtils2Service is declared twice. You should either remove the library reference or the code module."
 

MarcoRome

Expert
Licensed User
Longtime User
Hi Marco,
the version currently published is compiled with the Httputils2's release available BEFORE okHttp introduction.
I'm planning a newer version as soon as I have some spare time.
Thank you for your interest in AppUpdating lib.

udg
Don worry Udg all work read #139 and thank you for this fantastic library
 
Status
Not open for further replies.
Top