目前我发送想要发送这两个变量HOST WS
和PORT WS
,我已经在视图中捕获了它们,但是冲突是我想要发送它们的那两个链并且同时在Gradle中连接它们,确切地说在URL参数中。
这样做的目的是在我改变路线时使我的网络服务完全可配置。
你知道怎么做吗?我想要一只手。
To use buildconfig from build.gradle to Android manifest then.
android {
// For settings specific to a product flavor, configure these properties
// for each flavor in the productFlavors block.
defaultConfig {
// Creates a property for the FileProvider authority.
def filesAuthorityValue = applicationId + ".files"
// Creates a placeholder property to use in the manifest.
manifestPlaceholders =
[filesAuthority: filesAuthorityValue]
// Adds a new field for the authority to the BuildConfig class.
buildConfigField("String",
"FILES_AUTHORITY",
"\"${filesAuthorityValue}\"")
}
...
}
...
<manifest>
...
<application>
...
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${filesAuthority}"
android:exported="false"
android:grantUriPermissions="true">
...
</provider>
</application>
</manifest>