Skip to content

Commit

Permalink
Merge pull request #16 from tareksander/rewrite
Browse files Browse the repository at this point in the history
Rewrite
  • Loading branch information
tareksander authored May 18, 2021
2 parents 51f9cae + 1e9ee0b commit 75c0fbf
Show file tree
Hide file tree
Showing 139 changed files with 2,977 additions and 506 deletions.
6 changes: 5 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/build
/build
/usage.txt
/apks/
/seeds.txt
/mapping.txt
122 changes: 64 additions & 58 deletions app/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,70 @@
https://f-droid.org/wiki/page/Category:Apps_with_failing_builds


Release checklist:
- VersionName and VersionCode changed?
- fastlane descriptions updated?
- release tested?
- removed debug output?
- changelog for the version code written?

Roadmap:
0.4.0:
[x] Courseware plugin, play opencast videos linked in courseware
[x] add the studip notification settings to the settings screen, so you can control from the app what notifications you get
[x] add the option to not load opencast previews when on mobile data
[x] add the option to not load image previews when on mobile data
[x] add screenshots
[x] meetings plugin
[x] add permission to record audio, update description accordingly
[x] use android:keepScreenOn in the layout
[x] make it an activity, handle orientation changes myself, or else the WebView with the conference gets destroyed
[x] https://medium.com/cs-random-thoughts-on-tech/android-retain-webview-on-orientation-change-best-practices-be29fd7e56e3
[x] or just lock the screen in landscape mode, but the WebView still has to be retained for other configuration changes
[x] check if the WebView is really destroyed when the activity is closed, so the user really exits the conference and can't be heard
[x] support PiP for the meetings
[x] hide/show everything but the presentation for PiP-mode, with javascript injection
[x] add action buttons to mute/unmute
[x] bump version
[x] update description, add camera and MODIFY_AUDIO_SETTINGS description
[x] add explanation for additional permissions added by the libraries, namely FOREGROUND_SERVICE, WAKELOCK, START_AT_BOOT
[x] update help text
1.0.0:
[ ] meetings plugin
[ ] Test why the webcam doesn't work on-device
[ ] delete data which is not in a server response, but still in the database
[ ] support for the planner
[ ] app widget for the planner
[ ] option to browse the web version in an activity with a fullscreen WebView
[ ] API detection:
[ ] if api.php/user failed, try discovery to see if the API is even enabled
[ ] if yes, but api.php/user is not enabled, tell the user
[ ] see what routes are needed for what features, tell user on login which features are unavailable
[ ] fail without message for features where the routes are disabled
[ ] support for OAuth1 for authentication
[ ] bump version
[ ] update help text
[ ] update description
1.1.0:
[ ] add support for JSONAPI (probably requires abstracting away the api routes a bit more)
[ ] use JSONAPI if possible
[ ] for features only available for JSONAPI, fail gracefully and inform the user, or hide the feature to begin with, or emulate the feature
[ ] make more specific rules for proguard, so unused code can be removed
[ ] bump version
1.2.0:
[ ] plugins:
[ ] vips
[ ] etherpad
[ ] bump version



reduce size:
https://developer.android.com/topic/performance/reduce-apk-size
https://medium.com/@kevalpatel2106/how-you-can-decrease-application-size-by-60-in-only-5-minutes-47eff3e7874e



TODO: replace ListViews with RecyclerViews: LayoutManager: LinearLayoutManager, Scrollbar: Vertical


Expand All @@ -13,10 +77,6 @@ TODO
maybe use Html.fromHtml for messages?


TODO: translate help text


TODO: delete data which is not in a server response, but still in the database.


TODO: supply database migrations for every database change once the app is on f-droid
Expand All @@ -32,7 +92,6 @@ TODO: open issue with predefined content: https://docs.github.com/en/github/mana
License: GPLv2 or later


TODO: add the option to not load opencast previews when on mobile data



Expand All @@ -48,7 +107,6 @@ Document provider:

TODO:
add the studip notification settings to the settings screen, so you can control from the app what notifications you get.
add a SwitchCompat for every course with files, to include it in the documents provider


TODO: intent filter for sending a message to someone
Expand Down Expand Up @@ -80,27 +138,13 @@ TODO: intent filter for sending a message to someone
after logging in, check for available API-routes and tell the user if features aren't available because the provider disabled the API route
add a settings button to re-perform the check, so the user doesn't have to log out if an API-route is enabled

rework the communication with the API with a library:
https://github.com/square/retrofit
https://stackoverflow.com/questions/23879567/how-to-prevent-retrofit-from-clearing-my-cookies
https://medium.com/@dileepsattawan/how-to-handle-cookies-with-retrofit-in-android-8b1812178949
https://stackoverflow.com/questions/38418809/add-cookies-to-retrofit-2-request/44694428

instead of playing the videos in the app itself, make a content provider and share a URI to access the video to a video player app

use DownloadManager for downloads and add the session cookie to authenticate it:
https://developer.android.com/reference/android/app/DownloadManager.Request


TODO: JSONAPI: https://jsonapi.org/format
getting only specific fields to save mobilde data: https://jsonapi.org/format/#fetching-sparse-fieldsets





split up the dialog into DialogFragments, this preserves them during a configuration change and they can be split up into their own files:
https://developer.android.com/guide/fragments/dialogs

battery saving:
https://developer.android.com/training/efficient-downloads/regular_updates
Expand All @@ -114,7 +158,6 @@ A one-time-password is generated and the user has to enter it on the app of the
A key is derived from this password and all data encrypted with it.
https://developer.android.com/guide/topics/connectivity/bluetooth

