gradle

Android基础——Binder连接池连接多个AIDL文件的处理

丶灬走出姿态 提交于 2020-05-08 03:28:32
Binder连接池连接多个AIDL文件的处理 事先说明: 本人也是个初学者,所以本文是从初学者的角度入手,如果有不妥的地方请留言教导我,谢谢。 如果对AIDL的使用和Binder机制不懂的,可以参照我之前的文章, Android基础——初学者必知的AIDL在应用层上的Binder机制,http://blog.csdn.net/qq_30379689/article/details/52253413 前言: 按照我们之前的对AIDL的使用方法,必须满足一个AIDL接口对应一个service。假如我们的应用,有多个模块需要多个AIDL,则需要多个Service端,Service作为四大组件,内存占用高,这样就影响了应用程序的性能了。所以我们需要将所有的AIDL放入一个Service中去管理。 欢迎关注我的CSDN博客,Hensen_的博客,http://blog.csdn.net/qq_30379689 Binder连接池工作原理: 服务端的操作 步骤一:创建两个模块需要的aidl文件和创建一个Binder连接池aidl文件,编译一下Gradle 步骤二:创建两个模块对aidl文件的实现类和创建一个Binder连接池类并实现, 中老年 创建一个服务端 步骤三:在manifests中配置Service 步骤四:在代码中启动服务 客户端的操作 步骤一:复制服务端的aidl文件到客户端中

How to suppress specific Kotlinc/Javac compiler warnings?

跟風遠走 提交于 2020-05-07 21:23:55
问题 How to suppress deprecations in for KotlinCompile in Gradle similar to JavaCompile ? JavaCompile(works): tasks.withType(JavaCompile) { configure(options) { compilerArgs << '-Xlint:-deprecation' } } KotlinCompile(does not work): tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) { kotlinOptions { freeCompilerArgs = ["-Xjavac-arguments=-Xlint:-deprecation"] } } References: https://kotlinlang.org/docs/reference/using-gradle.html#compiler-options Similar questions: kotlin supress

How to suppress specific Kotlinc/Javac compiler warnings?

自闭症网瘾萝莉.ら 提交于 2020-05-07 21:23:51
问题 How to suppress deprecations in for KotlinCompile in Gradle similar to JavaCompile ? JavaCompile(works): tasks.withType(JavaCompile) { configure(options) { compilerArgs << '-Xlint:-deprecation' } } KotlinCompile(does not work): tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) { kotlinOptions { freeCompilerArgs = ["-Xjavac-arguments=-Xlint:-deprecation"] } } References: https://kotlinlang.org/docs/reference/using-gradle.html#compiler-options Similar questions: kotlin supress

How to suppress specific Kotlinc/Javac compiler warnings?

僤鯓⒐⒋嵵緔 提交于 2020-05-07 21:19:53
问题 How to suppress deprecations in for KotlinCompile in Gradle similar to JavaCompile ? JavaCompile(works): tasks.withType(JavaCompile) { configure(options) { compilerArgs << '-Xlint:-deprecation' } } KotlinCompile(does not work): tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) { kotlinOptions { freeCompilerArgs = ["-Xjavac-arguments=-Xlint:-deprecation"] } } References: https://kotlinlang.org/docs/reference/using-gradle.html#compiler-options Similar questions: kotlin supress

正确使用sqlcipher for Android

空扰寡人 提交于 2020-05-07 20:17:57
android-database-sqlcipher 是基于SQLCipher的数据库加密框架,支持android4到android9,经常用来对android的SqlLite进行加密,现在支持Gradle集成,如果要支持androidx,可以使用Room框架,也可以配合原声的SQLiteOpenHelper使用。 首先在你的build.gradle中添加依赖: implementation 'net.zetetic:android-database-sqlcipher:4.2.0'   如果要兼容androidx请参考github页的配合Room框架使用的方案。 这里介绍怎么和原生API配合使用: 1、将所有android.database.sqlite.*的引入全部更改为net.sqlcipher.database.*,例如android.database.sqlite.SQLiteDatabase改为 net.sqlcipher.database.SQLiteDatabase; 2、在你的application的oncreate方法里面调用SQLiteDatabase.loadLibs();传入application的上下文作为参数; 3、在你获取数据库对象的时候,使用SQLiteDatabase.g() ,传入密码,支持String,byte[],char[] 作为密码;

