This article is part of the series GloballyDynamic: Dynamic delivery everywhere. For a brief introduction on GloballyDynamic, head over to the main article or the website.

本文是“ 全球动态:无处不在的动态交付 ”系列的一部分。 有关GloballyDynamic的简要介绍,请转到主要文章或网站 。

Image for post

This article will build upon the previous two articles in this series and illustrate how a project can be configured to use multiple dynamic delivery platforms without having to provide individual integrations for their respective client libraries. If you haven’t already, I suggest you give the previous two articles a quick scan before proceeding:

本文将以本系列的前两篇文章为基础,并说明如何将项目配置为使用多个动态交付平台,而不必为其各自的客户端库提供单独的集成。 如果您还没有的话,建议您在进行以下操作之前先快速浏览一下前两篇文章:

  • GloballyDynamic: Dynamic delivery during development

    GloballyDynamic:开发过程中的动态交付

  • GloballyDynamic: Dynamic delivery with Firebase App Distribution

    GloballyDynamic:通过Firebase App Distribution动态交付

When I say Multi-platform in this context, it does not refer to Kotlin Multiplatform, but rather multiple dynamic delivery platforms, such as Play Feature Delivery or Dynamic Ability.

在这种情况下,当我说多平台时,它不是指Kotlin多平台 ,而是指多个动态交付平台,例如Play Feature Delivery或Dynamic Ability 。

The Android library, which is introduced in the first article of the series, provides an abstraction layer on top of different dynamic delivery client APIs, you can therefore write your Kotlin/Java code once, and have it run with every underlying platform.

该系列的第一篇文章中介绍的Android库在不同的动态交付客户端API之上提供了一个抽象层,因此您可以编写一次Kotlin / Java代码,并使其在每个基础平台上运行。

The library comes in different flavours, one for each underlying platform. The currently available ones are:

该库具有不同的风格,每个基础平台一个。 当前可用的是:

  • Google Play Store (Play Feature Delivery): com.jeppeman.globallydynamic.android:gplay:1.0.0

    Google Play商店( Play功能交付 ): com.jeppeman.globallydynamic.android:gplay:1.0.0 : com.jeppeman.globallydynamic.android:gplay:1.0.0 : com.jeppeman.globallydynamic.android:gplay:1.0.0

  • Huawei App Gallery (Dynamic Ability): com.jeppeman.globallydynamic.android:huawei:1.0.0

    华为App Gallery( 动态能力 ): com.jeppeman.globallydynamic.android:huawei:1.0.0 : com.jeppeman.globallydynamic.android:huawei:1.0.0 : com.jeppeman.globallydynamic.android:huawei:1.0.0

  • Self-hosted with GloballyDynamic Server (Firebase App Distribution, local development etc): com.jeppeman.globallydynamic.android:selfhosted:1.0.0

    使用GloballyDynamic Server自托管(Firebase应用程序分发,本地开发等): com.jeppeman.globallydynamic.android:selfhosted:1.0.0 : com.jeppeman.globallydynamic.android:selfhosted:1.0.0 : com.jeppeman.globallydynamic.android:selfhosted:1.0.0

All of these flavours expose an identical API, while delegating operations to their respective underlying platforms. The way in which you configure what platform to be delegated to is through build flavours.

所有这些样式都公开了相同的API,同时将操作委派给了各自的基础平台。 您可以通过构建方式来配置要委派给哪个平台的方法。

The remainder of this article will go through an example on how to configure a project to use dynamic delivery with 4 different environments:

本文的其余部分将通过一个示例,说明如何配置项目以在4种不同环境下使用动态交付:

  • Local development
    当地发展
  • Google Play
    Google Play
  • Huawei App Gallery
    华为App Gallery
  • Firebase App Distribution
    Firebase应用分发

1)添加本地开发配置 (1) Adding a local development configuration)

This is covered in depth in the first article of this series, however, in this article we will incorporate the development setup into a multi-platform one:

本系列的第一篇文章对此进行了详细介绍,但是,在本文中,我们将把开发设置合并到一个多平台的开发中:

android {    globallyDynamicServers {        studioEmbedded {            throttleDownloadBy 5000            applyToBuildVariants 'debug'        }    }}repositories {    mavenCentral()}dependencies {    debugImplementation 'com.jeppeman.globallydynamic.android:selfhosted:1.0.0'}

2)添加Google Play配置 (2) Adding a Google Play configuration)

Since Google Play Store already supports dynamic delivery natively, configuring the library to delegate operations to Play Core is straightforward — we merely create a product flavour called gplay, and declare the corresponding dependency for it, like so:

由于Google Play商店已经原生支持动态交付,因此配置库以将操作委派给Play Core的过程非常简单-我们仅创建一个名为gplay的产品gplay ,并gplay声明相应的依赖项,如下所示:

