https://github.com/bmfe/android-eros-plugin-simple
https://github.com/bmfe/android-eros-plugin-simple
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/bmfe/android-eros-plugin-simple
- Owner: bmfe
- Created: 2018-05-04T02:48:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-09T06:09:02.000Z (over 7 years ago)
- Last Synced: 2025-04-09T10:27:36.587Z (about 1 year ago)
- Language: Java
- Size: 141 KB
- Stars: 8
- Watchers: 5
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Android Eros plugin Sample
** Android 插件Sample **
* 插件 简单封装了一个 Module helloplugin 一个简单的弹出Toast操作。
* 使用
```
var helloplugin = weex.requireModule('helloplugin')
```
```js
helloplugin.hello()
```
* 插件的封装方法
* 1、直接在项目中new 一个Module 如图:
图1
图2
图3
图4
* 2、将新创建的 Module 依赖进项目 如图。
图5
* 3、修改 Module 的 build.gradle 文件。
一定要依赖:
``` java
implementation 'com.github.bmfe.eros-nexus:nexus:1.0.1'
```
图6
> 具体可参考如图6, 也可以下载此sample 查看,完事儿以后点击右上角 sync now 等待完成即可.
> implementation 'com.github.bmfe.eros-nexus:nexus:1.0.1', 库
依赖请参考最新版本 自行修改。
* 4、后面您可以随意写您的插件逻辑了, 集体 的注册可以参考 `sample` 中的 ErosPluginSample.