Android-MVP-Architecture | MVP Kotlin Retrofit2 Dagger2 Coroutines | Reactive Programming library
kandi X-RAY | Android-MVP-Architecture Summary
kandi X-RAY | Android-MVP-Architecture Summary
model–view–presenter (mvp) is a derivation of the model–view–controller (mvc) architectural pattern which mostly used for building user interfaces. in mvp, the presenter assumes the functionality of the “middle-man”. in mvp, all presentation logic is pushed to the presenter. check here for mvvm. what is coroutines ?. coroutines : is light wight threads for asynchronous programming, coroutines not only open the doors to asynchronous programming, but also provide a wealth of other possibilities such as concurrency, actors, etc. they're different tools with different strengths. like a tank and a cannon, they have a lot of overlap but are more or less desirable under different circumstances. - coroutines is light wight threads for asynchronous programming. - rx-kotlin/rx-java is functional reactive programming, its core pattern relay on observer design pattern, so you can use it to
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Android-MVP-Architecture
Android-MVP-Architecture Key Features
Android-MVP-Architecture Examples and Code Snippets
Community Discussions
Trending Discussions on Android-MVP-Architecture
QUESTION
I have this method that I am trying to pull data from an API, and then update the text view. Everything works except getRecipeName doesn't finish after the "end Method" log. .getRecipeName()
uses RetroFit to pull from an API.
I am currently learning MVP, Dagger, RxJava, and Butterknife all at once using Mindork's Github page on MVP Architecture
I commented out the .subscribeOn and .observeOn to see the result difference and nothing changed.
...ANSWER
Answered 2018-Jul-04 at 06:55The reason is because your observable is returning jokeText every time it is subscribed upon. It returns immediately after invocation and will not wait for your network operation.
One possible solution is to use the RxJavaCallAdapter. Link here: https://github.com/square/retrofit/tree/master/retrofit-adapters/rxjava2
It will automatically convert your API returns to observables. No need to manually invoke retrofit requests. Just process the response and convert it to your desired object from there.
Another approach would be to wrap your entire sequence in an Observable.create
or Observable.fromAsync
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Android-MVP-Architecture
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page