
AndroidStudio
w366549434
一个基本自由的android开发者
展开
-
Android中的Gradle知识学习记录(一)
目前Android Studio创建项目的时候都是依赖于Gradle的,每个项目都有两个build.gradle,一个是app.gradle另一个是项目gradle。项目gradle就是用来配置整个项目的基础资源引用,包括gradle版本的依赖,google、jcenter、阿里云镜像之类的库依赖,类似是这样:// Top-level build file where you can add configuration options common to all sub-projects/modu原创 2020-06-25 21:41:08 · 296 阅读 · 0 评论 -
android笔记---context.getResources().getAssets()
本篇博客就是记录一下,当我们在Android Studio中导入其它jar包或aar包时,它们本身可能也包含一个assets文件夹,如果我们要获取这些jar包、aar包中的assets文件,也是可以通过context.getResources().getAssets()来获取的。同样,就是因为这个原因,不同的jar、aar以及你自己的android项目中的assets文件是不可以重名的。比如你自己的项目中有个名为A.bmp文件,这时如果你导入一个第三方包,碰巧这个包里的assets中也有一个A.b.原创 2020-05-21 16:13:08 · 3869 阅读 · 0 评论 -
记录一下 MediaPlayer info/warning (3,0)的意思
最近做项目的时候在android studio的控制台总是能看到MediaPlayer info/warning (3,0) 的日志输出。然后我就进入MediaPlayer源码中看了看。 /** The player just pushed the very first video frame for rendering. * @see android.media.Medi...原创 2020-04-09 10:09:44 · 4586 阅读 · 0 评论 -
View.isInEditMode()方法的作用
/** * Android源码 * Indicates whether this View is currently in edit mode. A View is usually * in edit mode when displayed within a developer tool. For instance, if * this View ...原创 2020-03-27 14:23:48 · 5170 阅读 · 1 评论 -
TextureView.setTransform(Matrix transform)方法的作用
今天在学习Github上大佬的代码的时候,发现了一个方法Texture.setTransform() /** * <p>Sets the transform to associate with this texture view. * The specified transform applies to the underlying surface ...原创 2020-03-26 13:55:01 · 3902 阅读 · 0 评论 -
Dialog的弹出位置控制
Dialog一般出现都是屏幕中心,但有的时候我们希望它能在屏幕左侧,或者右侧亦或者是屏幕顶部。这时候我们就需要用的Dialog.getWindow().getAttributes()方法啦dialog = new Dialog(getActivityContext());dialog.setContentView(localView); //下面的几个属性可能也会经常用...原创 2020-03-25 19:08:51 · 10425 阅读 · 0 评论 -
Android View.getLocationOnScreen的作用
Android View.getLocationOnScreen记录一下getLocationOnScreen方法的作用/** * <p>Computes the coordinates of this view on the screen. The argument * must be an array of two integers. After ...原创 2020-03-25 15:22:48 · 3102 阅读 · 0 评论 -
懒人模式:在现有的AS项目上添加C++(NDK)代码
在网上找了很多构建NDK项目的方法,一个个都太繁琐了,这命令那命令、这配置那配置的,完全不适合我这种手残党。于是我在这里整理了一份秋~简单的“搭建NDK环境的方法”。(ps:如果你是想在现有项目中集成NDK,可以跳到后面看)如果是一个新的项目第一步:那么可以在Android Studio启动时选择新建项目(Start a new Android Studio Project)第二步:...原创 2020-01-12 18:54:26 · 922 阅读 · 0 评论