Skip to content

Commit

Permalink
Implemented in-app updates
Browse files Browse the repository at this point in the history
  • Loading branch information
feelfreelinux committed Nov 7, 2017
1 parent 264c3a7 commit 7c99f08
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ deploy:
provider: releases
api_key:
secure: mh793ORwYZxd0CERyAYUlyhCeLhCMtvZeklvGrZ4Q6AK8cnacNsg41rOoIK1K1pAqBntXEVLBC3cRg2rAPy0nRT45z3wduUAnDFgvay4lV7FaTO0QwWT8rYWfyWfjEY3Ti13NV+wBa+wF25W6Cr2PNjdge3lVGnck0Xo52X2eMAOuWJMI1Jb2p1QLBAjenPYyh6uSBX8ZScZN0Jx3KVQeFyCoLHwULP8wjVIbTgFbF3qHPNV0l6FZZh7B9WOvHavSk17SDeTD655VoA57vZ/MCBkruwvGmuzs5tixko15kd6+r/mS6DN5NMWlLDODrrTk9xuEYhO8i26bJKwOlSol1A8Ff9vPrVPayp5lbhbdMXJJkeMkDrHG76ugNzeJhJCm67tlq43COUFuin5L8QpC4iOLy3TjOluzkhIn6pZ6OOdsfG3Ip/BpwR+yb+pfaPhiZ1fvuqfDza2ina8bWbYksUoD1AKRDvd1sAg9XqYGxlaxXoL0BeZqTKUwToziaNES2/pGRKNBhM8B+YZyrNYasDPZzKhIWsx6jaXWos3vy7G1JpE8e7xzw/wlemD7fU+/O/hTUaSOtJLCWwoAP3rI42rZEpuAPAZ9aNvtA3PmZUssuZzeEH3zyAU4LhSXE2YH82lRph/sDZjbOnfTo8Sbho/G334gARb15d34YmareU=
file: "/app/build/outputs/apk/release/app-release.apk"
file: "app/build/outputs/apk/release/app-release.apk"
skip_cleanup: true
on:
all_branches: true
Expand Down
7 changes: 5 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android {
applicationId "io.github.feelfreelinux.wykopmobilny"
minSdkVersion 19
targetSdkVersion 26
versionCode 3
versionName "0.1.2.1"
versionCode 4
versionName "0.1.2.2"

def credentialsPropertiesFile = rootProject.file("credentials.properties")
def credentialsProperties = new Properties()
Expand Down Expand Up @@ -98,6 +98,9 @@ dependencies {
implementation "io.reactivex.rxjava2:rxandroid:$versions.rxandroid"
implementation "io.reactivex.rxjava2:rxjava:$versions.rxjava"

// AppUpdater
implementation "com.github.javiersantos:AppUpdater:$versions.appUpdater"

// Dagger 2
implementation "com.google.dagger:dagger:$versions.dagger2"
kapt "com.google.dagger:dagger-compiler:$versions.dagger2"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import android.support.v7.widget.Toolbar
import android.view.MenuItem
import android.widget.Toast
import com.evernote.android.job.util.JobUtil
import com.github.javiersantos.appupdater.AppUpdater
import io.github.feelfreelinux.wykopmobilny.R
import io.github.feelfreelinux.wykopmobilny.WykopApp
import io.github.feelfreelinux.wykopmobilny.base.BaseActivity
Expand Down Expand Up @@ -91,6 +92,14 @@ class NavigationActivity : BaseActivity(), MainNavigationView, NavigationView.On
WykopApp.uiInjector.inject(this)
JobUtil.hasBootPermission(this)

// Setup AppUpdater
AppUpdater(this)
.setGitHubUserAndRepo("feelfreelinux", "WykopMobilny")
.setTitleOnUpdateAvailable(R.string.update_available)
.setContentOnUpdateAvailable(R.string.update_app)
.setButtonUpdate(R.string.update)
.start()

// Schedules notification service
WykopNotificationsJob.schedule(settingsApi)

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,7 @@
<string name="unobserve_tag">Przestań obserwować tag</string>
<string name="block_tag">Zablokuj tag</string>
<string name="unblock_tag">Odblokuj tag</string>
<string name="update_available">Dostępna aktualizacja</string>
<string name="update_app">Zaktualizuj aplikację do najnowszej wersji</string>
<string name="update">Zaktualizuj</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ class LoginScreenPresenterTest {
}



}
3 changes: 2 additions & 1 deletion versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ext {
rxjava : '2.1.3',
rxandroid : '2.0.1',
leakcanary : '1.6-SNAPSHOT',
androidjob : '1.2.0'
androidjob : '1.2.0',
appUpdater : '2.6.3'
]
}

0 comments on commit 7c99f08

Please sign in to comment.