How deploy my app with Google Cloud Run?

Regarding Tiny Database, this tool permanently stores information within the application. I don't know how you would use it to check for updates.

The intention is to check the value of a tag on firebase, which holds the latest version number. The tinydb would hold the value of the installed version number. Compare these two, then act.

You used cloudDB for this instead of firebase.

Yes. The version number can be stored in a variable instead of Tiny.

Exactly. Firebase can be used for verification. You need Realtime Database because it's the fastest. In both cases, we'll only use text. The application will be uploaded via a link.

@TIMAI2 I'm working on your solution (json file and tinydb).

But

1 - How in Firebase storage can I generate the download URL for json file and for my APK?
2 - chronological problem: in my app I need to know json url, so I have to upload the json in Storage to know the json url, but json file should contain the url to download the app, but if I have not the json url, my app will not be completed, so I can not upload it....

How can I solve?

I would suggest that when you have created your new version of your app and the apk for it, that you go to the firebase console and upload the new file to firebase storage. once uploaded you can get the download url from there.

Then go to your realtime database and edit your tag values for the new version code and download url.

Is that it, or were you expecting this all to happen by some sort of magic ?

If there is a new version, you must remember to update the version code in the tinydb.

1 Like

I have made it.

How can I do it? @TIMAI2 have you suggestions for it?

In my app I decided to use json... But using realtime I will solve the "chronological problem". Thank you for this!

This is integrated in my blocks.

You can use Google Drive instead of Firebase.
This is easier. You copy the sharing link for the app and paste it into the database.

@The_Legend_Of_MTS thank you, this is a good solution!
But I would like to have all in one solution with Firebase...do you know how, step-by-step?

You can upload files in Firebase to the storage location.
From there, upload the application file. Copy its link. When I get back, I'll take a screenshot for you. Or @TIMAI2 will do it.

  1. Open up Storage in your Firebase Console
  2. Find the file you require the download url for. Click on it.
  3. A panel will open on the right with a link under "Name". RIGHT Click on this link
  4. Copy the link address, use it to paste into your realtime database tag

1 Like

Thank you very much @TIMAI2 , now my app works well.

Are you sure that using tinyDB is needed?
In my opinion code of every new version of the app should have a "current version code" variable, and the app could make the comparison between this value and the value retrieved from Realtime. In this way, the first time a user downloads the app, and supposing there are not new releases, the app will not ask for new downloads...
Is it wrong this solution? Do you think I'm forgetting something?

1 Like

By sideloading, installing the same app will happen regardless of version code (you are not using Play Store) - checking the version code avoids unnecessary downloading and installing of the same version of the app.

You are providing the latest version code in your Firebase tag (?) if you have followed what I suggested above, so you can use this to compare and update your tinydb version code tag.

1 Like

Yes you can do that
Taifun

@TIMAI2 I agree, the check is needed.
But
with the current version code variable inside my app, this info will be available in both cases: the installed app is an old version, or it is the first time I download and install the app.
On the contrary, in this last case I will not have a value in tinyDB to use for comparison. I understand that in theory the apk that users will download should refer to the last version, but with my solution I have not to introduce other check related to verify if we are in first time installation or not.

Thank you!

You can use a variable that you place in the version code. No need to use Tiny Place the version code in a variable. Have the application compare the version code in the variable with the version code in the database in real time. Each time an update is released, the value of the variable, which is the version code, is changed.

I mean, you need to change the version code in the variable.

Each time a new update is released

and how will you persist the storage of the version/version code installed on the device, if you only store it in a variable? Updates could be weeks or months apart.

Yes, I do it, and I don't see any problem. On screen 1, I set a variable to the version code. I then compare the version code in the variable with the database. The thing that might be a little tedious is that every time you want to export the APK, you have to change the version code. You increment the number by 1, and then you also increment the number in the database. The old application will compare the version code in the variable with the database we just updated and will find an increase in value. This is where it notifies the user that there's an update. And the new update is because you changed the version code. So, after the update and opening the application, it will compare the version code in the variable with the version code in the database again. It will find them to be the same. Therefore, it will know that there are no updates.

1 Like