Android Page Routing Framework--arouter

Source: Internet
Author: User

In peacetime development, we often use the page jump function. I've been using intent to jump before.

Intent intent = new Intent(A.this, B.class);intent.putExtra("key","value");startActivity(intent);

最近看到有大牛使用ARouter,专门了解一下,弄个简单入门的demo



   A android router middleware that help app navigating to activities and custom services.
    1. Supports direct parsing of standard URLs for jumps, and automatically injects parameters into the target page
    2. Support multi-Module engineering use
    3. Support for adding multiple interceptors, custom intercept order
    4. Supports dependency injection and can be used as a dependency injection framework alone
    5. Support Instantrun
    6. Support for Multidex (Google solutions)
    7. Mapping relationships by group, multilevel management, on-demand initialization
    8. Supports user-specified global demotion and local demotion policies
    9. Pages, interceptors, services, and other components are automatically registered to the framework
    10. Supports multiple ways to configure transition animations
    11. Support for Fragment
    12. Full support for Kotlin and mixed (configuration see other at the end of the article)

Steps to use:

1. Configure Build.gradle:

Add in defaultconfig

Arouter (Android page routing framework)
javacompileoptions {
annotationprocessoroptions {
arguments = [ModuleName:project.getName ()]
}
}

Dependencies
Arouter (Android page routing framework) Https://github.com/alibaba/ARouter
Compile ' com.alibaba:arouter-api:1.2.2 '
Annotationprocessor ' com.alibaba:arouter-compiler:1.1.3 '


2. add annotations to all pages that support routing:
@Route (path=myarouter.mainactivity)

3. Initialize the SDK in application:

4.ARouter initiating page Jump

Demo Link: Https://github.com/HeavenDong/ARouterDemo
Alibaba Open Source 有更详细的使用 : Https://github.com/alibaba/arouter

 
 

Android Page Routing Framework--arouter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.