android {    flavorDimensions 'platform'    productFlavors {        gplay {            dimension 'platform'        }    }    globallyDynamicServers {        studioEmbedded {            throttleDownloadBy 5000            applyToBuildVariants 'gplayDebug'        }    }}repositories {    mavenCentral()    google()}configurations {    gplayReleaseImplementation {}}dependencies {    debugImplementation '    gplayReleaseImplementation 'com.jeppeman.globallydynamic.android:gplay:1.0.0'}

Note: the configurations {} block is necessary when declaring a dependency that is specific to both a build type and a product flavour, this is because the Android Gradle Plugin creates the combined configurations later in the build pipeline, you therefore have to declare placeholder configurations. More on that here.

注: configurations {}声明依赖特定于两个构建类型和产品风味当块是必要的,这是因为Android的Gradle插件在构建流水线后创建相结合的配置,你因此必须声明占位符配置。 在这里更多。

If you’d rather like to use Internal App Sharing during development for Google Play, you can just remove the gplayDebug directive from applyToBuildVariants, and also change gplayReleaseImplementation to gplayImplementation.

如果您想在Google Play开发期间使用内部应用程序共享 ,则只需从applyToBuildVariants删除gplayDebug指令,然后将gplayReleaseImplementation更改为gplayImplementation

3)添加华为App Gallery配置 (3) Adding a Huawei App Gallery configuration)

The story is the same for Huawei App Gallery as with Google Play Store; it support dynamic delivery natively. Hence configuring for operations to be delegated to Dynamic Ability is also straightforward:

华为App Gallery的故事与Google Play商店的故事相同。 它本地支持动态交付。 因此,配置要委派给动态能力的操作也很简单:

android {    flavorDimensions 'platform'    productFlavors {        gplay {            dimension 'platform'        }        huawei {            dimension 'platform'        }    }    globallyDynamicServers {        studioEmbedded {            throttleDownloadBy 5000            applyToBuildVariants 'gplayDebug', 'huaweiDebug'        }    }}repositories {    mavenCentral()    google()    maven { url 'http://developer.huawei.com/repo' }}configurations {    gplayReleaseImplementation {}    huaweiReleaseImplementation {}}dependencies {    debugImplementation '    gplayReleaseImplementation '    huaweiReleaseImplementation 'com.jeppeman.globallydynamic.android:huawei:1.0.0'}

4)添加Firebase App Distribution配置 (4) Adding a Firebase App Distribution configuration)

Enabling dynamic delivery for Firebase App Distribution is covered in depth in the second article in this series, in this article we’re incorporating that setup into this multi-platform one. As illustrated below, we’ll now have to configure two different globallyDynamicServers:

在本系列的第二篇文章中将深入介绍为Firebase App Distribution启用动态交付,在本文中,我们将该设置整合到了这个多平台的产品中。 如下图所示,我们现在必须配置两个不同的globallyDynamicServers

android {    flavorDimensions 'platform'    productFlavors {        gplay {            dimension 'platform'        }        huawei {            dimension 'platform'        }        firebase {            dimension 'platform'            firebaseAppDistribution {                apkPath "${buildDir}/outputs/universal_apk/firebaseRelease/universal.apk"                                }        }     }    globallyDynamicServers {        studioEmbedded {            throttleDownloadBy 5000            applyToBuildVariants 'gplayDebug', 'huaweiDebug', 'firebaseDebug'        }        firebase {            serverUrl 'http://<ip-to-server>:8080'            username 'johndoe'            password 'my-secret-password'            applyToBuildVariants 'firebaseRelease'        }    }}repositories {    mavenCentral()    google()    maven { url 'http://developer.huawei.com/repo' }}configurations {    gplayReleaseImplementation {}    huaweiReleaseImplementation {}    firebaseReleaseImplementation {}}dependencies {    debugImplementation '    gplayReleaseImplementation '    huaweiReleaseImplementation '    firebaseReleaseImplementation 'com.jeppeman.globallydynamic.android:selfhosted:1.0.0'}

5)放在一起 (5) Putting it all together)

Phew, that’s it as far as configuration goes. While the configuration becomes fairly meaty and involved when working with this many platforms, it allows you to only write the actual Kotlin/Java code once — as you switch between build variants you can use your same calls toGlobalSplitInstallManager.startInstall(...), without needing to modify anything.

ew,仅此而已。 尽管配置变得相当繁琐,并且在许多平台上使用时涉及到配置,但它只允许您编写一次实际的Kotlin / Java代码-在构建变体之间切换时,您可以对GlobalSplitInstallManager.startInstall(...)使用相同的调用,而无需修改任何内容。

