Android Question Http2tools download a .apk file

Discussion in 'Android Questions' started by Tom1s, Feb 8, 2015.

  1. Tom1s

    Tom1s Member Licensed User

    Hi

    I don't want to put my program to google play just yet.

    I have made a update check to program and if update is available it could be downloaded and installed.
    Update check works nicely.
    File is not big but how to implement it? Download and callsubdelayed to start install?

    Link is api end point link so when calling or putting in chrome it would start the download.

    like this http://site.net/...DnnApiEndpoint/Api.ashx?method=Application&APIKEY
    Code:
    Dim upgrade As HttpJob
        
    Dim upgradelink As String = "http://site.net/..DnnApiEndpoint/Api.ashx?method=VERSION&apikey=apikey"
        upgrade.Initialize(
    "upgrade",Me)
        upgrade.Download(upgradelink)

    Sub JobDone(Job As HttpJob)
    If Job.Success = True Then

    ????
     
  2. DonManfred

    DonManfred Expert Licensed User

    if the return is the binarydata of the apk then you should save this in Jobdone sub.
    See httputils-samples in forum on how to save the result to a file (for ex see my signature)
     
  3. udg

    udg Expert Licensed User

    Hi Tom,

    maybe my AppUpdating lib's code could be of some help.
    I wrote it for your same reason, PlayStore independence, and made it available both in compiled and source-code form.
    So, please, feel free to use it as is or to borrow from it any code or inspiration you may deserve.

    udg
     
    Last edited: Feb 8, 2015
    Tom1s likes this.
  4. Tom1s

    Tom1s Member Licensed User

    Hi udg,
    Your code was very good and educational. I got a lot of ideas,thanks!
    One problem. I think my code would work now if the link was direclty to the file,but now i call the api and then it sends the file. Somehow it is not working..any ideas?
     
  5. DonManfred

    DonManfred Expert Licensed User

    Without seeing your code all we can do is GUESSING
     
  6. Tom1s

    Tom1s Member Licensed User

    I will guess that my apikey is wrong.o_O

    Correct. Now it is working. Thanks
     
    udg likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice