草庐IT

runtime-configuration

全部标签

java - Runtime Change Android 素材主题

我有一个用于在运行时更改应用主题的设置屏幕。我知道如何创建Material设计主题。我在我的style.xml文件中创建了一个这是我的style.xml的代码:@color/primaryBackground@color/primaryBackground@color/colorAccent@color/primaryBackground@color/primaryBackground@color/primaryBackground@color/primaryBackground@color/primaryBackground@style/WindowAnimationTransiti

安卓工作室 3.1 : Proxy configuration: Unable to set https user password for git operations

我最近将我的AndroidStudio从3.0升级到了3.1。在3.0中,我曾经在gradle.properties(全局属性)文件中设置代理配置,其中包括设置systemProp.https.proxyPassword等。但是,我无法在3.1中设置此变量。防止在用户可访问的文件中写入用户密码似乎是一个设计决定。但是,如何设置相同的值?目前,每当我设置systemProp.https.proxyPassword时,它都会在我下次打开AndroidStudio时被空白字段覆盖。即使在gradle.properties(具有全局范围)中再次设置此变量后,我也无法执行gitpull/push

android - 无法解析 com.squareup.sqldelight :runtime:1. 1.3

我尝试将sqldelight集成到我的Android/iOS多平台库项目中,但在同步gradle时我遇到了几个Unresolved依赖项错误。ERROR:Unabletoresolvedependencyfor':SharedCode@debug/compileClasspath':Couldnotresolvecom.squareup.sqldelight:runtime:1.1.3.ERROR:Unabletoresolvedependencyfor':SharedCode@debug/compileClasspath':Couldnotresolvecom.squareup.sq

java - eclipse Java : Define final variable based on build configuration

我想要一个final变量,当我运行我的项目的Debug版本时它是true,当我运行它时它是false运行版本。我知道我可以通过构建配置来做到这一点,但不知道如何在Eclipse中进行设置。StackExchange上似乎没有任何关于专门定义变量的教程或问题。我在EclipseClassic4.2中编译Java,使用ADT插件创建一个Android应用。编辑:根据@Xavi,我设置了以下内容:try{Stringline=null;java.lang.Processp=Runtime.getRuntime().exec("getpropdebugging");BufferedReader

android - 在 RunTime.exec "uid 1000 not allowed to su"上出现错误 (“su”)

当我尝试从具有系统权限的程序运行su命令时,我在stderr上返回了这个错误:uid1000notallowedtosu我将共享uid设置为android.uid.system或android.uid.shell但它没有改变任何东西。该设备应该是Root过的。我真的不明白发生了什么。代码如下:privatebooleanrunAsRoot(Stringcmd,Fileworkdir)throwsIOException{Log.i(LOG_TAG,"Executecommandasroot:"+cmd);Processp=Runtime.getRuntime().exec(newStri

安卓棉花糖 : How to allow Runtime Permissions programatically?

我正在开发一个需要一些系统权限的应用程序,但是在AndroidMarshmallow上安装时不再自动授予这些权限。我想在运行时请求这些权限并运行某种自动化来授予它们,而无需用户在系统权限对话框出现时点击“允许”按钮。我怎样才能做到这一点?在Marshmallow和更高版本中有什么办法可以做到这一点吗? 最佳答案 对于Marshmallow或更高版本的权限不会在安装时授予,必须在运行时需要时请求(如果之前未授予。)为此,您需要运行ActivityCompat.requestPermissions()在您的Activity中弹出系统权限

java.io.ioexception.Runtime.getRuntime().exec()。 android中的环境和工作目录空错误

Filedir=newFile("/mnt/sdcard");Processprocess=Runtime.getRuntime().exec("ffmpeg-fimage2-iimg%4d.pngvideo.mp4",null,dir);当我在android中尝试此行时,我在android中遇到环境和工作目录空错误。但是当我在java中尝试该行时,它工作得很好。但是在android中,它有一些问题。 最佳答案 igetenvironmentandworkingdirectorynull它会返回null,因为没有像/mmt/sdca

安卓工作室 Gradle : Error:Configuration with name 'compile' not found

我的项目刷新失败,并出现以下gradle脚本的错误:错误:找不到名为“compile”的配置。//顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项。buildscript{repositories{mavenCentral()}dependencies{classpath'com.android.tools.build:gradle:2.3.2'classpath'com.google.gms:google-services:3.1.0'//NOTE:Donotplaceyourapplicationdependencieshere;theybelong//intheind

android - java.io.File 无法转换为 org.gradle.api.artifacts.Configuration

将一个项目更新到新的gradle-plugin(14.0.2)后,我在Android-Studio中遇到问题:Error:Cause:java.io.Filecannotbecasttoorg.gradle.api.artifacts.ConfigurationPossiblecausesforthisunexpectederrorinclude:Gradle'sdependencycachemaybecorrupt(thissometimesoccursafteranetworkconnectiontimeout.)Re-downloaddependenciesandsyncproj

android - 启用 androidX 导致 'Cannot change strategy of configuration ' :app:compile' after it has been resolved' error

我目前正在尝试将OpenId/Android-Apputh迁移到androidX并在执行所有更改后面临一个奇怪的问题gradle开始抛出以下错误:>Cannotchangestrategyofconfiguration':app:compile'afterithasbeenresolved.我添加之后android.enableJetifier=trueandroid.useAndroidX=true到'gradle.properties'提示我尝试记录所有可能的(使用println(cofigBlockName))配置block,发现在构建过程中未调用sourceSetsconfig