NDK support with different Product Flavour(NDK 支持不同的 Product Flavor)
问题描述
我想要 ndk 库中的 不同 字符串 值.因为我有两种风格的演示和现场直播,所以我想要价值你好,我来自演示",对于演示风味和现场风味,我想要你好,我来自现场"
I want different string value from ndk library. as i have two flavor demo and live I want value "hello I am from demo " for demo flavor and for live flavor i want "hello I am from live "
这是我的java文件代码
Here is my java file code
}
这是我的cpp文件代码
Here is my cpp file code
这是我的 build.gradle 文件
this is my build.gradle file
我在演示文件夹和主文件夹中粘贴了相同的 cpp 文件但可以完成我的任务.任何帮助将不胜感激这是一些参考链接
I have paste same cpp file in demo folder as well as in main folder but could achieve my task. Any help would be appreciate this are some refrence links
https://developer.android.com/studio/项目/gradle-external-native-builds.html
如何设置CmakeLists路径每个 Android ABI 的产品风格?
推荐答案
终于找到解决方案了.这是我的cpp文件代码
Finally I a solution. Here is my cpp file code
我正在从 java 代码中传递风味值,这是我的 java 文件代码.
I am passing flavor value from java code here is my code for java file.
现在我可以根据选择的风格获得我想要的任何文本.
Now i can get whatever text i want according to selected flavor.
这篇关于NDK 支持不同的 Product Flavor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!