Voltar ao ranking

JessYanCoding/RetrofitUrlManager

Java

🔮 Let Retrofit support multiple baseUrl and can be change the baseUrl at runtime (以最简洁的 Api 让 Retrofit 同时支持多个 BaseUrl 以及动态改变 BaseUrl).

retrofit2baseurlbaseurl-domainmvparmsarmsretrofitokhttpokhttp3
Crescimento de estrelas
Estrelas
2.2k
Forks
305
Crescimento semanal
Issues
12
1k2k
jul. de 2017jul. de 2020jul. de 2023jul. de 2026
ArtefatosMavengit clone https://github.com/JessYanCoding/RetrofitUrlManager.git
README

RetrofitUrlManager

Jcenter Build Status Android Arsenal API License Author QQ-Group

Let Retrofit support multiple baseUrl and can be change the baseUrl at runtime.

中文说明

Overview

overview

Notice

Framework analysis 1

Framework analysis 2

More complete sample

Download

 implementation 'me.jessyan:retrofit-url-manager:1.4.0'

Usage

Initialize

 // When building OkHttpClient, the OkHttpClient.Builder() is passed to the with() method to initialize the configuration
 OkHttpClient = RetrofitUrlManager.getInstance().with(new OkHttpClient.Builder())
                .build();

Step 1

 public interface ApiService {
     @Headers({"Domain-Name: douban"}) // Add the Domain-Name header
     @GET("/v2/book/{id}")
     Observable<ResponseBody> getBook(@Path("id") int id);
}

Step 2

 // You can change BaseUrl at any time while App is running (The interface that declared the Domain-Name header)
 RetrofitUrlManager.getInstance().putDomain("douban", "https://api.douban.com");

If you want to change the global BaseUrl:

 // BaseUrl configured in the Domain-Name header will override BaseUrl in the global setting
 RetrofitUrlManager.getInstance().setGlobalDomain("your BaseUrl");

About Me

License

 Copyright 2017, jessyan

   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.
Repositórios relacionados
yuliskov/SmartTube

Browse media content with your own rules on Android TV

JavaMavenMIT Licenseandroidandroid-tv
smarttubeapp.github.io
31.4k1.8k
JessYanCoding/MVPArms

⚔️ A common architecture for Android applications developing based on MVP, integrates many open source projects, to make your developing quicker and easier (一个整合了大量主流开源项目高度可配置化的 Android MVP 快速集成框架).

JavaMavenApache License 2.0mvprxjava
10.2k2.4k
goldze/MVVMHabit

👕基于谷歌最新AAC架构,MVVM设计模式的一套快速开发库,整合Okhttp+RxJava+Retrofit+Glide等主流模块,满足日常开发需求。使用该框架可以快速开发一个高质量、易维护的Android应用。

JavaMavenApache License 2.0mvvmdatabinding
7.7k1.7k
smuyyh/BookReader

:closed_book: "任阅" 网络小说阅读器,3D翻页效果、txt/pdf/epub书籍阅读、Wifi传书~

JavaMavenApache License 2.0readerbookreader
6.9k1.9k
youlookwhat/CloudReader

🗡️ 云阅:一款基于网易云音乐UI,使用玩Android Api,Retrofit2 + RxJava2 + Room + MVVM-databinding架构开发的Android客户端

JavaMavenApache License 2.0androidmvvm-databing
youlookwhat.github.io/CloudReader
5k1.3k
HotBitmapGG/bilibili-android-client

An unofficial bilibili client for android http://www.jianshu.com/p/f69a55b94c05 -- 该项目已停止维护!

JavaMavenDo What The F*ck You Want To Public Licenseijkplayerandroid
4.5k1.5k
liujingxing/rxhttp

🔥🔥🔥 Based on OkHttp encapsulation, support Kotlin Coroutines、RxJava2、RxJava3; 30s to get started.

KotlinApache License 2.0andriodkotlin-coroutines
juejin.im/post/5ded221a518825125d14a1d4
3.8k461
git-xuhao/KotlinMvp

:fire: 基于Kotlin+MVP+Retrofit+RxJava+Glide 等架构实现短视频类小项目,简约风格及详细注释,欢迎 star or fork!

KotlinApache License 2.0kotlin-androidkotlin-mvp
xuhaoblog.com/KotlinMvp
3.7k907
xcc3641/SeeWeather

:partly_sunny: [@Deprecated]RxJava+RxBus+Retrofit+Glide+Material Design Weather App

JavaMavenApache License 2.0materialweather
fir.im/seeWeather
3.4k710
zhou-you/RxEasyHttp

本库是一款基于RxJava2+Retrofit2实现简单易用的网络请求框架,结合android平台特性的网络封装库,采用api链式调用一点到底,集成cookie管理,多种缓存模式,极简https配置,上传下载进度显示,请求错误自动重试,请求携带token、时间戳、签名sign动态配置,自动登录成功后请求重发功能,3种层次的参数设置默认全局局部,默认标准ApiResult同时可以支持自定义的数据结构,已经能满足现在的大部分网络请求。

JavaMavenApache License 2.0rxjavaretrofit2
3.2k606
mxdldev/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项目开发框架,以便把主要的精力放在自己的项目的业务功能实现上,另外在长期的工作实践中总结整理大量的实用工具类在项目lib_common组件的util包当中方便大家调用。

JavaMavenApache License 2.0mvp-androidandroidmodule
menxindiaolong.blog.csdn.net/article/details/94975829
3.2k553
JsonChao/Awesome-WanAndroid

:zap:致力于打造一款极致体验的 http://www.wanandroid.com/ 客户端,知识和美是可以并存的哦QAQn(*≧▽≦*)n

JavaMavenApache License 2.0rxjava2retrofit2
2.7k594