当前位置:网站首页>meta-data 占位符的引用
meta-data 占位符的引用
2022-07-27 14:55:00 【CAir2】
参考博客:
https://blog.csdn.net/weixin_30378311/article/details/97071152
https://blog.csdn.net/tushiba/article/details/96862824
https://android.zhizuobiao.com/android-18091800052/
在上一篇关于关于如何多渠道打包中我们使用了变量${channelName},下面我们讲解关于Android占位符的基本使用。

- 在app的
build.gradle中定义manifestPlaceholders的key和val,根据自己需要选择定义位置,例如在defaultConfig或者buildTypes又或者如上文打包中在productFlavors。
下面我们将以defaultConfig定义channelNum为例,展示占位符的基本使用。
- 在
AndroidManifest.xml中引用变量
- 生成apk,验证变量值

注意:由于manifestPlaceholders是map类型,所以为了避免值被覆盖最好使用+=否则会被覆盖,引用的时候提示错误
边栏推荐
猜你喜欢

字符流读取文件

C语言之字符函数和字符串函数及内存函数

为媒体资产构建一个云原生的文件系统

【pytorch】|transforms.FiveCrop

什么是jsp?

Great Cells & Counting Grids

Opencv (I) -- basic knowledge of image

UML diagram introduction

Getting started with nvida CUDA dirverapi
![[paper reading] single- and cross modality near duplicate image pairsdetection via spatial transformer compare](/img/33/8af12d58f4afeb807ebf9a90a2ea47.png)
[paper reading] single- and cross modality near duplicate image pairsdetection via spatial transformer compare
随机推荐
Three level cache of pictures in Android
String numeric type converted to thousands
kubesphere多节点安装出错
In addition to "adding machines", in fact, your micro service can be optimized like this
万字剖析Ribbon核心组件以及运行原理
密码学系列之:PKI的证书格式表示X.509
If you don't want to step on those holes in SaaS, you must first understand the "SaaS architecture"
Apache
mysql视图及存储过程
How to modify the decoding clock [chapter]
Servlet uses cookies to realize the last login time of users
Random number formula random
Quadratic programming based on osqp
JSON data format usage
Fast Planner - detailed explanation of kinetic astar
File operation in C language
Mpc5744p clock module
Start from scratch blazor server (1) -- project construction
Crawl common English names
CDQ divide and conquer and whole dichotomy learning notes