0

I don't have a Google Play Store account, I'm trying to implement AppUpdater library, but I cannot understand this procedure.

How do I set up my GitHub repository?

Here is my code:

enter image description here

And here is my Github repository.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • It's unclear what problem you're trying to solve here. To enable others to help you, describe the exact behavior you expected, as well as how that behavior differs from what is happening with your current implementation. Include the exact text of any error messages, (including, for any exceptions, the full [stack trace](https://stackoverflow.com/a/23353174) and which line of code is producing it). Please see [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example). – Ryan M Apr 12 '20 at 07:57

2 Answers2

1

If your main goal is to implement a feature of force update. I would recommend using a firebase remote config as this library will be a problem because of its requirements.

Notes You must have one published release (at least) in the provided repository, tagged as X.X.X.X or vX.X.X.X. Repo must be public. GitHub doesn't support versionCode. You should use UpdateFrom.JSON or UpdateFrom.XML instead. Update#getLatestVersionCode() will be null when using AppUpdaterUtils. You should use Update#getLatestVersion() instead.

It clearly states that repo needs to be public unless you are not planning to keep your code as open-source there will be plenty of rework which you need to take in future. Please find the below link for another approach https://readyandroid.wordpress.com/force-app-update-androidfirebase/

Swapnil Kadam
  • 4,075
  • 5
  • 29
  • 35
  • Thanks for your help, Is there any way to direct install? – Md Ariful Islam Apr 12 '20 at 09:51
  • @MdArifulIslam I am assuming direct install here means whenever there is an update user needs to be redirected to the play store. For that, you would need some mechanism to know if your version is not the latest when you use Firebase remote config that would help you to know if there is a new version available and using simple if loop you can use your app link of the play store. Note: you would need at least 1 version to be on the playstore. – Swapnil Kadam Apr 14 '20 at 06:37
1

AppUpdater library provides the only dialog whenever new latest version available.they are not providing the option to download the app.

If you want to show pop up

new AppUpdater(this)
   .setUpdateFrom(UpdateFrom.JSON)
   .setUpdateJSON("https://raw.githubusercontent.com/yourUserName/yourRepoName/master/app/update-changelog.json")
   .start();

Add this JSON File named as update-changelog.json inside App module for your Repository.

Like below

{
  "latestVersion": "1.2.2",
  "latestVersionCode": 10,
  "url": "https://github.com/javiersantos/AppUpdater/releases",
  "releaseNotes": [
    "- First evolution",
    "- Second evolution",
    "- Bug fixes"
  ]
}
halfer
  • 19,824
  • 17
  • 99
  • 186
Arunachalam k
  • 734
  • 1
  • 7
  • 20