我想做一些像(伪代码)的东西:
if (BuildType == "release"){
apply plugin: 'testfairy'
} else if (BuildType == "debug"){
apply plugin: 'io.fabric'
}
Run Code Online (Sandbox Code Playgroud)
这个想法是基于构建类型,应用(或不应用)插件.怎么做 ?
android gradle build.gradle android-gradle-plugin gradle-plugin
内容:
我正在尝试将Google语音操作集成到我的应用中。我已经看过并理解了(或至少是我的想法)google codelabs-io2015示例,在此示例中,如果您不修改代码,一切都会按预期工作。当您尝试使此示例适应实际用例时,问题就开始了。
问题:
所以,我的问题是我正在尝试实施搜索语音操作,但是Activity#isVoiceInteraction始终为false。我最终不了解该活动何时以及为何(以及何时未链接)到语音交互器。
研究:
查看Activity,Activity#isVoiceInteraction和Activity#getVoiceInteractor API级别23的源代码,发现以下内容:
/**
* Check whether this activity is running as part of a voice interaction with the user.
* If true, it should perform its interaction with the user through the
* {@link VoiceInteractor} returned by {@link #getVoiceInteractor}.
*/
public boolean isVoiceInteraction() {
return mVoiceInteractor != null;
}
Run Code Online (Sandbox Code Playgroud)
,
/**
* Retrieve …Run Code Online (Sandbox Code Playgroud) android google-voice-search google-voice-actions voice-interaction