All Projects → ezhome → Android-RxFirebase

ezhome / Android-RxFirebase

Licence: other
RxJava implementation for the Android Firebase client by Ezhome

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Android-RxFirebase

rxjava2-http
Transmit RxJava2 Flowable over http with non-blocking backpressure
Stars: ✭ 19 (-36.67%)
Mutual labels:  rxjava
RxValidationTextInputLayout
The easiest way to bring validation to your project
Stars: ✭ 45 (+50%)
Mutual labels:  rxjava
Fineract-CN-mobile
DEPRECATED project - Check the Apache fineract-cn-mobile project instead
Stars: ✭ 17 (-43.33%)
Mutual labels:  rxjava
RxLocation
Use with rxjava,No memory leak,Simple
Stars: ✭ 52 (+73.33%)
Mutual labels:  rxjava
nakadi-java
🌀 Client library for the Nakadi Event Broker (examples: http://bit.ly/njc-examples, site: https://dehora.github.io/nakadi-java/)
Stars: ✭ 29 (-3.33%)
Mutual labels:  rxjava
ReactiveBus
🚍 Reactive Event Bus for JVM (1.7+) and Android apps built with RxJava 2
Stars: ✭ 17 (-43.33%)
Mutual labels:  rxjava
PokemonCards
Android Clean MVP Architecture with Dagger & Simple Package Structure
Stars: ✭ 28 (-6.67%)
Mutual labels:  rxjava
WanAndroid
Kotlin版 玩Android 客户端
Stars: ✭ 37 (+23.33%)
Mutual labels:  rxjava
SQLitePractice
数据库案例:1.使用时间和日期函数,增,查时间字段。2.利用ContentProvider,CursorLoader,SQLite实现数据库的观察者模式。3.RxJava,SQLBrite实现数据库的观察者模式。4.拷贝外部db文件到数据库中
Stars: ✭ 21 (-30%)
Mutual labels:  rxjava
rx-docker-client
RxJava based Docker REST API client for the JVM
Stars: ✭ 61 (+103.33%)
Mutual labels:  rxjava
AsyncChain
异步链式库,类似RXJava,可以用于切换主线程,或者执行一串相互依赖的任务
Stars: ✭ 17 (-43.33%)
Mutual labels:  rxjava
RxCamera2
Rx Java 2 wrapper for Camera2 google API
Stars: ✭ 27 (-10%)
Mutual labels:  rxjava
Kotlin-Starter
☕ Kotlin starter with rx
Stars: ✭ 22 (-26.67%)
Mutual labels:  rxjava
AndroidTutorials
Ejemplos Android [Dagger2,RxJava,MVP,Retrofit2,SQLite]
Stars: ✭ 22 (-26.67%)
Mutual labels:  rxjava
RxFBase
🔥 wrapping firebase with rx
Stars: ✭ 12 (-60%)
Mutual labels:  rxjava
rxactivitylauncher
Provide a way to receive the results of the Activity by RxJava.
Stars: ✭ 19 (-36.67%)
Mutual labels:  rxjava
WanAndroid-Java
一款采用Java语言、MVVM + Retrofit + RxJava架构开发的玩Android客户端 (https://www.wanandroid.com/) 。PS: Kotlin版 (https://github.com/chongyucaiyan/WanAndroid-Kotlin) 。
Stars: ✭ 32 (+6.67%)
Mutual labels:  rxjava
servant
Serving you with GoogleApiClients any way you like them
Stars: ✭ 17 (-43.33%)
Mutual labels:  rxjava
RxCoroutineSchedulers
Kotlin Coroutines as RxJava Schedulers 😈
Stars: ✭ 31 (+3.33%)
Mutual labels:  rxjava
BookReader
📕 "任阅" 网络小说阅读器,3D翻页效果、txt/pdf/epub书籍阅读、Wifi传书~
Stars: ✭ 6,113 (+20276.67%)
Mutual labels:  rxjava

Hex.pm Platform Download CircleCI

RxFirebase

RxJava implementation by ezhome for the Android Firebase client.


Contents

Usage

Currently library supports for new Google Firebase the followings:

  • Firebase Authentication RxFirebaseAuth
  • Firebase Database RxFirebaseDatabase

Use the project with your own Firebase instance

  1. Clone this repository.
  • Create a new project in the Firebase console.
  • Click Add Firebase to your Android app
    • provide a unique package name
    • use the same package name for the applicationId in your build.gradle
    • insert SHA-1 fingerprint of your debug certificate, otherwise you won't be able to log in
  • Copy the generated google-services.json to the app folder of your project which will replace the mock google services json file.
  • You should be able to successfully sync the project now.
  • Copy contents of the ./server/database.rules.json into your Firebase -> Database -> Rules and publish them.
  • Import data ./server/sample-data.json into your Firebase -> Database
  • Change the Firebase URL path in this file
  • Build and run the app.

Example

    final Firebase firebaseRef = new Firebase("https://docs-examples.firebaseio.com/web/saving-data/fireblog/posts");
    RxFirebaseDatabase.getInstance().observeValueEvent(firebaseRef).subscribe(new GetPostsSubscriber());

    private final class GetPostsSubscriber extends Subscriber<DataSnapshot> {
      @Override public void onCompleted() {
        PostsFragment.this.showProgress(false);
      }

      @Override public void onError(Throwable e) {
        PostsFragment.this.showProgress(false);
        PostsFragment.this.showError(e.getMessage());
      }

      @SuppressWarnings("unchecked") @Override public void onNext(DataSnapshot dataSnapshot) {
        List<BlogPostEntity> blogPostEntities = new ArrayList<>();
        for (DataSnapshot childDataSnapshot : dataSnapshot.getChildren()) {
          blogPostEntities.add(childDataSnapshot.getValue(BlogPostEntity.class));
        }
        PostsFragment.this.renderBlogPosts(blogPostEntities);
      }
    }

Check the example application here

You can change scheduler for observing values in a different thread

Example

 RxFirebaseDatabase.getInstance().observeOn(Schedulers.io());

Download

The project is available on jCenter. In your app build.gradle (or explicit module) you must add this:

dependencies {
  compile 'com.ezhome:rxfirebase:2.2.0'
}

Tests

Tests are available in rxfirebase/src/test/java/ directory and can be executed from Android Studio or CLI with the following command:

./gradlew test

Code style

Code style used in the project is called SquareAndroid from Java Code Styles repository by Square available at: https://github.com/square/java-code-styles.

License

Copyright 2016 Ezhome Inc.

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].