All Projects → RoRoche → Iris

RoRoche / Iris

Licence: apache-2.0
Convenient wrapper library to perform network queries using Retrofit and Android Priority Job Queue (Job Manager)

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Iris

AndroidStarterAlt
A sample View-based Android app using the MVP architecture. It uses Mosby, Dagger2, RxJava, retrofit, LoganSquare, requery, EventBus, Conductor.
Stars: ✭ 27 (+58.82%)
Mutual labels:  eventbus, dagger2, retrofit2
Githubarchitecturecomponents
The implementation of Android "Architecture Components" sample explained by Google : https://developer.android.com/topic/libraries/architecture/guide.html
Stars: ✭ 302 (+1676.47%)
Mutual labels:  dagger2, retrofit2
News
A sample News 🗞 app built using Modern Android Development [Architecture Components, Coroutines, Retrofit, Room, Kotlin, Dagger]
Stars: ✭ 774 (+4452.94%)
Mutual labels:  dagger2, retrofit2
News Sample App
A sample news app which demonstrates clean architecture and best practices for developing android app
Stars: ✭ 334 (+1864.71%)
Mutual labels:  dagger2, retrofit2
Kotlin Android Mvvm Starter
Android Kotlin Starter is a starter project which implements MVVM Pattern.
Stars: ✭ 276 (+1523.53%)
Mutual labels:  dagger2, retrofit2
Tvflix
TvFlix android app using Dagger Hilt, Coroutines, Flow, KTX, Jetpack(Room, ViewModel, Paging3, Lifecycle) based on MVVM architecture purely written in Kotlin
Stars: ✭ 286 (+1582.35%)
Mutual labels:  dagger2, retrofit2
Moviehub
Showcases popular movies, tv shows, and people from The Movie Database
Stars: ✭ 325 (+1811.76%)
Mutual labels:  dagger2, retrofit2
Clean Notes
Clean Architecture by layer
Stars: ✭ 259 (+1423.53%)
Mutual labels:  dagger2, retrofit2
Devring
安卓基础开发库,包含各常用模块,让开发简单点。
Stars: ✭ 414 (+2335.29%)
Mutual labels:  eventbus, retrofit2
Mvvmarms
Android MVVM Architecture Components based on MVPArms and Android Architecture Components.
Stars: ✭ 425 (+2400%)
Mutual labels:  dagger2, retrofit2
Bilisoleil
An unofficial bilibili client for android --rxjava2+mvp+okhttp3+retrofit2+dagger2
Stars: ✭ 430 (+2429.41%)
Mutual labels:  dagger2, retrofit2
Mvp Dagger2 Rxjava2
Android 基本mvp+dagger(dagger2.android)+rxjava2+retrofit+ormdb框架。简单组件化架构 with Base Activity,Presenter ,View,Model 的抽象封装,http 请求封装&错误统一处理
Stars: ✭ 274 (+1511.76%)
Mutual labels:  dagger2, retrofit2
Kotlin Android Mvp Starter
Create/Generate your kotlin MVP projects easily
Stars: ✭ 270 (+1488.24%)
Mutual labels:  dagger2, retrofit2
Crazydaily
[开源项目] 一款程序员日常放松的App,基于Material Design + MVP-Clean + Weex + Flutter + RxJava2 + Retrofit + Dagger2 + Glide + Okhttp + MTRVA + BRVAH + 炫酷控件 + 炫酷动画
Stars: ✭ 294 (+1629.41%)
Mutual labels:  dagger2, retrofit2
Android Mvp Mvvm Flytour
🔥🔥🔥 FlyTour是Android MVVM+MVP+Dagger2+Retrofit+RxJava+组件化+插件组成的双编码架构+双工程架构+双语言Android应用开发框架,通过不断的升级迭代该框架已经有了十个不同的版本,5.0之前工程架构采用gradle配置实现组件化,5.0之后的工程架构采用VirtualAPK实现了插件化,5.0之前采用Java编码实现,5.0之后采用Kotlin编码实现,编码架构由MVVM和MVP组成,工程架构和编码架构及编码语言开发者可根据自己具体的项目实际需求去决定选择使用,该框架是Android组件化、Android插件化、Android MVP架构、Android MVVM架构的集大成者,帮助你快速的搭建自己的App项目开发框架,以便把主要的精…
Stars: ✭ 2,948 (+17241.18%)
Mutual labels:  dagger2, retrofit2
Open Api Android App
Kotlin, MVI Architecture, Dagger2, Retrofit2, Coroutines, Room Persistence, REST API, Token Authentication
Stars: ✭ 324 (+1805.88%)
Mutual labels:  dagger2, retrofit2
Wanandroid
🐔🏀【停止维护,已使用Jetpack+Mvvm重构】根据鸿神提供的WanAndroid开放Api来制作的产品级玩安卓App,采用Kotlin语言,基于Material Design+AndroidX +MVP+RxJava+Retrofit等框架开发,注释超详细,方便大家练手
Stars: ✭ 674 (+3864.71%)
Mutual labels:  dagger2, retrofit2
searchi
Demo of PagedListAdapter, PageKeyedDataSource, LiveData, ViewModel in Kotlin
Stars: ✭ 13 (-23.53%)
Mutual labels:  dagger2, retrofit2
Kotlin Modular Tdd Coroutines Mvvm
A sample Kotlin app which was built with modular structure, Kotlin DSL, Kotlin Coroutines, TDD and MVVM patterns.
Stars: ✭ 256 (+1405.88%)
Mutual labels:  dagger2, retrofit2
Wanandroid
🏄 基于Architecture Components dependencies (Lifecycles,LiveData,ViewModel,Room)构建的WanAndroid开源项目。 你值得拥有的MVVM快速开发框架:https://github.com/jenly1314/MVVMFrame
Stars: ✭ 410 (+2311.76%)
Mutual labels:  dagger2, retrofit2

