android
zzcchunter
这个作者很懒,什么都没留下…
展开
-
加速gradle编译
···buildscript { repositories { // mavenCentral() // jcenter() // google() maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'http://maven.aliyun.com/nexus/content/gro原创 2020-12-04 22:56:51 · 264 阅读 · 0 评论 -
Android Binder 机制 实例分析
Binder框架有3个方面组成:Binder服务端、Binder驱动以及客户端组成。Binder服务端:Binder服务端实际上就是一个Binder对象,该对象一旦创建就会开启一个隐藏的线程,该线程用来接收Binder驱动发送的消息,然后执行onTransact函数,并根据onTransact的参数执行不同的服务代码;因此要实现一个Binder服务就得重载onTransact方法。...转载 2019-10-29 11:23:29 · 276 阅读 · 0 评论 -
安卓打开远程调试
adb shell susetprop service.adb.tcp.port 5555stop adbd && setprop service.adb.root 0 && start adbd &原创 2016-06-22 15:32:53 · 447 阅读 · 0 评论 -
画阴影
I wanted a similar effect, but on an AppWidget so unfortunately I couldn't use @EvelioTarazona's solution. This is what I came up with, it should work with a bitmap of any shape. final Bitmap src转载 2015-09-02 10:10:53 · 570 阅读 · 0 评论 -
android计算大小表
转载 2015-01-20 17:37:16 · 664 阅读 · 0 评论 -
Popupwindow全屏问题
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:background="#ddffffff" android:layout_width=原创 2014-10-20 09:16:16 · 19210 阅读 · 2 评论 -
algid parse error, not a sequence
I was having this same issue, and the format of the key was NOT the actual problem.All I had to do to get rid of that exception was to calljava.security.Security.addProvider( new org.boun翻译 2014-11-04 01:30:18 · 4990 阅读 · 0 评论 -
caps lock 映射成 esc
xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'转载 2014-08-12 22:31:09 · 1254 阅读 · 0 评论 -
gradle
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' }}apply plugin: 'android-library'repositories { mav原创 2014-08-25 21:09:11 · 725 阅读 · 0 评论 -
android_radiobutton_background_selector
原创 2014-06-28 14:39:02 · 3417 阅读 · 0 评论 -
MAC 不能连接andorid调试解决方案
Update for newer versions of adb, ~/.android/adb_usb.ini has to be removed.Executive summary: Add the Vendor ID to ~/.android/adb_usb.ini and restart adbFull Details: Most of the time noth转载 2014-02-25 15:04:41 · 1056 阅读 · 0 评论 -
android sdk 代号
1- Android SDK Tools, revision 22.3 2- Android SDK Platform-tools, revision 19.0.1 3- Android SDK Build-tools, revision 19.0.1 4- Documentation for Android SDK, API 19, revision 2 5- S转载 2014-02-04 10:00:15 · 2585 阅读 · 0 评论 -
自定义View,有这一篇就够了
http://www.jianshu.com/p/c84693096e41为了扫除学习中的盲点,尽可能多的覆盖Android知识的边边角角,决定对自定义View做一个稍微全面一点的使用方法总结,在内容上面并没有什么独特的地方,其他大神们的博客上面基本上都有讲这方面的内容,如果你对自定义View很熟了,那么就不用往下看啦~。如果对自定义View不是很熟,或者说很多内容忘记转载 2017-10-06 12:13:57 · 203 阅读 · 0 评论 -
ffmpeg 入门
http://einverne.github.io/post/2015/12/ffmpeg-first.html下面就直接进正题吧:几个概念在进入 ffmpeg 入门之前有一些基本概念需要了解,我在查看 ffmpeg 的时候回头查阅了这些资料,觉得先行了解比较好,这些概念都是视频或者音频中的基本概念。比特率比特率,英文为 bit rate,描述每秒钟输出多少转载 2017-11-07 11:57:28 · 667 阅读 · 1 评论 -
Gradient 角度
switch (angle) { case 0: st.mOrientation = Orientation.LEFT_RIGHT; break; case 45: st.mOrientation = Orientation.BL_TR; break; case 90: st.mOrienta...原创 2019-05-13 20:34:59 · 2389 阅读 · 0 评论 -
利用Android Studio的liveTemplate功能,自动打印传入方法参数
进入设置LiveTemplate,在kotlin模板里面添加一个模板,名字可以叫logeTemplateText中输入:Log.e(TAG,"$methodname$ $args$");点击右侧EditVariablesmethodname kotlinFunctionName()args groovyScript("def sb ...原创 2019-03-18 16:09:11 · 836 阅读 · 0 评论 -
LinearLayout里面设置多个TextView,TextView高度不一致的问题
如下图所示:最后一个TextView有两行文字,高度被缩小了,和第一第二个TextView的高度明显不同。 请注意,文字排列十分整齐,我怀疑父类帮他对齐了,所以查了一下LiearLayout的文档,发现属性里面有一个baseLineAligned十分可疑,文档上解释是:如果该属性设置false,就阻止layout自动使用baseLine对齐,于是我试了一下设置成false ,问题就解...原创 2018-11-22 18:15:14 · 3873 阅读 · 0 评论 -
Android SpannableString Example
转载自:http://androidcocktail.blogspot.com/2014/03/android-spannablestring-example.html The SpannableString in android is an excellent way to style strings in a TextView.Put simply, it allows a ...转载 2018-11-22 15:48:28 · 169 阅读 · 0 评论 -
CoordinatorLayout使用详解: 打造折叠悬浮效果
补充:不想要下面的阴影,可以在代码里面这么写app_bar_layout.targetElevation = 0f1.简介CoordinatorLayout遵循Material 风格,包含在 support Library中,结合AppbarLayout, CollapsingToolbarLayout等 可 产生各种炫酷的折叠悬浮效果。- 作为最上层的View- 作为一...转载 2018-10-19 10:36:57 · 308 阅读 · 0 评论 -
Android_Gridlayou中有textview的文字过长超过显示的边界处理方法
问题描述:xml中的层次结构 <android.support.v7.widget.GridLayout android:id="@+id/gridlayout" android:layout_width="match_parent" android:layout_height="wrap_cont...原创 2018-09-06 10:11:46 · 1629 阅读 · 0 评论 -
ffmpeg无损转h265
From my own experience, if you want absolutely no loss in quality, --lossless is what you are looking for.Not sure about avconv but the command you typed looks identical to what I do with FFmpeg转载 2018-02-06 16:59:44 · 19030 阅读 · 0 评论 -
cavas居中文画字
Center with Paint.getTextBounds():private Rect r = new Rect();private void drawCenter(Canvas canvas, Paint paint, String text) { canvas.getClipBounds(r); int cHeight = r.height();转载 2018-01-30 09:51:28 · 293 阅读 · 0 评论 -
How to Completely Remove Android Studio
Execute these commands from the terminal rm -Rf /Applications/Android\ Studio.app rm -Rf ~/Library/Preferences/AndroidStudio* rm ~/Library/Preferences转载 2018-02-05 09:51:32 · 402 阅读 · 0 评论 -
Koltin-用法总结
1. Kotlin配置点击菜单栏的“Tools”选项,选择“Kotlin”,然后选择“Configure Kotlin in Project”。如下图所示。 在弹出的窗口中选择需要使用Kotlin的模块和Kotlin编译器和运行时的版本,如下图所示。 点击“OK”之后,Kotlin插件会自动开始配置。配置完成之后,同步一下工程(Sync Project)即可。转载 2018-01-30 20:03:28 · 382 阅读 · 0 评论 -
添加android设备号
echo 0x2207 >> “%USERPROFILE%\.android\adb_usb.ini”原创 2013-10-01 01:11:46 · 992 阅读 · 0 评论 -
动态显示/隐藏 titlebar
public class MainActivity extends Activity { boolean flag = true; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.a原创 2013-08-16 13:27:31 · 2000 阅读 · 0 评论 -
关于Only the original thread that created a view hierarchy can touch its views的解决方案
原作者:http://www.cnblogs.com/king_dy/archive/2010/11/27/1889444.html 我表示很头疼,碰到这个问题,丝毫不晓得哪里出了问题。但问题必须得解决,硬着头皮一点一点试,总觉得跟线程有关系,不停的换关键词baidu,google各种搜索,最终,发现问题的所在。 我所做的游戏游戏画面用的是GL绘制,而今天我要添加的mobclix确转载 2012-09-07 15:27:19 · 745 阅读 · 0 评论 -
Layout Animation
出处:http://www.imobilebbs.com/wordpress/?p=2063本例显示ListView将从下到上(Reverse Order)显示列表项。本例的用法在Android ApiDemos示例解析(95):Views->Animation->3D Transition 已有说明:看一下@anim/layout_bottom_to_top_slide” 的转载 2012-09-05 10:16:16 · 642 阅读 · 0 评论 -
spinner 中如何添加图片
spinner是一个非常好用的选择列表,他的adapter#getView方法接受返回textView,所以如果使用一个自定义有图片的xml,会发生错误,解决方法是使用text#setCompoundDrawablesWithIntrinsicBounds(BitMapUtil.getBitMapDrawable((Activity)context, fileName), null, null,原创 2012-09-01 22:16:10 · 3722 阅读 · 0 评论 -
android sdk<10的情况下,系统才会显示三个点的菜单~~
国外网站上找的:For Android 3.0+, an efficient way to access my Preference activity would be by implementing the action barThe action bar can be added by changing the theme to Theme.Holo, which is ava原创 2012-08-05 01:58:01 · 1884 阅读 · 0 评论 -
ArrayList 中 contains remove 判断元素相同 底层调用了 equals方法
我们有时候需要判断arraylist容器中是否已经存了某个元素,那么调用contains(object)方法就可以了,他的返回值是boolean类型,若有已经存在某元素则返回true,如果不存在则返回false。比如package info.dyndns.oszc;import java.util.*;public class Utils { public static v原创 2012-04-15 21:42:12 · 4826 阅读 · 0 评论 -
android 延迟加载动作
private Handler handler;handler.postDelayed(new Runnable() { public void run() { try { loadNextFlag(); } catch (IOException e) { // TODO Auto-generated catch bloc原创 2012-04-13 20:55:59 · 2769 阅读 · 1 评论 -
AlertDialog教学
Android AlertDialog 教學(上)AlertDialog(對話方塊)很像是Android 的 MessageBox ,不過其實他的功能比windows上的 MessageBox 還要強大,且動作上不太相同。1.windows的 MessageBox 只能顯示訊息,可以設定按鈕數量,Android 的 AlertDi转载 2012-04-14 11:46:12 · 1206 阅读 · 0 评论 -
關於圖片隨著dpi改變
http://blog.k-res.net/?p=642 中有介紹细分了很多文件夹处理以支持不同设备的分辨率加载对应的图片,如drawable-hdpi,drawable-ldpi,drawable-mdpi 等,如果没有注意这个问题而将贴图图片随意安置的话,在decode的时候系统会默认根据设备dpi的不同对目标图片格式解码的同时进行大小调整,也就是 说有可能破坏原本已经是2^n大小的贴图图转载 2012-04-14 11:48:02 · 514 阅读 · 0 评论 -
安卓动态增加按钮
首先了解一下LayouInflater类:将一个layout xml文件实例化为相应的View 对象。他永远不会直接使用,而是使用 getLayoutInflater() 或者 getSystemService(String) 来获得标准的LayoutInflater实例,这个实例已经将context连接起来,为正在运行的设备配置正确。比如:LayoutInflater infla原创 2012-04-13 16:57:39 · 1949 阅读 · 0 评论 -
android 获取资源
FlagQuizGame Select Number of Choices correct Guess the Country giesses Incorrect! More Regions Required There are not enough countries in the selected regions. Ple原创 2012-04-11 11:49:20 · 697 阅读 · 0 评论 -
如何在ScrollView中嵌套ListView
在ScrollView中添加一属性 android:fillViewport="true" ,这样就可以让ListView全屏显示了转载 2012-09-07 19:56:28 · 696 阅读 · 0 评论 -
MeasureSpec 资料汇总
来源:http://blog.csdn.net/whyrjj3/article/details/7927585在自定义View和ViewGroup的时候,我们经常会遇到int型的MeasureSpec来表示一个组件的大小,这个变量里面不仅有组件的尺寸大小,还有大小的模式。这个大小的模式,有点难以理解。在系统中组件的大小模式有三种:转载 2012-09-12 21:35:53 · 1051 阅读 · 0 评论 -
ANDROID 2D
android 自定义View类的简单使用 示例 android SurfaceView 使用示例 why SurfaceView上 不可以用控件的轻微解释 android Paint和Color类介绍 使用示例 android Canvas类介绍 android Draw Rect 坐标图示 android 字符串绘制示例 android转载 2012-10-03 00:01:47 · 648 阅读 · 0 评论 -
dp 转px
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 14, r.getDisplayMetrics());原创 2013-08-19 10:09:07 · 566 阅读 · 0 评论