- 博客(62)
- 资源 (19)
- 问答 (3)
- 收藏
- 关注
原创 android AsyncTask介绍
AsyncTask和Handler对比1 ) AsyncTask实现的原理,和适用的优缺点AsyncTask,是android提供的轻量级的异步类,可以直接继承AsyncTask,在类中实现异步操作,并提供接口反馈当前异步执行的程度(可以通过接口实现UI进度更新),最后反馈执行的结果给UI主线程.使用的优点:l 简单,快捷l 过程可控使用的缺点:...
2019-06-23 18:11:31
352
原创 Build
public class Build {//当一个版本属性不知道时所设定的值。public static final String UNKNOWN = "unknown";//修订版本列表码public static final String ID = getString("ro.build.id");//显示屏参数public static final String DI...
2019-06-23 17:21:22
879
原创 Android spannableStringBuilder
spannableStringBuilder 用法详解:SpannableString ss = new SpannableString("红色打电话斜体删除线绿色下划线图片:."); //用颜色标记文本 ss.setSpan(new ForegroundColorSpan(Color.RED), 0, 2,...
2019-06-23 17:20:44
1495
转载 android 中文api (84) —— TrafficStats
android 中文api (84) —— TrafficStats前言 本章内容是android.net.TrafficStats,译为"流量统计",版本为Android 2.3 r1 ,翻译参考“Android开发网”的这篇文章,欢迎访问他们的网址:“http://android123.com.cn/”。期待你一起参与Android API 的中文翻译,联系我over140@g...
2019-06-22 12:00:31
622
转载 Android 中文API (69) —— BluetoothAdapter[蓝牙]
前言 本章内容是 android.bluetooth.BluetoothAdapter,为Android蓝牙部分的章节翻译。本地蓝牙设备的适配类,所有的蓝牙操作都要通过该类完成。版本为 Android 2.3 r1,翻译来自中山大学的"Android Club SYSU",欢迎访问他们的WIKI:http://www.android-wiki.net,再次感谢"Android C...
2019-06-22 12:00:06
550
转载 Android 中文API (70) —— BluetoothDevice[蓝牙]
前言 本章内容是 android.bluetooth.BluetoothDevice,为Android蓝牙部分的章节翻译。蓝牙设备类,代表了蓝牙通讯国足中的远端设备。版本为 Android 2.3 r1,翻译来自中山大学的"Android Club SYSU",欢迎访问他们的WIKI:http://www.android-wiki.net,再次感谢"Android Club SY...
2019-06-22 11:59:27
560
原创 HorizontalScrollView
HorizontalScrollView正文 一、结构public classHorizontalScrollView extendsFrameLayoutjava.lang.Objectandroid.view.View android.view.ViewGroup androi...
2019-06-22 11:58:40
572
原创 Scroller
一、结构 public classScrollerextendsObject java.lang.Object android.widget.Scroller 二、概述 这个类封装了滚动操作。滚动的持续时间可以通过构造函数传递,并且可以指定滚动动作的持续的最长时间。经过这段时间,滚动会自动定位到最终位置,并且通过comp...
2019-06-22 11:57:48
586
原创 Drawable
/*如果你想实现一个扩展子Drawable的动画drawable,那么你可以通过setCallBack(android.graphics.drawable.Drawable.Callback)来把你实现的该接口注册到动画drawable*中。可以实现对动画的调度和执行*/public static interface Callback { /**...
2019-06-22 11:56:37
155
原创 interpolator
Interpolator 被用来修饰动画效果,定义动画的变化率,可以使存在的动画效果accelerated(加速),decelerated(减速),repeated(重复),bounced(弹跳)等。AccelerateDecelerateInterpolator 在动画开始与结束的地方速率改变比较慢,在中间的时候加速 AccelerateInterpolator...
2019-06-22 11:55:33
291
原创 Animation
/*每个动画都重载了父类的applyTransformation方法这个方法的主要作用是把一些属性组装成一个Transformation类,这个方法会被父类的getTransformation方法调用。另外每个动画还有个initialize方法,完成初始化工作,动画开始前的一些准备工作。*/@OverridepublicvoidapplyTransformat...
2019-06-22 11:54:25
268
原创 AbsListView
结构继承关系public abstract classAbsListView extendsAdapterView<T extendsAdapter>implementsTextWatcherViewTreeObserver.OnGlobalLayoutListenerViewTreeObserver.OnTouchModeChangeListener Fil...
2019-06-22 11:53:33
252
原创 android中调用requestFocus()的详细过程
view中 public boolean requestFocus(int direction, Rect previouslyFocusedRect) { return requestFocusNoSearch(direction, previouslyFocusedRect); }private boolean requestFocusN...
2019-06-22 11:50:22
2497
原创 Canvas
/*** 用来保存Canvas的状态。save之后,可以调用Canvas的平移、放缩、旋转、错切、裁剪等操作。*/publicnativeintsave();/*** 用来保存Canvas的状态。*/public void restoreToCount(int saveCount) {/** save和restore要配对使...
2019-06-20 10:46:19
128
原创 ViewGroup
///***View对象使用LayoutParams对象来告知其上层控件自己需要多少空间。*基础LayoutParams类只是定义了这个view需要占用的宽度和高度。* {@link android.R.styleable#ViewGroup_Layout ViewGroup Layout Attributes}* for a list of all child vie...
2019-06-20 10:45:42
309
原创 Resources
/***返回当前显示指标,实际上这个资源对象。返回的对象应该被视为只读。*返回资源的当前显示指标。*/public DisplayMetrics getDisplayMetrics()
2019-06-20 10:44:52
133
原创 ViewConfiguration
/***包含了方法和标准的常量用来设置UI的超时、大小和距离(内部类)*/publicclassViewConfiguration{ //设定水平滚动条的宽度和垂直滚动条的高度,单位是像素px privatestaticfinalintSCROLL_BAR_SIZE=10; //定义滚动条逐渐消失的时间,单位是毫秒...
2019-06-20 10:44:15
175
原创 HttpURLConnection
public void setinstancefollowredirects(boolean followredirects)设置此httpurlconnection实例是否应该自动执行 http 重定向(响应代码为 3xx 的请求)。默认值来自 followredirects,其默认情况下为 true。参数:followredirects- 指示是否执行 http ...
2019-06-20 10:43:37
620
原创 Activity
onSaveInstanceState(Bundle outState)的调用时机Activity的方法onSaveInstanceState(Bundle outState),按照文档里说的,这个方法是在内存不够时,系统要强制杀掉这个Activity时,进行调用的。但经过我的测试,发现这个方法并不是在系统内存不够时,要杀掉Activity时,才调用的。测试结果:1. 只要Act...
2019-06-20 10:42:26
160
原创 TextView
textAppearance的属性设置android:textAppearance="?android:attr/textAppearanceSmall"android:textAppearance="?android:attr/textAppearanceMedium"android:textAppearance="?android:attr/textAppearanceLa...
2019-06-20 10:41:53
579
原创 android使用kivy集成python的youtube-dl代码笔记
去这里 https://pypi.org/project/colorama/#files 下载 colorama-0.4.1.tar.gz。去这里 https://pypi.org/project/appdirs/#files 下载 appdirs-0.4.1.tar.gz。(1).https://pypi.org/project/sh/#files 下载sh-1...14.tar.gz。修改序号2里面的 ANDROIDAPI。在 .bash_profile 中添加。
2018-12-19 17:04:56
1588
1
原创 mac 上的 android studio 安装运行 python
环境:mac os 10.12.6;android studio 3.0.11.安装python1)要安装Homebrew,打开Terminal或您喜欢的OSX终端模拟器并运行下面的命令:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"...
2018-11-29 11:16:43
2951
1
转载 android混淆
前言这阵子自己的心又长草了,静不下来~又挺迷茫的!在这个纷纷跳槽的季节,感觉还是应该让自己静下心来多学习学习。还是写写博客,总结总结~梳理下心里的野草。上个月跟朋友讨论了这么一问题:“项目上线之后由于代码被混淆的缘故,导致收集到的异常信息看着很困难”,刚好最近在复习混淆方面的知识,在总结混淆的知识点的同时,顺便探讨总结下这问题。项目上线肯定避免不了的是对项目进行混淆、打包、签名和发布,可能...
2018-08-14 14:13:35
4816
转载 EventBus
概念:Event:事件(订阅者根据事件来判断是否接收事件) Subscriber:事件订阅者,接收特定的事件。 Publisher:事件发布者,用于通知Subscriber有事件发生。 其中,Event可以使任意类型对象。Subscriber都是以约定的onEvent开头的函数,具体是onEvent,onEventMainThread,onEventBackgroundThread,o...
2018-07-06 13:59:08
317
转载 编写高效的Android代码
毫无疑问,基于Android平台的设备一定是嵌入式设备。现代的手持设备不仅仅是一部电话那么简单,它还是一个小型的手持电脑,但是,即使是最快的最高端的手持设备也远远比不上一个中等性能的桌面机。这就是为什么在编写Android程序时要时刻考虑执行的效率,这些系统不是想象中的那么快,并且你还要考虑它电池的续航能力。这就意味着没有多少剩余空间给你去浪费了,因此,在你写Android程序的时候,要尽可能的使...
2018-06-26 19:53:43
401
转载 MPAndroidChart
刷新invalidate() : 在chart中调用会使其刷新重绘notifyDataSetChanged() : 让chart知道它依赖的基础数据已经改变,并执行所有必要的重新计算(比如偏移量,legend,最大值,最小值 …)。在动态添加数据时需要用到。三、打印日志setLogEnabled(boolean enabled) : 设置为true将激活chart的logcat输出。但这不利于...
2018-06-22 11:58:50
1616
转载 ConstraintLayout
部分转:ConstraintLayout 属性详解 和Chain的使用Relative positioning --- 相对定位 Margins --- 间距 Centering positioning --- 中心定位 Circular positioning --- 圆形定位(这个有意思,做环形按钮应该很棒) Visibility behavior --- 可见性行为 Di...
2018-06-19 18:32:19
488
原创 BottomNavigationView
xml:<?xml version="1.0" encoding="utf-8"?><android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/ap...
2018-05-22 09:58:20
288
转载 Retrofit2
原文:https://www.jianshu.com/p/308f3c54abdd本文注目录:Retrofit入门Retrofit注解详解Gson与ConverterRxJava与CallAdapter自定义Converter自定义CallAdapter其它说明前言本文中的Retrofit均指代Retrofit2.0。本文涉及到的代码以及测试使用的接口可在Github上找到。测试接口服务器在 se...
2018-05-13 12:41:17
209
转载 Parcelable使用详解
想要在两个activity之间传递对象,那么这个对象必须序列化,android中序列化一个对象有两种方式,一种是实现Serializable接口,这个非常简单,只需要声明一下就可以了,不痛不痒。但是android中还有一种特有的序列化方法,那就是实现Parcelable接口,使用这种方式来序列化的效率要高于实现Serializable接口。不过Serializable接口实在是太方便了,因此在某些...
2018-05-13 12:41:00
482
转载 rxjava2
rxjava1:给 Android 开发者的 RxJava 详解下面文章的代码下载地址:https://github.com/nanchen2251/RxJava2Examples001.与RxJava 1.x的差异其实,我标题为入门教程,按理说应该从简单入门开始讲的,原谅我突然偏题了,因为我觉得可能大多数人都了解或者使用过RxJava 1.x(因为它真的太棒了)。虽然可能熟悉1.x 的你可以直接...
2018-05-13 12:40:49
587
转载 Lifecycle LiveData LiveData LiveData
Android 架构组件(一)——Lifecycle-Aware Components有一天“谷歌开发者”官微推送了《正式发布 Android 架构组件 1.0 稳定版 | 附带中文介绍视频》,发现这种架构足够秒杀MVP、MVVM,虽然之前的Google I/O大会中也介绍过,但是这次推出是稳定版,而且是可以投入到生产中去。于是就顺着这篇去官网看了使用文档——《Guide to App Archi...
2018-05-13 12:40:28
1815
转载 CoordinatorLayout 完全解析
原文:https://www.jianshu.com/p/4a77ae4cd82f一、CoordinatorLayout 的作用CoordinatorLayout 作为一个 “super-powered FrameLayout”,主要有以下两个作用:作为顶层布局;作为协调子 View 之间交互的容器。使用 CoordinatorLayout 需要在 build.gradle 加入:compile ...
2018-05-13 12:39:33
2565
原创 Dagger2
通过之前的介绍,在Activity中通过触发了Dagger的注入机制。然后Dagger扫描当前Activity有个的对象需要被注入://带参数的注入然后按照之前的介绍,Dagger将会在的类中搜索使用@Inject注释了的构造方法,并用他来创建对象。但是这里的中的构造方法没有使用@Inject来注释,说明无法直接注入。接下来Dagger就会在Component中搜索被注册的modules有哪些,结果找到了。然后在中搜索同时具备如下条件的注入类:通过@Provides注释的方法。
2018-04-27 18:11:08
351
1
原创 打包某些输入文件使用或覆盖了已过时的 API 已解决
Error:注: 某些输入文件使用或覆盖了已过时的 API。注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。注: 某些输入文件使用了未经检查或不安全的操作。注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。FAILURE: Build failed with an exception.* What went wrong:Execution fa...
2018-04-20 18:48:51
18010
原创 java stringbuilder stringformat 速度比较
1.一个一个地连接//验证代码for (int i = 0; i < 100; i++) { long start = System.nanoTime(); String str = ""; str += protocol; str += "://"; str += domain; str += ":"; str += port; str +=...
2018-03-10 15:52:33
2666
1
转载 使用 Memory Profiler 查看 Java 堆和内存分配
Memory Profiler 是 Android Profiler 中的一个组件,可帮助您识别导致应用卡顿、冻结甚至崩溃的内存泄漏和流失。 它显示一个应用内存使用量的实时图表,让您可以捕获堆转储、强制执行垃圾回收以及跟踪内存分配。要打开 Memory Profiler,请按以下步骤操作:点击 View > Tool Windows > Android Profiler(也可以点击工具...
2018-03-01 17:23:40
3585
原创 android重力监听
package com.PinusBungeana.shipin;import android.app.Activity;import android.os.Bundle;import android.support.annotation.Nullable;import android.view.OrientationEventListener;import android.view....
2018-02-23 14:07:40
391
原创 jni send byte array to java
JNIEXPORT jobjectArray JNICALLJava_ArrayHandler_returnArray (JNIEnv *env, jobject jobj){ jobjectArray ret; int i; char *message[5]= {"first", "second",
2018-02-05 14:15:46
253
原创 盒子升级apk
/** * 创建文件夹 * * getFilesDir()不能使用安装目录,“解析程序包时出现问题” * Environment.getRootDirectory() 无法更改文件读写权限 * getCacheDir()不能再此目录创建文件,再放入apk,也会提示“解析程序包时出现问题” */public static String createFilePath(Context c
2017-08-09 11:16:18
487
010EditorWin64Installer902.exe
2019-09-16
android与PC通过USB通信,获取IMEI号
2017-04-20
HorizontalScrollView嵌套在ListView被回收
2016-05-11
HorizontalScrollView在ListView被回收利用
2016-05-09
HorizontalScrollView在ListView被回收利用
2016-05-08
android下在文件不一样大
2015-03-24
TA创建的收藏夹 TA关注的收藏夹
TA关注的人