A complete version of these steps are coalesced into the gist below, which also contains all plugin definitions you need:

这些步骤的完整版本合并到下面的要点中,其中还包含您需要的所有插件定义:

buildscript {repositories {google()mavenCentral()}dependencies {classpath 'com.android.tools.build:gradle:4.0.1'classpath "com.google.firebase:firebase-appdistribution-gradle:2.0.1"classpath 'com.jeppeman.globallydynamic.gradle:plugin:1.0.0'}
}apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.appdistribution'
apply plugin: 'com.jeppeman.globallydynamic'android {flavorDimensions 'platform'productFlavors {gplay {dimension 'platform'}huawei {dimension 'platform'}firebase {dimension 'platform'                firebaseAppDistribution {apkPath "${buildDir}/outputs/universal_apk/firebaseRelease/universal.apk"                    }}}globallyDynamicServers {studioEmbedded {throttleDownloadBy 5000applyToBuildVariants 'gplayDebug', 'huaweiDebug', 'firebaseDebug'}firebase {serverUrl 'http://<ip-to-server>:8080'username 'johndoe'password 'my-secret-password'applyToBuildVariants 'firebaseRelease'}}
}repositories {google()mavenCentral()maven { url 'http://developer.huawei.com/repo' }
}configurations {gplayReleaseImplementation {}huaweiReleaseImplementation {}firebaseReleaseImplementation {}
}dependencies {debugImplementation 'com.jeppeman.globallydynamic.android:selfhosted:1.0.0'gplayReleaseImplementation 'com.jeppeman.globallydynamic.android:gplay:1.0.0'huaweiReleaseImplementation 'com.jeppeman.globallydynamic.android:huawei:1.0.0'firebaseReleaseImplementation 'com.jeppeman.globallydynamic.android:selfhosted:1.0.0'
}

With that we’ve reached the conclusion of this series of articles — for more information on the subject, such as how to publish an app on Amazon App Store or Samsung Galaxy Store with dynamic delivery, head over to the website. You can also have a look at my example project which is published on various platforms with dynamic delivery enabled.

到此为止,我们已经得出了本系列文章的结论-有关该主题的更多信息,例如如何以动态交付方式在Amazon App Store或Samsung Galaxy Store上发布应用程序,请访问该网站 。 您还可以查看我的示例项目 ,该示例项目在启用了动态交付的各种平台上发布。

有用的链接 (Useful links)

  • Play Feature Delivery

    播放功能交付

  • Dynamic Ability

    动态能力

  • Firebase App Distribution

    Firebase应用分发

  • GloballyDynamic

    全球动态

翻译自: https://medium.com/@jesperaamann/globallydynamic-multi-platform-dynamic-delivery-with-a-unified-client-api-4dd6f160a07d

http://www.taodudu.cc/news/show-4104519.html

相关文章:

  • word自动更正关闭_如何在OS X中关闭自动更正文本替换
  • Chromium扩展(Extension)的页面(Page)加载过程分析
  • Pizza店(JAVA程序设计)
  • Meatycake,51nod2117,树状数组
  • 全志V3S H.264 对视频进行编码的过程
  • YUV编码为H264 H264封装为MP4
  • 基于Hi3516A的H265 IPC LIVE555 开发
  • ffmpeg入门教程之YUV编码成h264 API详解
  • ffmpeg摄像头采集h264编码RTP发送
  • H.264编码
  • Qt5.12 使用FFmpeg实时解码播放H264/H265摄像头记录(直传数据法)
  • 使用VAE(变分自动编码器),来预测用户流失.
  • Qt基于FFmpeg读取摄像头并进行H264编码
  • H.264/H.265 视频编码解码器单元产品指南
  • C++ 使用Intel Media SDK 实现H.264硬编码
  • 分析FFMPEG中H264编码流程
  • onvif 添加H265开发流程
  • YUV编码为HEVC(H.265)
  • 【FFmpeg】在FFmpeg里添加自研编码器方法
  • FFmpeg —— 13.示例程序(七):视频编码器(YUV编码为H265)
  • 最简单的基于FFmpeg的视频编码器-更新版(YUV编码为HEVC(H.265))
  • obs 推流编码在哪设置_在OBS上进行H265推流
  • 英特尔CAS缓存加速软件优化SSD性能
  • 变分法原理!
  • 能量泛函和变分法
  • LDA变分法和采样法
  • 动态优化模型/ 变分法:泛函、极值、变分
  • 变分法模型的运用:生产设备的最大经济效益
  • 量子力学第十一弹——变分法
  • 简述变分法在泛函极值问题中的应用