TODO Use a ViewModel to fix the configuration change bugs once and for all

IMPORTANT: If LiveData changes while an activity is in the stopped state and then returns to resumed, does it get the update?
https://developer.android.com/topic/libraries/architecture/livedata
Expand All @@ -134,30 +177,12 @@ https://developer.android.com/guide/topics/appwidgets#fresh
https://developer.android.com/guide/topics/graphics/drawables#nine-patch




TODO publish on f-droid:
https://f-droid.org/de/docs/Repository_Style_Guide
https://www.f-droid.org/en/docs/Inclusion_How-To
Wait for publishing in the submission queue or make a merge request?
https://www.f-droid.org/en/docs/Submitting_to_F-Droid_Quick_Start_Guide
and
https://www.f-droid.org/en/docs/Build_Server_Setup/#optionally-using-qemukvmlibvirt-instead-of-virtualbox
to use qemu

TODO app links: most Stud.IP servers have a hostname of studip.*
Tools->App Links Assistant
dynamically add a broadcast receiver which listens for the specific hostname the user is currently logged in as
https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler)





general:
To make a new icon from a svg, convert it to a png with GIMP and then use it in android studio
The API also seems to work with session cookies, as it works with them in the browser.
Fix freezing while refreshing by using a handler that gets called in the UI thread after a request is done.

plugins:
plugins don't seem to have a REST api defined, probably because there wasn't an app for so long
Expand All @@ -170,44 +195,25 @@ https://developer.android.com/guide/topics/graphics/drawables#nine-patch
courseware:
to get the courseware html for a course: /plugins.php/courseware/courseware?cid=
cid is the course-id
opencast:
to get the opencast html for a course: /plugins.php/opencast/course/index/false?cid=
cid is the course-id
page for the individual videos:
/paella/ui/watch.html?cid=&id=
id is the video id
but the video pages use a special opencast video player.
but the links to the actual files are in the source of the course page near the download button.

Use a VideoView to display the video.

enable PiP-mode when using the opencast plugin, with normal media controls

meetings:
url: /plugins.php/meetingplugin/index?cid=
BigBlueButton is already made for mobile use, so a WebView with the session cookie should be enough.

TODO A WebView reloads when the parent is destroyed because of a configuration change. That would result in someone being temporarily kicked out of a meeting when the device is turned.
Make the meetings plugin its own activity and disable configuration changes in it.
( Or try a custom tab. Maybe the invite link is enough to join a meeting.) No, the session cookie is needed

use android:keepScreenOn in the layout of the activity



Enable PiP-Mode when a meeting is displayed and add custom controls to toggle audio, microphone, camera, screen share.

screen capturing for screen share: https://developer.android.com/reference/android/media/projection/MediaProjectionManager

vips:
url: /plugins.php/vipsplugin/sheets?cid=




maybe use WebViews to display the plugins? or just include a html parser library and filter out the important parts?
html parsing+VideoView is viable for opencast, as you just need to get the individual video URLs.
You can set the URI for VideoView, as well as the HTML-headers, so the cookies



Expand Down
60 changes: 34 additions & 26 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ android {
applicationId "org.studip.unofficial_app"
minSdkVersion 21
targetSdkVersion 30
versionCode 7
versionName "0.3.1"
versionCode 8
versionName "0.4.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.'default'
resConfigs "en", "de"
}

buildTypes {
// TODO somehow doesn't work with shrinking
release {
//minifyEnabled true
//shrinkResources true
//proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
//minifyEnabled true
Expand All @@ -44,8 +44,8 @@ android {
}

dependencies {


// Libraries
implementation "com.squareup.picasso:picasso:2.71828"

implementation "com.squareup.retrofit2:retrofit:2.9.0"
Expand All @@ -54,39 +54,47 @@ dependencies {
implementation "com.squareup.retrofit2:adapter-rxjava2:2.9.0"

implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.2'
// ViewModel


implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"

implementation 'org.jsoup:jsoup:1.13.1'

implementation 'com.google.code.gson:gson:2.8.6'



implementation 'com.google.android.material:material:1.3.0'

// androidx

implementation "androidx.webkit:webkit:1.4.0"

implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation "androidx.lifecycle:lifecycle-viewmodel:2.3.1"
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata:2.3.1"
implementation "androidx.lifecycle:lifecycle-common-java8:2.3.1"

implementation "androidx.work:work-runtime:2.6.0-alpha02"

implementation "androidx.paging:paging-runtime:2.1.2"
implementation "androidx.paging:paging-runtime:3.0.0"

implementation 'androidx.room:room-runtime:2.3.0'
annotationProcessor 'androidx.room:room-compiler:2.3.0'
implementation 'androidx.room:room-rxjava2:2.3.0'

implementation "io.reactivex.rxjava2:rxjava:2.2.9"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
//implementation 'androidx.navigation:navigation-fragment:2.3.5'
//implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.work:work-runtime:2.7.0-alpha03'
implementation "androidx.security:security-crypto:1.1.0-alpha03"
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation "androidx.activity:activity:1.2.3"

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation "androidx.work:work-runtime:2.6.0-alpha02"
implementation 'com.google.code.gson:gson:2.8.6'
implementation "androidx.security:security-crypto:1.1.0-alpha03"
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation "androidx.activity:activity:1.2.2"
implementation 'org.jsoup:jsoup:1.13.1'
}
Loading

0 comments on commit 75c0fbf

Please sign in to comment.