A router generator for Android, similar to retrofit.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
sample Upgrade stuffs Jan 27, 2019
.gitignore Initial commit Apr 18, 2017
.travis.yml Add jacoco test & ci config Feb 1, 2019
LICENSE Initial commit Apr 18, 2017
build.gradle Add dependencies of test libs Jan 27, 2019
gradle.properties Upgrade stuffs Jan 27, 2019
gradlew Initial commit Apr 18, 2017
settings.gradle Initial commit Apr 18, 2017



Build Status codecov

Meepo is a router generator for android, similar to retrofit. You can use it to create routers for Activities, Fragments and even any things.


Replace the ${last-version} in below code to number Release .

repositories {
    maven { url "https://jitpack.io" }
dependencies {
    implementation "com.github.nekocode:Meepo:${last-version}"


Firstly, declare a router interface:

public interface Router {
    boolean gotoUserDetail(Context context, @PathParam("user_id") String userId, 
                           @QueryParam("show_title") boolean showTitle);

    void gotoB(Context context, @BundleParam("title") String title,
               @RequestCodeParam int requestCode);

If you want to open your Activity via URI, you need to add a uri intent filter to the corresponding <activity> element in the manifest file:

<activity android:name=".UserDetailActivity">
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>


And then obtain an implementation of your router interface:

final Meepo meepo = new Meepo.Builder()
        .config(new UriConfig().scheme("meepo").host("meepo.com"))

final Router router = meepo.create(Router.class);

Now, you can invoke the router's navigation methods:

boolean isSucess = router.gotoUserDetail(this, "123", true);

Router Annotation

This library currently provides the following annotations:

Method Annotation Description
@Clazz Class of target Activity
@ClazzName Class name of target Activity
@Path URI path and mime type of target Activity
@Action Action of Intent
@Flags Flags of Intent
@RequestCode Request code of Intent
Parameter Annotation Description
@BundleParam Parameter that will be put into the extra of Intent
@PathParam Parameter that will be used to replace the URI path's corresponding replacement block
@QueryParam Query parameter of the URI
@QueryMapParam Map of Query parameters
@RequestCodeParam Request code of Intent

Custom Parser and CallAdapter

You can create custom Parser and CallAdapter. You can reference the sample module. It means that you can create router for anything.

final ModuleRouter moduleRouter = new Meepo.Builder()
        .config(new ModuleConfig("TEST"))
        .parser(new ModuleParser())
        .adapter(new ModuleCallAdapter())