将链发送到连锁的gradle

问题描述 投票:0回答:1

目前我发送想要发送这两个变量HOST WSPORT WS,我已经在视图中捕获了它们,但是冲突是我想要发送它们的那两个链并且同时在Gradle中连接它们,确切地说在URL参数中。

这样做的目的是在我改变路线时使我的网络服务完全可配置。

你知道怎么做吗?我想要一只手。

在这里我配置这两个参数enter image description here

我想将它连接到我的Gradle enter image description here

android android-gradle
1个回答
1
投票
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>
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.