Android
文章平均质量分 69
onecoders
Roy Sun
展开
-
关于Traceview的使用
Traceview是android平台配备一个很好的性能分析的工具。它可以通过图形化的方式让我们了解我们要跟踪的程序的性能,并且能具体到method。下面我们看下如何使用这个东东。首先,我们必须在程序当中加入代码,以便生成trace文件,有了这个trace文件我们才可以将其转化为图形。要添加的代码如下:Java代码 // start tracing to "/sd转载 2013-04-11 16:27:17 · 719 阅读 · 0 评论 -
How-to: Customize Android progress bars
IntroductionThis how-to will show you how to customize Android’s default progress bar to fully suit your needs. You will create an application that demonstrates different styles of progress bar. The转载 2013-08-05 14:52:14 · 1498 阅读 · 0 评论 -
Android Unique Device ID
There are several occasions when the unique identifier of a device is required. For instance you need it to generate a serial key and unlock a trial version, to generate encryption keys or to have the转载 2013-07-28 18:40:19 · 1152 阅读 · 0 评论 -
Android URI简介
就Android平台而言,URI主要分三个部分:scheme, authority and path。其中authority又分为host和port。格式如下:scheme://host:port/path举个实际的例子:content://com.example.project:200/folder/subfolder/etc\---------/ \-------------转载 2013-07-28 15:02:29 · 668 阅读 · 0 评论 -
Zipping Files with Android (Programmatically)
One majorly annoying issue that I stumbled upon, was the fact that I couldn't send multiple attachments using Intents to the Google Mail app. The quickest way around that was of course to compress all转载 2013-07-27 15:25:51 · 804 阅读 · 0 评论 -
Android EditText with custom font and clear button
C’mon, admit it, you’ve always wanted this. Have you ever felt that text clearing in your android application on EditTexts feels… wrong ?So, what do we want to achive?Plain and simple, a TextView,转载 2013-06-25 15:28:41 · 4307 阅读 · 0 评论 -
[Android] JAR Library: Export and Import
Export LibraryPrepare source codeCreate an Android projectCreate source code, and fix all bugRemove res/*Remove unused source filesEdit AndroidManifest.xml to remove the statements that refe转载 2013-06-20 11:57:15 · 1240 阅读 · 0 评论 -
ViewPager多页面滑动切换以及动画效果
一、首先,我们来看一下效果图,这是新浪微博的Tab滑动效果。我们可以手势滑动,也可以点击上面的头标进行切换。与此同方式,白色横条会移动到相应的页卡头标下。这是一个动画效果,白条是缓慢滑动过去的。好了,接下来我们就来实现它。 二、在开始前,我们先要认识一个控件,ViewPager。它是google SDk中自带的一个附加包的一个类,可以用来实现屏幕间的切换。这个附加包是android-su转载 2013-05-15 10:25:35 · 698 阅读 · 0 评论 -
Android升级ADT22后会报ClassNotFoundException的原因分析
最近有个同事跟我报怨说,他的系统重装Eclipse使用新的ADT22后,编译的android apk运行总会报ClassNotFoundException错误。我说这怎么可能,谷歌这么大的公司出来的东西怎么可能有这种问题。他说不信你试试,我说试试就试试。我之前用的是ADT21,结果升到ADT22后一运行,晕,不得不服,还果真是ClassNotFound了。接下来我又换了几个工程编译运行,发现并转载 2013-05-25 14:14:30 · 564 阅读 · 0 评论 -
Support different Android device configurations with dimension resources
Takeaway: Dimension resources simplify the task of building and maintaining a flexible Android app that looks good on various devices. Follow these best practices when using dimension resources.A be转载 2013-05-03 18:39:35 · 892 阅读 · 0 评论 -
Android中Dimension的计量单位详解
px:是屏幕的像素点in:英寸mm:毫米pt:磅,1/72 英寸dp:一个基于density的抽象单位,如果一个160dpi的屏幕,1dp=1pxdip:等同于dpsp:同dp相似,但还会根据用户的字体大小偏好来缩放。建议使用sp作为文本的单位,其它用dip针对dip和px 的关系,做以下概述:HVGA屏density=160;QVGA屏density=120;转载 2013-05-03 18:13:50 · 1294 阅读 · 0 评论 -
关于相对布局RelativeLayout的各种属性介绍
RelativeLayout相对布局是个人觉得在android布局中比较常用且好用的一个,当然如果想让布局更漂亮是需要多种布局混合搭建的,这里就需要更深入的学习了,在这只介绍下有关相对布局的东西。相对于兄弟元素android:layout_below="@id/aaa":在指定View的下方android:layout_above="@id/xxx":在指定View的上方and转载 2013-05-17 14:02:01 · 719 阅读 · 0 评论 -
深度解析Android中字体设置
1、在Android XML文件中设置字体 可以采用Android:typeface,例如android:typeface=”monospace”。在这里例子中我们在Activity中对android:text=”Hello, World! 您好”分别进行了四种显示方式,依次为“Sans”,“serif”,“monospace”和系统缺省方式(经试验缺省采用采用sans)。英文字体有差异,貌似转载 2013-05-02 09:25:25 · 727 阅读 · 0 评论 -
android使用adb命令安装软件
准备工作:确信 \android-sdk-windows\tools\下有 adb.exe AdbWinApi.dll AdbWinUsbApi.dll 三个文件,如果没有从\android-sdk-windows\platform-tools\ 下面拷贝到tools下(android sdk 3.0 以上版本一些工具默认不放在tools下,作为可选配置放在platform-t转载 2013-04-18 17:09:46 · 1256 阅读 · 0 评论 -
Custom Progress Bar In Android
Android Development TutorialCustomized Progress BarIn Android we can customize the Progress Bar and make it more attractive and beutifull.Customize Progress Bar ExampleHere I have use转载 2013-08-05 13:19:48 · 1305 阅读 · 0 评论