Comments (5)
First of all, thank you for showing interest in the library! :)
Honestly, I haven't heard of LiveData yet. It looks like it's a new concept (kind of similar to observable I guess). In the docs there is a little paragraph about using rxjava / rxjava2 and LiveData. I think it would be awesome to see some integration here! Since I have limited time right now and I'm still fixing some core-issues of this library, feel free to create a PR if you're able to create an example using LiveData. Would love to add support for LiveData to this library as well! :)
If you have any more questions, feel free to send me an email or text me on matrix (@David-Dev:matrix.org)
from android-singlesignon.
from android-singlesignon.
We use LiveData in the Deck-app a lot. I have some methods written, that could come handy, when you are going to implement the support: https://github.com/stefan-niedermann/nextcloud-deck/blob/master/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/util/LiveDataHelper.java
e.g. you can turn anything into a LiveData and stuff. Maybe this helps. If you have questions about it, you know how to contact me 😉
from android-singlesignon.
AFAIK it is not possible to make network requests directly via LiveData
. One would need to perform the actual Call
s and map them into a new MutableLiveData
instance - or transform an Observable
into LiveData
.
My understanding of a good Android app architecture is, that the Repository
layer is responsible of delivering results from a local store (aka database) and synchronizing the contents of the database with unreliable remote resources in the background.
LiveData
is therefore understandable needed to watch the data of a database via repository, but since the synchronization with remote sources should be handled in the background, there is no dependency to the current state of the Activity
/ Fragment
here in my opinion.
@schaarsc are you aware of any app which is using LiveData
in the Remote Data Source
layer? Maybe i am missing something here, but i have never seen something like this in the wild yet.
However, i think a valid point is to make the current SingleSignOnAccount
available as a LiveData
which then can be used in combination with Transformations#map
or Transformations#switchMap
. I therefore created a PR which adds this feature and deprecates the usage of (un)registerSharedPreferenceChangeListener
.
from android-singlesignon.
I have not been active for quite some time, so I'm not sure how this would fit into the current state of implementations ...
The idea behind the original request was to handle all data with LiveData (local and remote).
The UI would be connected to MediatorLiveData and does not need to know where the data comes from.
References:
- https://developer.android.com/jetpack/guide#addendum
- https://developer.android.com/topic/libraries/architecture/livedata#merge_livedata
from android-singlesignon.
Related Issues (20)
- Provide convenience class for OCS requests HOT 4
- Support .qa package id of the files app
- Convenience features for `NextcloudRequest.Builder`
- Handle `QueryParam` with key "`c`" HOT 4
- SEARCH HTTP method is not supported HOT 7
- Support Activity Result API HOT 3
- Rotation issues
- i18n: `Benötigt keine Übersetzung. Für Android wird nur die formelle Übersetzung verwendet (de_DE).` HOT 7
- If only dev app is installed SSO doesn't work HOT 8
- Break on minified app HOT 12
- Migrate to Material 3 theme HOT 1
- Option to create new token on `TokenMismatchException` HOT 3
- Availablity on Amazon store HOT 1
- Instantiating `Void` does no longer work with AGP 8 HOT 18
- Improve SSO error dialogs shown by 3rd-party-apps HOT 2
- Check `NetworkRequest#mDestroyed` before each network request? HOT 1
- Readme contains bad R8 advice HOT 1
- Reportedly not working when used within Samsung Knox HOT 1
- Possibility to get WebDAV-capable app password/token from SSO HOT 5
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-singlesignon.