F fatman Active Member Licensed User Longtime User Apr 16, 2012 #1 Hi Folks, I have written an app for my salesmen. I have no problems downloading sqlite-tables and updating all the necessary data. But is there a way updating the app by ftp too? I have changes nearly every week. I do not want to publish the app its for internal use only. Any hints or ideas are welcome. Thanks Fatman.
Hi Folks, I have written an app for my salesmen. I have no problems downloading sqlite-tables and updating all the necessary data. But is there a way updating the app by ftp too? I have changes nearly every week. I do not want to publish the app its for internal use only. Any hints or ideas are welcome. Thanks Fatman.
Erel B4X founder Staff member Licensed User Longtime User Apr 17, 2012 #2 Yes. You can download the APK file, copy it to the storage card and then send an intent that will install it. This is the intent: Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "temp.apk")) i.SetType("application/vnd.android.package-archive") StartActivity(i) Upvote 0
Yes. You can download the APK file, copy it to the storage card and then send an intent that will install it. This is the intent: Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "temp.apk")) i.SetType("application/vnd.android.package-archive") StartActivity(i)
F fatman Active Member Licensed User Longtime User Apr 17, 2012 #3 Thanks Erel! I will try this. Fatman Upvote 0
Nickelgrass Active Member Licensed User Longtime User Nov 7, 2012 #4 Update App from http Hi, im quite new to b4a and am very interested in including an update function from my website. I thought of putting a version file next to the apk file in an folder on my website and have the app compare it with an internal version number. Does this make sense? How does one usually do this? Also I would need some more directions to downloading the new app (via simple HTTP and not FTP) and then replace the old one by installing it and then delete the temporary downloaded app. Can I simply use the HTTP client to get it and then store the responsetext as .APK file? Is there any "nicer" way to do this? Thanks a lot! Last edited: Nov 7, 2012 Upvote 0
Update App from http Hi, im quite new to b4a and am very interested in including an update function from my website. I thought of putting a version file next to the apk file in an folder on my website and have the app compare it with an internal version number. Does this make sense? How does one usually do this? Also I would need some more directions to downloading the new app (via simple HTTP and not FTP) and then replace the old one by installing it and then delete the temporary downloaded app. Can I simply use the HTTP client to get it and then store the responsetext as .APK file? Is there any "nicer" way to do this? Thanks a lot!
D DouglasNYoung Active Member Licensed User Longtime User Nov 7, 2012 #5 Nickelgrass, You can simply use HttpUtils.Download & HttpUtils.GetString 1) Holding the current version number in simple text file on your web server 2) Download this file with HttpUtils.Download 3) Read contents with HttpUtils.GetString 4) Check against installed version 5) If installed < current then 6) Download new 'apk' file with HttpUtils.Download 6) Install Douglas Upvote 0
Nickelgrass, You can simply use HttpUtils.Download & HttpUtils.GetString 1) Holding the current version number in simple text file on your web server 2) Download this file with HttpUtils.Download 3) Read contents with HttpUtils.GetString 4) Check against installed version 5) If installed < current then 6) Download new 'apk' file with HttpUtils.Download 6) Install Douglas
Nickelgrass Active Member Licensed User Longtime User Nov 9, 2012 #6 Thanks! That sounds simple enough, I will give it a try. Upvote 0
Nickelgrass Active Member Licensed User Longtime User Nov 11, 2012 #7 So far everything is working except one thing. I am using the Httprequest and initializeget to download the apk file. But the filesize I am receiving in the Response.GetString("UTF8") is not the correct size (it is ~99K instead of ~105K). When I download the file from Android browser the size is ok. What am I doing wrong. (I do not want to use the Httputils.) Thanks a lot! Upvote 0
So far everything is working except one thing. I am using the Httprequest and initializeget to download the apk file. But the filesize I am receiving in the Response.GetString("UTF8") is not the correct size (it is ~99K instead of ~105K). When I download the file from Android browser the size is ok. What am I doing wrong. (I do not want to use the Httputils.) Thanks a lot!
Erel B4X founder Staff member Licensed User Longtime User Nov 11, 2012 #8 If this is an APK file then you should not use Response.GetString. I highly recommend you to use HttpUtils2. Upvote 0
If this is an APK file then you should not use Response.GetString. I highly recommend you to use HttpUtils2.
Nickelgrass Active Member Licensed User Longtime User Nov 11, 2012 #9 Thanks for the replies! In case anyone is interested I would like to share the solution: I looked into the Httputils and simply used the same method in my app with Response.getasynchrounously. That worked fine and is simple. :sign0060: Upvote 0
Thanks for the replies! In case anyone is interested I would like to share the solution: I looked into the Httputils and simply used the same method in my app with Response.getasynchrounously. That worked fine and is simple. :sign0060:
D Dman Active Member Licensed User Longtime User Nov 11, 2012 #10 Please do! I have been working on this for about 3 hours and just can't seem to wrap my head around it. I have the apk file on my server and I THINK I am downloading it but am not sure. Last edited: Nov 11, 2012 Upvote 0
Please do! I have been working on this for about 3 hours and just can't seem to wrap my head around it. I have the apk file on my server and I THINK I am downloading it but am not sure.
Erel B4X founder Staff member Licensed User Longtime User Nov 12, 2012 #11 Why not use HttpUtils2 it will be simpler and more reliable? Upvote 0
E elck Member Licensed User Longtime User Jan 30, 2013 #12 Erel said: Yes. You can download the APK file, copy it to the storage card and then send an intent that will install it. Click to expand... I used Code: Dim b As String b=UpdateJob.GetString File.WriteString(File.DirDefaultExternal, name,b) to copy the file, but I think that here things went wrong as I should not use ASCII but Binary mode? (I get a parser error) In other words, how do I copy the file from job.getstring to the SD card? Upvote 0
Erel said: Yes. You can download the APK file, copy it to the storage card and then send an intent that will install it. Click to expand... I used Code: Dim b As String b=UpdateJob.GetString File.WriteString(File.DirDefaultExternal, name,b) to copy the file, but I think that here things went wrong as I should not use ASCII but Binary mode? (I get a parser error) In other words, how do I copy the file from job.getstring to the SD card?
Erel B4X founder Staff member Licensed User Longtime User Jan 31, 2013 #13 Job.GetString will only work with strings. Same is true for File.WriteString. Code: Dim out As OutputStream = File.OpenOutput(...) File.Copy2(Job.GetInputStream, out) out.Close Upvote 0
Job.GetString will only work with strings. Same is true for File.WriteString. Code: Dim out As OutputStream = File.OpenOutput(...) File.Copy2(Job.GetInputStream, out) out.Close
maleche Active Member Licensed User Longtime User Jan 31, 2013 #14 I use dropbox to allow others to download my apps. Upvote 0
E elck Member Licensed User Longtime User Feb 1, 2013 #15 Thanks Erel, that makes sense. Mh Dropbox, hadn't thought of that either, might be some use for that too somtimes.. Upvote 0
Thanks Erel, that makes sense. Mh Dropbox, hadn't thought of that either, might be some use for that too somtimes..
consultatech4android Member Licensed User Longtime User Feb 1, 2013 #16 Erel said: Yes. You can download the APK file, copy it to the storage card and then send an intent that will install it. This is the intent: Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "temp.apk")) i.SetType("application/vnd.android.package-archive") StartActivity(i) Click to expand... It was what I needed also Upvote 0
Erel said: Yes. You can download the APK file, copy it to the storage card and then send an intent that will install it. This is the intent: Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "temp.apk")) i.SetType("application/vnd.android.package-archive") StartActivity(i) Click to expand... It was what I needed also
G GlenAlan Member Licensed User Longtime User Jul 8, 2013 #17 Hi Nickelgrass. Did you ever share the solution to update an APK using FTP? I don't see any attachments on this thread. I'm struggling with this and would appreciate an example. Upvote 0
Hi Nickelgrass. Did you ever share the solution to update an APK using FTP? I don't see any attachments on this thread. I'm struggling with this and would appreciate an example.
Erel B4X founder Staff member Licensed User Longtime User Jul 8, 2013 #18 There are two unrelated parts to this task. First you need to download the APK to the external storage and then you need to send the intent that will install it. Which part are you struggling with? Upvote 0
There are two unrelated parts to this task. First you need to download the APK to the external storage and then you need to send the intent that will install it. Which part are you struggling with?
DonManfred Expert Licensed User Longtime User Jul 9, 2013 #19 fatman said: Hi Folks, I do not want to publish the app its for internal use only. Click to expand... You can setup an Google-Dev-Account and then you can put the App in beta-status and then you can Publish it for selected persons. But the app seems to have to be always beta i i read that correctly on googles Website. Regards, Manfred Upvote 0
fatman said: Hi Folks, I do not want to publish the app its for internal use only. Click to expand... You can setup an Google-Dev-Account and then you can put the App in beta-status and then you can Publish it for selected persons. But the app seems to have to be always beta i i read that correctly on googles Website. Regards, Manfred