GloballyDynamic:具有统一客户端API的多平台动态交付相关推荐

  1. 如何设计一个API快速开发平台?

    点击上方☝码猿技术专栏 轻松关注,设为星标! 及时获取有趣有料的技术 来源:toutiao.com/i6914469326074479108/ 在我之前谈API网关的时候曾经谈到过快速开发平台,即将A ...

  2. API 快速开发平台设计思考

    作者 | 人月聊IT 来源 | toutiao.com/i6914469326074479108 在我之前谈API网关的时候曾经谈到过快速开发平台,即将API快速开发的一些内容放入到API网关中,实际 ...

  3. 打造一个 API 快速开发平台,牛逼!

    来源:toutiao.com/i6914469326074479108/ 在我之前谈API网关的时候曾经谈到过快速开发平台,即将API快速开发的一些内容放入到API网关中,实际来看围绕API全生命周期 ...

  4. API快速开发平台设计思考

    在我之前谈API网关的时候曾经谈到过快速开发平台,即将API快速开发的一些内容放入到API网关中,实际来看围绕API全生命周期管理,本身包括了开发态,运行态,运维态. 对于API网关更多的是解决运行态 ...

  5. 通过 Jersey Http请求头,Http响应头,客户端 API 调用 REST 风格的 Web 服务

    原地址:http://blog.csdn.net/li575098618/article/details/47853263 Jersey 1.0 是一个开源的.可以用于生产环境的 JAX-RS(RES ...

  6. Java EE 7中的WebSocket客户端API

    在本文中,让我们探索谈论较少的Web Socket Client API,以及如何在Java EE 7容器本身中利用它. Web套接字服务器API规则 JSR 356的服务器端API(Java的Web ...

  7. 表格存储TableStore全新升级,打造统一的在线数据存储平台!

    表格存储TableStore是阿里云自研的面向海量结构化和半结构化数据存储的Serverless NoSQL多模型数据库,被广泛用于社交.物联网.人工智能.元数据和大数据等业务场景.表格存储Table ...

  8. 生成用于ASP.NET Web API的C#客户端API

    目录 介绍 主要特征 主要好处 背景 推定(Presumptions) 使用代码 步骤0:将NuGet软件包WebApiClientGen安装到Web MVC/API项目 步骤1:建立.NET Cli ...

  9. RestCloud API接口管理平台

    RestCloud API接口管理平台 RestCloud API管理平台是完全自主研发的企业级统一API接口管理平台,本平台不但可以从Java代码中的注解自动扫描生成API文档还能通过OpenAPI ...

  10. API开发平台,企业级API服务发布平台

    API开发平台基于微服务架构快速开发API接口服务,是一款轻量级的API服务发布平台.可快速的开发企业级前后端分离的业务系统,通过建立数据模型和业务模型能够无代码快速的发布API服务. RestClo ...

最新文章

  1. 全球通信云市场爆发增长,RTC 技术普惠还有多远
  2. CYQ.Data 轻量数据访问层(五) 构造数据行
  3. Python实现 logistic 回归算法
  4. java登录界面命令_Java命令行界面(第13部分):JArgs
  5. 华为的涉外知识产权工程师_华为法务社招 | 岗位:高级知识产权工程师
  6. 信息学奥赛一本通 1064:奥运奖牌计数 | OpenJudge NOI 1.5 07
  7. Python机器学习:KNN算法02scikit-learn中的机器学习算法封装
  8. SpiderData 2019年2月4日 DApp数据排行榜
  9. Anaconda 国内镜像配置
  10. Linux下安装ActiveMQ(CentOS7)
  11. 数学建模算法之动态规划
  12. Nginx从入门到精通(全)
  13. POI java导出Excel宏文件
  14. 国稻种芯百团计划行动 胡培松:早稻可以向用途多元化发展
  15. 推荐一个好看且实用的火狐浏览器新标签页插件【火狐浏览器新标签页自定义美化】
  16. word使用上角标超链接到引用的参考论文
  17. 一个有趣的模型组合预测模型
  18. InnoDB基于MVCC和next-key锁解决幻读问题
  19. 体制内干部职务职级及领导干部排序对应关系大全
  20. matlab归一化和标准化

热门文章

  1. vue实现搜索框记录搜索历史_Vue 实现输入框新增搜索历史记录功能
  2. Vmware安装MacOS提示请选择您要安装的macOS的磁盘
  3. ALL_TAB_COLS
  4. 生日祝福html_祝我家的猪,生日快乐 | 告白墙第21期
  5. echarts:柱状图去掉网格线
  6. 如何打开高清语音VOLTE
  7. 元宇宙:不透明面纱下的“康德主义”
  8. ikuai路由管理系统教程
  9. Windows Server2008 R2搭建域环境(步骤最详细)
  10. java wgs84 百度坐标_javascript 实现wgs84 坐标转百度坐标