Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Auto Update for APK, NOT using Play Store

Author
Message
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 10th Jan 2020 00:41
Hey Guys

I've done a fair amount of APP's for android and HTML 5 the past 4 years for the company Educational department.
These APP's get distributed from a Website to Parents/Kids and I don't use Google Play Services at all, and only meant for Parents and Kids enrolled in the school.

What will be the best and easiest way to implement Auto Update for Android APP's. The HTML5 is ok, cause the latest version will always be loaded.
But instead of sending 100dreds of messages about a new Android APP upgrade, I want to add this feature to all my app's... (Currently about 300+)

Any suggestions?

Thanks, Danny
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Jan 2020 01:17 Edited at: 10th Jan 2020 01:18
For you to install things outside the playstore the device will need to be set to allow install from unknown sources
Settings/Security/Unknown sources

You could get your app to check your website and if there is an update you could;
1. Get the url of the gDrive (Or other location) .apk file
2. Then app would then use OpenBrowser(url) which should then ask them to install the .apk

There would be a few steps but you could explain those in a "You have an update" type screen

I have tried this process via my email and it works
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 10th Jan 2020 01:31
Thanks Blink0K, as always, a life saver

Most parents know about the "unknown sources setting", so that shouldn't be a problem.

I was think about something simular, to download a TXT file with Ver number, and compare to "old"ver number and then ask to download.

Just thought there was another way.. I have the tendency of always using the most difficult way hahahahaha

Appreciate...

DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 10th Jan 2020 02:21
Hey Blink0k

Every work fine now, got the version number and compare, but for some reason it will only download the APK and do nothing afterwards.
How to I "force" install the APK from my APP
It only download the apk and put in my APP folder


I can find a Run("asdfasdf.apk") or something simular
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Jan 2020 02:54
Ok. I just tried it with my Sony Experia L1 (Gdrive link)

When i use OpenBrowser(url)
First it comes up with;


Then;


Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Jan 2020 03:10
Some things to try;
1. Find the downloaded file in your file manager and long press the file, see what happens
2. If you can locate the file then maybe try ShareFile(filename). Don't forget to add raw: at the beginning of the file
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 10th Jan 2020 06:29
I've got this going, and the file download 100%

Sharefile only open APP's to share, still no "install"
Try it on 2 different andoid devices



blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Jan 2020 06:50 Edited at: 10th Jan 2020 07:02
Try this, it should download and install one of my apps

I have tried this on a Samsung GalaxyTab and my Sony phone. Both work. Are you sure you have set your "Unknown sources" option?

When asked which app to open it with chose Firefox (Which i have installed)

When i use the standard browser it downloads it and i get a notification (Drag down from the top of the device). Then i tap on that and it installs

DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 10th Jan 2020 09:44 Edited at: 10th Jan 2020 10:00
Hi Blink0K

Yes, Download , similar how y APP download. But I would like the APK automatically be installed after the download.

The reason I use this to download


Is to be update the version file on successful download, and my APP progressbar to show progress
It download 100%, and put the downloaded file in the APP/Media folder.
I would just like to "Install" the APK then from that folder


Thanks Mate
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 10th Jan 2020 10:08
Here some some screenshot of the almost working APP

Notify about new File available



Download the file 100% OK



This is the path it save the download APK


For here I would like to access the file from my APP and "auto Install" the APK

Possible??

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Jan 2020 10:22
The app is never going to be automatically updated. The user will always have to authorize the install
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 10th Jan 2020 11:00
THanks Blink0K
I'll use your suggestion, and look at a different way to detect if the new app run or Not

Thanks you very much
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Jan 2020 21:19
Is there a reason you don't want to use google play?
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 11th Jan 2020 01:04
@Blink0k

Yes, We don't have access to google Play in China. Only if you use a VPN which is illegal in China. Only registered businesses with the goverment have special access to VPN.
Although lot of people use VPN, goverment every now and then check on People for usage. They arrest monthly people selling VPN.

Secondly, these APP's are custom written only for the Compnay I worked for, for their schools and parents.

They do have their own type of Google Play services, Like Baide , etc... but also as a Foreigner to gain access to that is also hard to get.
Took me almost 5 months just to get my own testing server in China, and can only be used with IP address, and no domain name.
The company website, took 4 months to register with hundreds of documents to be send to the goverment, and very very very very very expensive

Rules regarding this is vey strict in Mainland of China.

But the biggest is the fact that the company only want to give access to the APP's for their parents and children, cause everything is custom for their educational curriculum.

If you only run on the China Telecom/China Mobile or China Unicom (3 ISP's) , you can't access 95% of the outside world websites. Youtube, NEtflix, Google etc...
Even Thegamecreators.com can't be directly access without V*N all is restricted.
Some replacements

Google = Baide
Youtube = Youku
taobao/Tmail/JD = Ebay
to name a few
Cherio





blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Jan 2020 03:03
That's unfortunate matey. Good luck with your efforts
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 11th Jan 2020 21:46
All you technically have to update is the bytecode file. If you downloaded a new version of that, the next run it should work.....assuming AppGameKit will use the bytecode file from the media folder in the write path, I've never tried.

So instead of downloading a new apk, try just downloading a new bytecode file.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Jan 2020 22:06 Edited at: 11th Jan 2020 22:09
Quote: "All you technically have to update is the bytecode file. If you downloaded a new version of that, the next run it should work..."

You cannot write to where the apps are installed on android unless the device has been rooted
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 12th Jan 2020 01:26
No, I know. But if you save a file to the media folder, it saves it to a write path media folder. So what I was asking was, if a bytecode file was there could AppGameKit be made to load it?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 12th Jan 2020 01:38 Edited at: 12th Jan 2020 02:01
Quote: " But if you save a file to the media folder, it saves it to a write path media folder."

It would be interesting to try it and see what happens.
What i don't understand is that every device i have tried downloading the .apk works. Each device has asked to install the apk.
I don't understand why it is not happening for Danny
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 21st Jan 2020 20:31 Edited at: 21st Jan 2020 20:34
Quote: "But I would like the APK automatically be installed after the download."


On PC we could do that using RunApp ( filename location etc) , but such a command doesn't exist for mobile I think.

Quote: "What i don't understand is that every device i have tried downloading the .apk works. Each device has asked to install the apk.
I don't understand why it is not happening for Danny"


This only happens when you open the file automatically. I think Danny isn't using an external browser to download the file, but wrote his own app to verify if the app was downloaded completely, from within his App Game Kit app.

It definitely depends on how your browser handles file downloads. If you need an alternative, I suggest spreading an update link using something like OneDrive or a DropBox location. Such downloads tend to attempt to open the file in case of an .APK . Well, at least OneDrive does. I use it to download the latest mobile game builds to my phone. (edit: By the way, if an app was recently installed, there's a possibility clicking Open to install the new APK file directly might actually install the old APK, same goes for not overwriting the app when the app was still open on your smartphone. So make sure the app you are going to update was at least closed properly.)

You could still check with a .txt file online to see if an update is required to be downloaded or maybe even have a string with a direct OneDrive link you can or must open to download?

I don't think the Bytecode file can be 'injected' into an existing app, although I'll admit I'm not sure.
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 22nd Jan 2020 00:56
I forgot about the ViewFile() command, that should work, instead of ShareFile().

Login to post a reply

Server time is: 2024-04-26 05:28:58
Your offset time is: 2024-04-26 05:28:58