1.下载官网demo  https://github.com/Qihoo360/RePlugin/tree/master

2.创建宿主程序 host

(1)build.gradl (Project)


buildscript {{ p, cfg = "rp-config.gradle" -> if (new File(p, cfg).exists()) apply from: "${p}/${cfg}" else if (p.exists()) call(p.parentFile) }(buildscript.sourceFile.parentFile)repositories {maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}}dependencies {classpath 'com.android.tools.build:gradle:3.0.0'classpath "com.qihoo360.replugin:replugin-host-gradle:${RP_VERSION}"}
}allprojects {repositories {maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}}
}task clean(type: Delete) {delete rootProject.buildDir
}

(2) build.gradle(module)

apply plugin: 'replugin-host-gradle'
repluginHostConfig {useAppCompat = true// 可以在这里自定义常驻进程的名字// persistentName = ":XXXXService"
}dependencies {compile fileTree(include: ['*.jar'], dir: 'libs')compile 'com.android.support:appcompat-v7:26.0.0-beta1'compile "com.qihoo360.replugin:replugin-host-lib:${RP_VERSION}"
}

3.创建插件PluginA

(1)build.gradle(Project)


buildscript {{ p, cfg = "rp-config.gradle" -> if (new File(p, cfg).exists()) apply from: "${p}/${cfg}" else if (p.exists()) call(p.parentFile) }(buildscript.sourceFile.parentFile)repositories {maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}}dependencies {classpath 'com.android.tools.build:gradle:3.0.0'classpath "com.qihoo360.replugin:replugin-host-gradle:${RP_VERSION}"}
}allprojects {repositories {maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}}
}task clean(type: Delete) {delete rootProject.buildDir
}

(2)build.gradle(module)


// 这个plugin需要放在android配置之后,因为需要读取android中的配置项
apply plugin: 'replugin-plugin-gradle'
repluginPluginConfig {pluginName = "demo3"hostApplicationId = "com.xxx.xxx"hostAppLauncherActivity = "com.xxx.xxx.MainActivity"
}dependencies {compile fileTree(include: ['*.jar'], dir: 'libs')compile 'com.android.support:appcompat-v7:26.0.0-beta1'compile "com.qihoo360.replugin:replugin-plugin-lib:${RP_VERSION}"//    /** provided or compile */
//    if (rootProject.ext.isPlugin) {
//        // 作为插件,provided 方式引入
//        provided "com.parse.bolts:bolts-android:1.4.0"
//        provided files('libs/drawee-modified-1.7.1.jar')
//        provided files('libs/fbcore-1.7.1.jar')
//        provided files('libs/fresco-1.7.1.jar')
//        provided files('libs/imagepipeline-1.7.1.jar')
//        provided files('libs/imagepipeline-base-1.7.1.jar')
//    } else {
//        // 作为单品,compile 进 APK
//        compile "com.parse.bolts:bolts-android:1.4.0"
//
//        compile files('libs/fresco-1.7.1.jar')
//        compile files('libs/fbcore-1.7.1.jar')
//        compile files('libs/drawee-modified-1.7.1.jar')
//        compile files('libs/imagepipeline-1.7.1.jar')
//        compile files('libs/imagepipeline-base-1.7.1.jar')
//    }
}

通过demo可以看到  宿主启动  插件 apk 可以使用如下代码,

simulateInstallExternalPlugin 方法需放在子线程中
  if (RePlugin.isPluginInstalled("demo3")) {RePlugin.startActivity(MainActivity.this, RePlugin.createIntent("demo3", "com.sinoiov.driver.login.register.MainActivity"));} else {InstallApkUtil.simulateInstallExternalPlugin(MainActivity.this);}

