![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Adroid开发笔记
记录Android学习和开发过程
zhangxuyu1118
行业:电子;职业:程序员。特长:应用开发。设备API接口设计,通讯,电子商务,GIS
展开
-
retrofit踩坑记
在使用最新版本的retrofit的时候,出现几个莫名的问题。先贴代码:1、单击某个标签时 public void testClk(View view) { System.out.println("begin......"); Retrofit rft = new Retrofit.Builder().baseUrl("https://www.httpbin.org/").build(); ITest itest = rft.create(ITe原创 2021-03-28 16:35:27 · 216 阅读 · 2 评论 -
登录界面的重用
很多代码一遍又一遍的复制黏贴,有什么好方法?先把登录界面的布局代码贴上。 <?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:原创 2021-03-20 12:26:53 · 148 阅读 · 0 评论 -
Android踩坑记录:This view is not constrained vertically
老代码中的ListView移植到新的ads时,发现布局文件有异常,百度后解决,增加一行即可:app:layout_constraintTop_toTopOf="parent"布局代码全部: <ListView android:id="@+id/lvMain" android:layout_width="match_parent" android:layout_height="wrap_content" android原创 2021-03-13 07:45:44 · 800 阅读 · 0 评论 -
Android Studio依赖添加----自定义模块
(1) 项目根目录下settigs.gradle里添加第三方库名(例如:testlibrary):include ':app',':testlibrary'(2) 在app下的build.gradle里dependencies节点下添加引用AS 3.0之前: ... dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:...原创 2020-09-15 10:32:08 · 293 阅读 · 0 评论 -
Android Studio依赖添加----jar包
方法一:(1) 将jar文件复制、粘贴到app/libs目录中(2) 右键点击jar文件,并点击弹出菜单中的Add As Library,将jar文件作为类库添加到项目中方法二:(1) 将jar文件复制、粘贴到app/libs目录中(2) 在app下的 build.gradle里的dependencies节点下添加引用AS 3.0之前 ... dependencies { compile fileTree(include: ['*.jar'], ...原创 2020-09-15 10:29:44 · 270 阅读 · 0 评论 -
Android Studio依赖添加----maven
(1) 项目根目录下的build.gradle里repositories节点下添加仓库地址AS 3.0之前:buildscript { repositories { //依赖的仓库 jcenter() } dependencies { //项目依赖的Gradle版本 classpath 'com.android.tools.build:gradle:2.3.3' }}allpr...原创 2020-09-15 10:24:45 · 3547 阅读 · 0 评论 -
Android Studio依赖添加----aar
(1) 将aar文件复制、粘贴到app/libs目录中(2) 修改app下的build.gradle配置文件AS 3.0之前: ... dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:25.0.0' ...原创 2020-09-15 10:21:16 · 138 阅读 · 0 评论 -
Android Studio依赖添加----使用so库
Android Studio依赖添加----使用so库参考:https://www.jianshu.com/p/b6704aa3b6b6(1) 在app/src/main的目录下新建名为 jniLibs 文件夹(app/src/main/jniLibs);(2) 再将so文件复制、粘贴到 jniLibs 目录内;(3) 在项目gradle.properties文件中加上以下代码,表示我们要使用NDK进行开发:android.useDeprecatedNdk = true(4) 在项.原创 2020-09-15 10:14:48 · 495 阅读 · 0 评论 -
认识两个 build.gradle
认识两个build.gradle1. 根目录下的 build.gradle1) repositories 闭包,声明了 jcenter() 的配置;2) dependencies 闭包,声明了一个 Gradle 插件。buildscript { repositories { //repositories闭包 google() jcenter() //代码托管库:设置之后可以在项目中轻松引用jcenter上的开源项目 } depen...原创 2020-09-15 09:55:40 · 161 阅读 · 0 评论