All Projects → francescocervone → Rxdrive

francescocervone / Rxdrive

Licence: mit
RxJava wrapper for Google Drive Android API

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Rxdrive

Playa
玩Android(http://www.wanandroid.com/) APP(MVP + RxJava2 + Retrofit2 + Dagger2)
Stars: ✭ 93 (-12.26%)
Mutual labels:  rxjava
Reptar
Roaring RxJava
Stars: ✭ 99 (-6.6%)
Mutual labels:  rxjava
Hexopress
A tiny blogging platform that lets you write posts in Google Docs and syncs with a Google Drive directory.
Stars: ✭ 102 (-3.77%)
Mutual labels:  google-drive
Plexdrive
Plexdrive mounts your Google Drive FUSE filesystem (optimized for media playback)
Stars: ✭ 1,324 (+1149.06%)
Mutual labels:  google-drive
Goindex Theme Acrou
This is a goindex theme.一个goindex的扩展主题。
Stars: ✭ 1,332 (+1156.6%)
Mutual labels:  google-drive
Mvpframes
整合大量主流开源项目并且可高度配置化的 Android MVP 快速集成框架,支持 AndroidX
Stars: ✭ 100 (-5.66%)
Mutual labels:  rxjava
Rxlife
使用Jetpack、Kotlin实现的RxJava自动注销库,你值得拥有!
Stars: ✭ 92 (-13.21%)
Mutual labels:  rxjava
Jiandou
豆瓣Material Design风格的Android客户端
Stars: ✭ 104 (-1.89%)
Mutual labels:  rxjava
Jd Test
仿京东app 全新组件化架构升级
Stars: ✭ 1,346 (+1169.81%)
Mutual labels:  rxjava
Reactiveandroid
🚀 Simple and powerful ORM for Android
Stars: ✭ 102 (-3.77%)
Mutual labels:  rxjava
Kotlinrxmvparchitecture
Clean MVP Architecture with RxJava + Dagger2 + Retrofit2 + Mockito + Fresco + EasiestGenericRecyclerAdapter using Kotlin. Includes Unit Tests(Kotlin Tests)!
Stars: ✭ 94 (-11.32%)
Mutual labels:  rxjava
Novelreader
仿照"任阅"的追书、看书的小说阅读器。重写"任阅"的代码,优化代码逻辑和代码结构,降低内存使用率。重写小说阅读器,支持网络阅读、本地阅读(支持分章,虚拟分章)。支持仿真翻页、上下滚动翻页等翻页效果。支持小说断点续传功能。优化用户使用体验。
Stars: ✭ 1,325 (+1150%)
Mutual labels:  rxjava
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 (-5.66%)
Mutual labels:  rxjava
Aria2.conf
Aria2 配置文件 | OneDrive & Google Drvive 离线下载 | 百度网盘转存
Stars: ✭ 1,321 (+1146.23%)
Mutual labels:  google-drive
Cateye
高仿猫眼电影App
Stars: ✭ 102 (-3.77%)
Mutual labels:  rxjava
Create Google Shared Drive
Cloudflare Redesigned Script for creating a Shared/Team Drive
Stars: ✭ 93 (-12.26%)
Mutual labels:  google-drive
Qbox
🐈 RxJava+Retrofit+Okhttp+Glide + A life tool App, contains modules: news; jokes; constellation fortune; LED; weather; calendar; two-dimensional code, and more ... 小秋魔盒是一个生活工具 App,主要功能有:新闻资讯;微信精选美文;笑话趣图;星座运势;LED字幕;天气;日历;二维码;手电筒;老黄历。在开发中尽可能多的用了目前比较流行的框架和库。
Stars: ✭ 1,360 (+1183.02%)
Mutual labels:  rxjava
Mvvm Reddit
A companion project for our blog post on better Android software development using MVVM with RxJava.
Stars: ✭ 106 (+0%)
Mutual labels:  rxjava
Gdindex
A Google Drive Index built with Vue Running on CloudFlare Workers
Stars: ✭ 1,384 (+1205.66%)
Mutual labels:  google-drive
Basemvp Master
一个基本的MVP应用框架(RxJava+Retrofit+Glide+IjkPlayer),封装比较完善,易于使用,帮助日常快速开发一个项目。
Stars: ✭ 101 (-4.72%)
Mutual labels:  rxjava

Android Arsenal Download Build Status

RxDrive

RxJava wrapper for Google Drive Android API

Why

Using Google Drive API for Android can be a little frustrating because sometimes you must define nested callbacks. If you want to avoid them, you should create an AsyncTask for each action and call synchronous methods (await()). Anyway, you have to write some ugly and confusing code.

The purpose of RxDrive is to use Google Drive APIs with the elegance and the advantages of RxJava.

No more nested callbacks, no more AsyncTasks.

Before you start

Before you start using this library, you need to follow the instructions to create a new project with Google Drive API access (https://developers.google.com/drive/android/get-started).

Features

Since this project is still a work in progress, additional features will come in next releases. Currently, RxDrive allows you to:

  • Authenticate users
  • Notify your app about changes of the connection state
  • Create files
  • Open files
  • Update files
  • Get metadata of Drive resources
  • List and query resources
  • Trash, untrash and delete Drive resources
  • Sync Drive

Examples

Connecting

public class MyActivity extends AppCompatActivity {
    private RxDrive mRxDrive;
    private Subscription mSubscription;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    	...
    	mRxDrive = new RxDrive(new GoogleApiClient.Builder(this)
    		.addApi(Drive.API)
    		.addScope(Drive.SCOPE_FILE) //If you want to access to user files
    		.addScope(Drive.SCOPE_APPFOLDER) //If you want to access to the app folder
    	);
    }
    	
    @Override
    protected void onStart() {
        ...
        mSubscription = mRxDrive.connectionObservable()
                .subscribe(new Action1<ConnectionState>() {
                    @Override
                    public void call(ConnectionState connectionState) {
                        switch (connectionState.getState()) {
                            case CONNECTED:
                                doSomething(connectionState.getBundle());
                                break;
                            case SUSPENDED:
                                doSomethingElse(connectionState.getCause());
                                break;
                            case FAILED:
                                mRxDrive.resolveConnection(MyActivity.this, connectionState.getConnectionResult());
                                break;
                            case UNABLE_TO_RESOLVE:
                                showMessageToUser(connectionState.getConnectionResult());
                                break;
                        }
                    }
                }, new Action1<Throwable>() {
                    @Override
                    public void call(Throwable throwable) { ... }
                });
        mRxDrive.connect();
    }
    
    @Override
    protected void onStop() {
        ...
        mRxDrive.disconnect();
        mSubscription.unsubscribe();
    }
    
    @Override
    protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
        mRxDrive.onActivityResult(requestCode, resultCode, data);
    }
}

