我首先要说的是我对Gradle很新,所以如果已经回答,我会道歉.
我正在开发一个使用API密钥访问第三方工具的Android应用程序.根据应用程序的风格和构建类型,需要使用不同的API密钥.
这是我正在尝试做的基本概述:
android {
defaultConfig {
manifestPlaceholders = [ apiKey:"DEBUG_KEY" ]
}
buildTypes{
debug{
// Some debug setup
}
release{
// Some release setup
}
}
productFlavors {
// List of flavor options
}
productFlavors.all{ flavor->
if (flavor.name.equals("someFlavor")) {
if (buildType.equals("release")) {
manifestPlaceholders = [ apiKey:"RELEASE_KEY_1" ]
} else {
manifestPlaceholders = [ apiKey:"DEBUG_KEY" ]
}
} else {
if (buildType.equals("release")) {
manifestPlaceholders = [ apiKey:"RELEASE_KEY_2" ]
} else {
manifestPlaceholders = [ apiKey:"DEBUG_KEY" ] …Run Code Online (Sandbox Code Playgroud) 我一直在使用iOS 5.0中的私有BluetoothManager框架,我已经能够成功启动/停止蓝牙并获得设备列表,但我无法弄清楚如何启动配对.
我最接近的是尝试连接使用:
[[BluetoothManager sharedInstance] connectDevice:dev];
Run Code Online (Sandbox Code Playgroud)
其中dev是扫描期间发现的BluetoothDevice对象.
这似乎试图配对(当我尝试连接到我的iMac时,配对对话框会暂时出现),但很快就会失败.
我注意到BluetoothManager.h包含一个可能有帮助的BTPairingAgentImpl结构,但我不知道这个结构包含什么或如何使用它.
任何帮助将不胜感激.