campusappcn / androuter Goto Github PK
View Code? Open in Web Editor NEWA android router framework used to map url to activities or actions.
A android router framework used to map url to activities or actions.
我想要获取对应的activiy,在通知中使用
ActivityRoute activityRoute = (ActivityRoute) Router.getRoute(“mainurl”);
为何 activityRoute.getActivity() == null?
怎么样获取对应的activity类呢??
因为有moudle如果使用注解无法获取到moudle的注解
目前AndRouter使用RouterManager这个全局变量用来保存所有的Router,该单例在Application的onCreate中被初始化,需要考虑RouterManager被系统回收的问题。
Now the AndRouter seems only support Activity switch support.
Maybe the schema can be more functional, such as we can use schema to open a Dialog or just execute some function codes with simple API. Hope AndRouter can support this feature.
Error:Could not find com.github.campusappcn.AndRouter:compiler:1.2.4.
Searched in the following locations:
file:/D:/Mobile/Android/android-sdk/extras/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.4/compiler-1.2.4.pom
file:/D:/Mobile/Android/android-sdk/extras/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.4/compiler-1.2.4.jar
file:/D:/Mobile/Android/android-sdk/extras/google/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.4/compiler-1.2.4.pom
file:/D:/Mobile/Android/android-sdk/extras/google/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.4/compiler-1.2.4.jar
file:/D:/Mobile/Android/android-sdk/extras/android/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.4/compiler-1.2.4.pom
file:/D:/Mobile/Android/android-sdk/extras/android/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.4/compiler-1.2.4.jar
file:/D:/Program Files/Android/Android Studio/gradle/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.4/compiler-1.2.4.pom
file:/D:/Program Files/Android/Android Studio/gradle/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.4/compiler-1.2.4.jar
https://jcenter.bintray.com/com/github/campusappcn/AndRouter/compiler/1.2.4/compiler-1.2.4.pom
https://jcenter.bintray.com/com/github/campusappcn/AndRouter/compiler/1.2.4/compiler-1.2.4.jar
Required by:
MposFramework:MposFrameworkPay:unspecified
我把1.2.4改成1.2.7也是类似提示
compile 'com.github.campusappcn.AndRouter:router:1.2.4'
apt 'com.github.campusappcn.AndRouter:compiler:1.2.4'
hi,. 我们集成总是提示找不到 compiler 这个包, 错误如下:
Error:Could not find com.github.campusappcn.AndRouter:compiler:1.2.5.
Searched in the following locations:
file:/D:/Android/Android Studio/gradle/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.5/compiler-1.2.5.pom
file:/D:/Android/Android Studio/gradle/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.5/compiler-1.2.5.jar
https://jcenter.bintray.com/com/github/campusappcn/AndRouter/compiler/1.2.5/compiler-1.2.5.pom
https://jcenter.bintray.com/com/github/campusappcn/AndRouter/compiler/1.2.5/compiler-1.2.5.jar
file:/D:/Android/sdk/extras/android/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.5/compiler-1.2.5.pom
file:/D:/Android/sdk/extras/android/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.5/compiler-1.2.5.jar
file:/D:/Android/sdk/extras/google/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.5/compiler-1.2.5.pom
file:/D:/Android/sdk/extras/google/m2repository/com/github/campusappcn/AndRouter/compiler/1.2.5/compiler-1.2.5.jar
Required by:
com.licaigc:library:0.6.0
我们的 gradle 文件:
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
...
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
apply plugin: 'android-apt'
...
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
minSdkVersion 12
targetSdkVersion 23
...
}
....
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
...
compile 'com.github.campusappcn.AndRouter:router:1.2.5'
apt 'com.github.campusappcn.AndRouter:compiler:1.2.5'
}
我看了 JitPack 上 1.2.5 版本的 log, 貌似也输出了这个文件. 不知道为什么, 是哪里没配置好呢?
getRoute(url)
如果scheme不匹配那么就会返回一个null。
后续操作就会蹦了。
建议返回一个空的Route,不至于会崩溃。
how i can support deeplinking using your library
大神,com.github.dcendents:android-maven-gradle-plugin:1.3插件加载不下来,要怎么解决
Error:A problem occurred configuring root project 'AndRouter'.
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve com.github.dcendents:android-maven-gradle-plugin:1.3.
Required by:
:AndRouter:unspecified
> Could not resolve com.github.dcendents:android-maven-gradle-plugin:1.3.
> Could not get resource 'https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.3/android-maven-gradle-plugin-1.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.3/android-maven-gradle-plugin-1.3.pom'.
> Connection to http://192.168.3.99:7777 refused
支持多个module吗
android studio 升级到2.3beta2 后,本来编译正常的项目,由于使用apt, 一直提示不兼容之类的警告,然后编译通不过,各种奇怪问题。
后来我将gradle plugin使用旧版(2.2.3,无法使用instant run)不存在问题。
当然不排除是android studio 新版本身的一些问题。作者有时间的话可以关注下
Hi!
router.put("fragment://second/:{name}", SecondFragment.class);
will work?
Activity的调用栈对于开发者来说是很重要的信息,如果把页面跳转交给Router来做,Router可以很方便的维护Activity间跳转的信息,所以提供该信息给用户很有必要。
每次手写注解挺烦的,所以想到用到Android studio的模板来自动生成。
pwd:Android Studio.app/Contents/plugins/android/lib/templates/activities/
copy EmptyActivity -> RouterMapActivity
修改RouterMapActivity/template.xml
<template
format="5"
revision="5"
name="RouterMap Activity"
minApi="9"
minBuildApi="14"
description="Creates a new empty RouterMap activity">
修改RouterMapActivity/root/src/app_package/SimpleActivity.java.ftl
@RouterMap("activity://${activityClass}")
public class ${activityClass} extends ${superClass} {
重启AndroidStudio。新建Activity选择RouterMapActivity。
比如activity://firstActivity?url=http://fete#12f
但是activity中url得到的值为http://fete
能否改为Class 继承 AppCompatActivity 现在基本上都是继承于AppCompatActivity
public interface IActivityRouteTableInitializer {
void initRouterTable(Map<String, Class<? extends Activity>> var1);
}
public interface IActivityRouteTableInitializer {
void initRouterTable(Map<String, Class<? extends AppCompatActivity>> var1);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.