Win10 + IDEA2019.3 搭建Spring5.1.x 源码开发环境

本秂侑毒 提交于 2020-05-07 16:28:33
本机环境: Win10 家庭版64位 IDEA 2019.3.1 Spring 5.1.x Gradle 5.6.4 Git 2.20.1 0、编译环境初始化 如上所述的环境都安装好,配置好环境变量: GRADLE_HOME: GRADLE_USER_HOME: 然后在CMD查看Gradle的版本如下即表示配置成功: 1、下载Spring源码 1、可以从官网下载: Spring-Framework官方Github下载地址 2、但是上面这个地址比较慢,你懂的。国内的码云有个同步镜像,每天同步一次,对于只是要学习一下Spring源码的同学来说,这个同步频率的代码足够新了。下载地址: 码云镜像:Spring-Framework 我是用git clone 码云的这个镜像下来后,切换到5.1.x 分支。 2、编译-导入源码 Spring-framework的源码目录有个导入IDEA的说明文档:==import-into-idea.md==,内容如下: _Within your locally cloned spring-framework working directory:_ 1. Precompile `spring-oxm` with `./gradlew :spring-oxm:compileTestJava` 2. Import into IntelliJ (File -> New

Gradle :Could not create service of type FileHasher

a 夏天 提交于 2020-05-07 11:52:26
问题 I'm using Gradle to build a java project. When I run any task (assemble, test). I get randomly an error : Could not create service of type FileHasher using GradleUserHomeScopeServices.createCachingFileHasher() Did any one had the same issue before? Gradle V:3.5 java 8 I'm using the java plugin. Thanks, 回答1: I was facing the same because I accidentally hit ctrl+z during build, and then the error was the same as yours. I tried to remove the lock file but it didn't solve the problem. Then I find

Gradle: How to get output from test STDERR/STDOUT into console?

我的梦境 提交于 2020-05-07 10:43:11
问题 (Gradle 3.2.1) I run some java tests, which logs output in Stderr/Stdout. I can see that output, if I start gradle test --info but in that case, much of unwanted output from 3-rd party libraries is there too. Documentation suggests using logging.caputureStandardError / logging.caputureStandardError (loglevel) , but it doesn't seem to have any effect. tasks.withType(Test) { logging.captureStandardOutput LogLevel.QUIET logging.captureStandardError LogLevel.QUIET } Then if running gradle test ,

Gradle: How to get output from test STDERR/STDOUT into console?

做~自己de王妃 提交于 2020-05-07 10:43:06
问题 (Gradle 3.2.1) I run some java tests, which logs output in Stderr/Stdout. I can see that output, if I start gradle test --info but in that case, much of unwanted output from 3-rd party libraries is there too. Documentation suggests using logging.caputureStandardError / logging.caputureStandardError (loglevel) , but it doesn't seem to have any effect. tasks.withType(Test) { logging.captureStandardOutput LogLevel.QUIET logging.captureStandardError LogLevel.QUIET } Then if running gradle test ,

Controller中的方法如何返回到HTML页面+Form表单提交到Controller的路径问题+properties的中文乱码问题

我是研究僧i 提交于 2020-05-07 02:59:07
1 Controller中的方法如何返回到HTML页面:   首先Controller: @Controller Public class TestController{ @RequestMapping(value ="/form" ) public String aa(){ return "qq" ; } } 配置文件application.yml: //path之后的路径是html页面的位置 spring.thymeleaf.preifx:classpath:/templates/ .html是要切换到的html的后缀 spring.thymeleaf.suffix:.html  qq.html: < form action ="form" method ="post" > dsadas </ form > 注意这是springboot+gradle项目,一定要引入thymeleaf的依赖。 2 Form表单提交到Controller的路径问题   controller中的RequestMapping("/form"),而如果html页面的form表单action的路径为/***,这个/是针对web服务器的根目录,而不是项目的根目录,可以看下发送url请求,没有项目名称,如果form表单提交的时候没有进入controller的方法