Iris

Convenient wrapper library to perform network queries using Retrofit and Android Priority Job Queue (Job Manager)

Android Arsenal

STILL IN DEVELOPMENT

logo

Dependency

In the top-level build.gradle file:

buildscript {
    dependencies {
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    }
}

In the project build.gradle file:

apply plugin: 'com.neenbedankt.android-apt'

repositories {
    maven {
        url 'https://dl.bintray.com/guddy/maven/'
    }
}

dependencies {
    compile 'fr.guddy.iris:iris:0.0.7'
    apt 'fr.guddy.iris:compiler:0.0.7'
}

How to use the Iris compiler

  • Create a retrofit interface as usual
public interface ApiService {
    @GET("users/{user}/repos")
    Call<List<RepoDTO>> listRepos(@NonNull @Path("user") final String user);
}

Supported annotations are @DELETE, @GET, @HEADER, @HTTP, @PATCH, @POST, @PUT.

  • The annotation processor will generate the following query class:
public abstract class AbstractQueryListRepos extends AbstractQuery<List<RepoDTO>> {
  public final String user;

  private transient List<RepoDTO> mResult;

  protected AbstractQueryListRepos(final Params params, final String user) {
    super(params);
    this.user = user;
  }

  public List<RepoDTO> getResult() {
    return mResult;
  }

  @Override
  protected void execute() throws Throwable {
    mResponse = getApiService().listRepos(user).execute();
    mResult = mResponse.body();
  }

  @Override
  protected void onQueryDidFinish() {
  }

  protected abstract ApiService getApiService();

  public static final class EventQueryListReposDidFinish extends AbstractEventQueryDidFinish<AbstractQueryListRepos> {
    public EventQueryListReposDidFinish(final AbstractQueryListRepos query) {
      super(query);
    }
  }
}
  • The annotation processor will generate the following query class:
public class ApiServiceQueryFactory extends AbstractQueryFactory {
  public ApiServiceQueryFactory(final JobManager pJobManager, final MerlinsBeard pMerlinsBeard) {
    super(pJobManager, pMerlinsBeard);
  }

  public boolean startAbstractQueryListRepos(final AbstractQueryListRepos pQuery) {
    return startQuery(pQuery);
  }
}
  • now just subclass AbstractQueryListRepos as follows to provide the ApiService instance and deal with query ending:
public class QueryListRepos extends AbstractQueryListRepos {

    public QueryListRepos(@NonNull final String pUser) {
        super(new Params(1), pUser);
    }

    @Override
    protected ApiService getApiService() {
        return IrisApplication.getInstance()
                .getApplicationComponent()
                .apiService();
    }

    @Override
    protected void onQueryDidFinish() {
        IrisApplication.getInstance()
                .getApplicationComponent()
                .eventBus()
                .post(new EventQueryListReposDidFinish(this));
    }
}
  • start the query using the factory and test if it's return true or false:
if(queryFactory.startAbstractQueryListRepos(new QueryListRepos("RoRoche"))) {
  // query started
} else {
  // no network and not a persistent query
}

How to use Iris standalone (i.e., without its compiler)

  • Subclass AbstractQuery
public class QueryGetRepos extends AbstractQuery<List<RepoDTO>> {

    public final String user;

    public QueryGetRepos(@NonNull final String pUser) {
        super(new Params(1));
        user = pUser;
    }

    @Override
    protected void execute() throws Throwable {
        // TODO perform network query thanks to retrofit
    }

    @Override
    protected void onQueryDidFinish() {
        // TODO deal with results
    }
}
  • Subclass AbstractEventQueryDidFinish
public static final class EventQueryGetReposDidFinish extends AbstractEventQueryDidFinish<QueryGetRepos> {
    public EventQueryGetReposDidFinish(final QueryGetRepos pQuery) {
        super(pQuery);
    }
}
  • Subclass AbstractQueryFactory :
public class QueryFactory extends AbstractQueryFactory {
    public QueryFactory(final JobManager pJobManager, final MerlinsBeard pMerlinsBeard) {
        super(pJobManager, pMerlinsBeard);
    }

    public boolean startQueryListRepos(@NonNull final String pUser) {
        return startQuery(new QueryListRepos(pUser));
    }
}

Benefits

  • processing the retrofit interface, the compiler generates all of the boilerplate code
  • developer can focus on the specific job to do when the HTTP request is finished (for example: save data to local storage, by overriding the execute method)
  • the "Iris" library can be used without its compiler
  • it improves the network layer with a normalized structure
  • it's DI ready (cf. sample app using Dagger2)
  • it's Event-buses ready (cf. sample app using greenrobot's EventBus)

Logo credits

Nature graphic by Freepik from Flaticon is licensed under CC BY 3.0. Made with Logo Maker

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