10分钟快速集成360 RePlugin相关推荐

  1. python的spider程序下载_PHPspider爬虫10分钟快速教程(内附python教程分享)

    说到做爬虫,大家都可能第一时间想到的是python,其实php也是可以用来写爬虫程序的.php一贯简洁.易用,亲测使用PHPspider框架10分钟就能写出一个简单的爬虫程序. 一.PHP环境安装 和 ...

  2. python爬虫十分钟速学教程_PHPspider爬虫10分钟快速教程

    说到做爬虫,大家都可能第一时间想到的是python,其实php也是可以用来写爬虫程序的.php一贯简洁.易用,亲测使用PHPspider框架10分钟就能写出一个简单的爬虫程序. 一.PHP环境安装 和 ...

  3. 10分钟快速配置sublime2支持jQuery开发

    昨天介绍了javascript的开发工具sublime 2 edit,今天我们将介绍如何10分钟快速配置sublime2支持jQuery开发.希望大家能喜欢着款jQuery开发工具. 相关介绍:使用s ...

  4. 转载文章-【工具】10分钟快速搭建属于自己的文档网站-来自掘金

    掘金 首页 探索掘金 搜索 lvhanghmm的头像 Gopal lv-4 2021年03月09日 阅读 9930 关注 [工具]10分钟快速搭建属于自己的文档网站 前言 很多同学都希望能够拥有自己的 ...

  5. 文字识别软件测试初学者,【只要10分钟 快速掌握文字识别】

    [只要10分钟 快速掌握文字识别] 教程 1.获取接口权限       2.下载接口调用工具       3.进行接口调用 具体步骤如下: 1.获取接口权限 1.1  登录网址:ai.baidu.co ...

  6. 【华为云技术分享】10分钟快速在华为云鲲鹏弹性云服务器上部署一个自己的弹幕网站!

    摘要:从零代码开始,10分钟快速开发一个可以发送弹幕的网站,并将其部署在华为云服务器上:学完本期教程,将知道如何使用Nginx.如何将自己的网站部署到云服务器上. 直播相信大家都不陌生了吧,大家经常会 ...

  7. 【工具篇】10分钟快速学会React图表搭建

    10分钟快速学会React图表搭建 本次紧着之前的antd,接着学习有关react图表以及富文本编辑器的搭建. 本次的功能实现基于上次的[工具篇]10分钟学会Ant Design of React用法 ...

  8. 新浪付稳:揭秘微博如何10分钟快速应对百亿级访问量

    本文转载自:新浪付稳:揭秘微博如何10分钟快速应对百亿级访问量 新浪微博几亿+的用户量,热点事件给其带来数倍流量瞬间暴增,如何不影响用户体验,又不增加巨大的服务器成本投入对技术是一个挑战. 作者:谢海 ...

  9. Spring Boot 永远滴神!10分钟快速入门

    为什么是 SpringBoot 因为目前开发 WEB 应用,Spring Boot 是启动 Spring 项目最快最流行的方式了.无论我们要构建一个什么样的应用,它都可以让我们尽可能快的启动运行起来. ...

最新文章

  1. DOS批处理高级教程精选(四)
  2. 【NLP】word2vec中的数学模型
  3. 2018年蓝桥杯B组题E题+快排
  4. 如何应对视觉深度学习存在的问题
  5. 给大家推荐9个专业分享生信技术的公众号
  6. 大数据系统架构的通用模块有哪些
  7. Hibernate-01-API及环境搭建
  8. 追忆我的2008-养成做笔记的习惯
  9. html怎么插入 ppt课件,PPT课件怎么插入声音?
  10. 学习神经网络:搭建一个vgg-11模型在FashionMNIST训练
  11. 用Python做九宫格照片
  12. iOS开发者 如何突破自身技术瓶颈,成为别人眼中的 架构师?
  13. 随机邻域嵌入_诠释数据降维算法:一文讲尽t-分布邻域嵌入算法(t-SNE)如何有效利用-阿里云开发者社区...
  14. 推荐!适合C++服务器编程初学者的基础开源项目
  15. Qt5:输入控件 QPushButton/ QToolButton/ QRadioButton/ QCheckBox/ QTextEdit/ QComboBox/ QSpinBox/ QLabel
  16. 2022校招已开启,学生党必备之什么是秋招和春招!
  17. 本月腾讯,阿里,美团等技术团队的精品文章推送
  18. 科技学习:第1篇 无人驾驶技术概述
  19. 【java】HashMap底层实现原理及面试题
  20. 流氓软件的dll文件和explorer.exe(文件资源管理器)绑定

热门文章

  1. linux卸载cf卡命令,嵌入式Linux 中CF卡的驱动和管理技术研究
  2. DIstinct理解
  3. 《神经网络与深度学习》第8-9章习题解答
  4. error C2146: 语法错误: 缺少“;”(在标识符“******”的前面)
  5. 几种数据存储结构详解
  6. 打开应用程序的批处理命令
  7. html标点符号相关符号
  8. 开发工程师人生之路(强烈推荐,分析的透彻!)
  9. 苹果手表支持android,苹果用户买Apple Watch,安卓用户又有哪些智能手表值得推荐?...
  10. 大型软件设计需求文档——多媒体播放器