All Projects → andydevacc → Retrofitlifecycle

andydevacc / Retrofitlifecycle

Manage retrofit call's lifecycle with proxy class which generated by annotation

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Retrofitlifecycle

Relax
☘☘Relax 基于Kotlin语言编写的一套组件化框架,不紧整体组件化、内部也高度组件化🎋你可配置MVP、MVVM的开发模式、也可以配置所需要的业务组件🍁🍁
Stars: ✭ 253 (+212.35%)
Mutual labels:  lifecycle, retrofit
Tdcapp
Sample app which access the TDC (The Developer's Conference) REST API.
Stars: ✭ 55 (-32.1%)
Mutual labels:  lifecycle, retrofit
Jetpackmvvm
🐔🏀一个Jetpack结合MVVM的快速开发框架,基于MVVM模式集成谷歌官方推荐的JetPack组件库:LiveData、ViewModel、Lifecycle、Navigation组件 使用Kotlin语言,添加大量拓展函数,简化代码 加入Retrofit网络请求,协程,帮你简化各种操作,让你快速开发项目
Stars: ✭ 1,100 (+1258.02%)
Mutual labels:  lifecycle, retrofit
Aachulk
️🔥️🔥️🔥AACHulk是以Google的ViewModel+DataBinding+LiveData+Lifecycles框架为基础, 结合Okhttp+Retrofit+BaseRecyclerViewAdapterHelper+SmartRefreshLayout+ARouter打造的一款快速MVVM开发框架
Stars: ✭ 109 (+34.57%)
Mutual labels:  lifecycle, retrofit
AndroidGo
Android、Flutter 开发者帮助 APP。包含事件分发、性能分析、Google Jetpack组件、OkHttp、RxJava、Retrofit、Volley、Canvas绘制以及优秀博文代码案例等内容,帮助开发者快速上手!
Stars: ✭ 30 (-62.96%)
Mutual labels:  retrofit, lifecycle
Mvvmhabit
goldze: 本人喜欢尝试新的技术,以后发现有好用的东西,我将会在企业项目中实战,没有问题了就会把它引入到MVVMHabit中,一直维护着这套框架,谢谢各位朋友的支持。如果觉得这套框架不错的话,麻烦点个 star,你的支持则是我前进的动力!
Stars: ✭ 6,789 (+8281.48%)
Mutual labels:  lifecycle, retrofit
Mvvmhabitcomponent
👕基于MVVMHabit框架,结合阿里ARouter打造的一套Android MVVM组件化开发方案
Stars: ✭ 857 (+958.02%)
Mutual labels:  lifecycle, retrofit
S Mvp
🔥🔥优化版MVP,使用注解泛型简化代码编写,使用模块化协议方便维护,APT过程使用注解解析器利用JavaPoet🌝完成重复模块的编写,利用ASpect+GradlePlugin 完成横向AOP编程+Javassist动态字节码注入+Tinker实现热修复+Retrofit实现优雅网络操作+RxJava轻松玩转数据处理
Stars: ✭ 1,095 (+1251.85%)
Mutual labels:  lifecycle
Neonion
neonion is a user-centered collaborative semantic annotation webapp developed at the Human-Centered Computing group at Freie Universität Berlin.
Stars: ✭ 65 (-19.75%)
Mutual labels:  annotation
Leaflet Swoopy
⤵️ Swoopy Arrow Plugin for Leaflet
Stars: ✭ 52 (-35.8%)
Mutual labels:  annotation
Android Arch Components Lifecycle
A demo application showcasing the use of the new Android Architecture Components Lifecycle classes. In this example, a Lifecycle Aware Video Player is created using the Exoplayer Library
Stars: ✭ 49 (-39.51%)
Mutual labels:  lifecycle
Easychatandroidclient
EasyChat是一个开源的社交类的App。主要包含消息、好友、群组等相关的IM核心功能。部分界面参照了QQ、微信等相关社交APP。EasyChat APP整体采用MVVM模式,基于JetPack(Lifecycle,LiveData,ViewModel,Room)构建
Stars: ✭ 64 (-20.99%)
Mutual labels:  lifecycle
Ff annotation route
Provide route generator to create route map quickly by annotations.
Stars: ✭ 80 (-1.23%)
Mutual labels:  annotation
Annotationkit
The annotation implementation using Objective-C
Stars: ✭ 68 (-16.05%)
Mutual labels:  lifecycle
Fetch
The best file downloader library for Android
Stars: ✭ 1,124 (+1287.65%)
Mutual labels:  retrofit
Awesome Annotation Tools
A curated list of awesome data annotation tools
Stars: ✭ 54 (-33.33%)
Mutual labels:  annotation
Vscode Highlight
Advanced text highlighter based on regexes. Useful for todos, annotations etc.
Stars: ✭ 71 (-12.35%)
Mutual labels:  annotation
Awesome Android Kotlin Apps
👓 A curated list of awesome android kotlin apps by open-source contributors.
Stars: ✭ 1,058 (+1206.17%)
Mutual labels:  retrofit
Awesome Data Labeling
A curated list of awesome data labeling tools
Stars: ✭ 1,120 (+1282.72%)
Mutual labels:  annotation
Node Bmw Client
A node.js powered interface for E38/E39/E53 + E6x/E9x BMW vehicles (Client side)
Stars: ✭ 68 (-16.05%)
Mutual labels:  retrofit

RetrofitLifecycle

RetrofitLifecycle manage retrofit call's lifecycle with proxy class which generated by annotation.

Usage

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency

dependencies {
    compile 'com.github.luckyandyzhang.RetrofitLifecycle:retrofit-lifecycle:1.0.1'
    annotationProcessor 'com.github.luckyandyzhang.RetrofitLifecycle:retrofit-lifecycle-compiler:1.0.1'
}	

Use @RetrofitInterface on retrofit interface:

@RetrofitInterface
public interface GankAPI {
    @GET("data/Android/10/1")
    Call<ResponseBody> getGankList();
}

Get proxy class and use it:

GankAPI gankAPI = new Retrofit.Builder()
        .addConverterFactory(GsonConverterFactory.create())
        .baseUrl("http://gank.io/api/")
        .build()
        .create(GankAPI.class);
//get proxy class
GankAPI gankAPIProxy = RetrofitLifecycle.getProxyInterface(GankAPI.class, gankAPI);
//use proxy class to reqeust
gankAPIProxy.getGankList().enqueue(new Callback<ResponseBody>() {
    @Override
    public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {

    }

    @Override
    public void onFailure(Call<ResponseBody> call, Throwable t) {

    }
});
//cancel all calls
RetrofitLifecycle.cancelAll(gankAPIProxy);

For additional information see sample module :)

License

Copyright 2017 Andy

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