All Projects → Popalay → RxRealm

Popalay / RxRealm

Licence: Apache-2.0 License
Utilities for using RxJava with Realm

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to RxRealm

android-online-course
Android Online Course
Stars: ✭ 22 (-4.35%)
Mutual labels:  rxjava, rxjava-android
Apiclient
A easy to use api client that combines the power of Retrofit, Realm, Gson, Rxjava and Retrolambda in a easy to use library for Java and Android
Stars: ✭ 100 (+334.78%)
Mutual labels:  rxjava, realm
Android Mvp Starter
Create/Generate your MVP projects easily
Stars: ✭ 72 (+213.04%)
Mutual labels:  rxjava, realm
Rx.observe
Transform any method to an Rx Observable ! (VIPER)
Stars: ✭ 34 (+47.83%)
Mutual labels:  rxjava, rxjava-android
Rxlowpoly
A RxJava based library using native code to convert images to Lowpoly for Android
Stars: ✭ 160 (+595.65%)
Mutual labels:  rxjava, rxjava-android
Rxbluetoothkotlin
Bluetooth low energy reactive framework for Android written in Kotlin
Stars: ✭ 68 (+195.65%)
Mutual labels:  rxjava, rxjava-android
Mvpframes
整合大量主流开源项目并且可高度配置化的 Android MVP 快速集成框架,支持 AndroidX
Stars: ✭ 100 (+334.78%)
Mutual labels:  rxjava, rxjava-android
Androidrapidlibrary
Android 快速开发库,主要想实现一条属于自己的开发框架。包括网络访问,数据,UI等等
Stars: ✭ 577 (+2408.7%)
Mutual labels:  rxjava, realm
Rxjavapriorityscheduler
RxPS - RxJavaPriorityScheduler - A RxJava Priority Scheduler library for Android and Java applications
Stars: ✭ 138 (+500%)
Mutual labels:  rxjava, rxjava-android
Awesome Blogs Android
어썸블로그 ・ 개발 블로그 모음 ・ 개발 잡덕들을 위한 본격 고퀄리티 개발 블로그 큐레이션 서비스 🕵️‍♀️
Stars: ✭ 128 (+456.52%)
Mutual labels:  rxjava, realm
Rxjava2 Operators Magician
你用不惯 RxJava,只因缺了这把钥匙 🔑 You are not used to RxJava, just because of the lack of this key.
Stars: ✭ 868 (+3673.91%)
Mutual labels:  rxjava, rxjava-android
NewsReader
Android News Reader app. Kotlin Coroutines, Retrofit and Realm
Stars: ✭ 21 (-8.7%)
Mutual labels:  rxjava, realm
Habitica Android
Native Android app for Habitica
Stars: ✭ 847 (+3582.61%)
Mutual labels:  rxjava, realm
Android Mvvm Rx3 Dagger2 Navcomponent
Implemented using MVVM, LiveData, Room, RX3, Dagger2, Coil, View Binding, Navigation Component and AndroidX
Stars: ✭ 72 (+213.04%)
Mutual labels:  rxjava, rxjava-android
Android Kotlin Mvp Architecture
This repository contains a detailed sample app that implements MVP architecture in Kotlin using Dagger2, Room, RxJava2, FastAndroidNetworking and PlaceholderView
Stars: ✭ 615 (+2573.91%)
Mutual labels:  rxjava, rxjava-android
Newspaper
An aggregated newspaper app containing news from 10+ local news publishers in Hong Kong. Made with ❤
Stars: ✭ 82 (+256.52%)
Mutual labels:  rxjava, realm
Android Mvp Architecture
This repository contains a detailed sample app that implements MVP architecture using Dagger2, GreenDao, RxJava2, FastAndroidNetworking and PlaceholderView
Stars: ✭ 4,360 (+18856.52%)
Mutual labels:  rxjava, rxjava-android
Traceur
Easier RxJava2 debugging with better stacktraces
Stars: ✭ 502 (+2082.61%)
Mutual labels:  rxjava, rxjava-android
Mvvm Reddit
A companion project for our blog post on better Android software development using MVVM with RxJava.
Stars: ✭ 106 (+360.87%)
Mutual labels:  rxjava, rxjava-android
Marvel
Marvel Characters Android Application Assigned by smava GmbH
Stars: ✭ 227 (+886.96%)
Mutual labels:  rxjava, rxjava-android

Download Android Arsenal License

Rx Realm

Utilities for using RxJava with Realm

Getting Started

compile 'com.github.popalay:rx-realm:latest-version'

compile 'com.github.popalay:rx2-realm:latest-version'

Usage

From Java

    public Observable<List<MessageResponse>> getMessages() {
        return RxRealm.listenList(realm -> realm.where(MessageResponse.class)
                .findAllSorted(MessageResponse.CREATED_AT, Sort.DESCENDING));
    }

    public Single<List<MessageResponse>> loadMessages() {
        return mApi.messages()
                .observeOn(Schedulers.computation())
                .doOnSuccess(this::saveMessages);
    }
    
    private Completable saveMessages(List<MessageResponse> messages) {
        return RxRealm.doTransactional(realm -> {
                realm.where(MessageResponse.class).findAll().deleteAllFromRealm();
                realm.copyToRealmOrUpdate(messages);
            });
    }

From Kotlin

    fun getMessages(): Observable<List<MessageResponse>> {
        return RxRealm.listenList{it.where(MessageResponse::class.java)
                .findAllSorted(MessageResponse.CREATED_AT, Sort.DESCENDING)}
    }

    fun loadMessages(): Single<List<MessageResponse>> {
        return mApi.messages()
                .observeOn(Schedulers.computation())
                .doOnSuccess(this::saveMessages)
    }
    
    private saveMessages(messages: List<MessageResponse>): Completable {
        return RxRealm.doTransactional {
                it.where(MessageResponse::class.java).findAll().deleteAllFromRealm()
                it.copyToRealmOrUpdate(messages)
            }
    }

License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].