Creating a file

mRxDrive.createFile(mRxDrive.getAppFolder(), uriOrFile, optionalName, optionalMimeType)
    .subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe(new Action1<DriveId>() {
        @Override
        public void call(DriveId driveId) { ... }
    }, new Action1<Throwable>() {
        @Override
        public void call(Throwable throwable) { ... }
    });

Listing children of a folder

mRxDrive.listChildren(mRxDrive.getAppFolder())
    .subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe(new Action1<List<DriveId>>() {
        @Override
        public void call(List<DriveId> driveIds) { ... }
    }, new Action1<Throwable>() {
        @Override
        public void call(Throwable throwable) { ... }
    });

Querying for children of a folder

Query query = new Query.Builder()
	.addFilter(Filters.eq(SearchableField.TITLE, "HelloWorld.java"))
	.build()
mRxDrive.queryChildren(mRxDrive.getAppFolder(), query)
    .subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe(new Action1<List<DriveId>>() {
        @Override
        public void call(List<DriveId> driveIds) { ... }
    }, new Action1<Throwable>() {
        @Override
        public void call(Throwable throwable) { ... }
    });

Getting metadata

mRxDrive.getMetadata(someDriveId)
    .subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe(new Action1<Metadata>() {
	@Override
        public void call(Metadata metadata) { ... }
	}, new Action1<Throwable>() {
	@Override
        public void call(Throwable throwable) { ... }
	}

Opening a file

mRxDrive.open(mDriveId, new Subscriber<Progress>() {
        @Override
        public void onCompleted() { ... }
    
        @Override
        public void onError(Throwable e) { ... }
    
        @Override
        public void onNext(Progress progress) {
            mTextView.setText(progress.getPercentage() + "%");
        }
    })
    .subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe(new Action1<InputStream>() {
    	@Override
    	public void call(InputStream inputStream) { ... }
    }, new Action1<Throwable>() {
    	@Override
    	public void call(Throwable throwable) { ... }
    });

Gradle

Add in your root build.gradle:

repositories {
	jcenter()
}

Add in your app build.gradle the dependency:

dependencies {
  ...
  compile 'com.francescocervone:rxdrive:0.2'
}
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].