- 浏览: 385448 次
- 性别:
- 来自: 北京
-
文章分类
最新评论
-
lingmzai:
你好,有两个问题请教:1. convert命令能将png格式转 ...
Linux之convert命令 -
ykb19891230:
...
将源码项目工程引入eclipse,并在linux下编译源码 -
spdx4046:
我发现用数组和不用数组的差别很大很大哎!
比如: ...
ByteBuffer笔记 -
JavaJ2me:
谢谢,,结构分析的很细,,public Object Load ...
Java中的反射机制 -
zhucezhenmafan:
好用!
解决adb shell 找不到设备的问题
退出程序,可以直接杀死进程:
不再用USB线,直接用adb命令将apk push到sdcard中;
将当前目录下的所有文件push到sdcard中install文件夹。
关于那些烦人的单位:
res/values/color.xml:
程序异常终止的原因:
今天在程序中的switch中,忘写了一个break;程序经常莫名其妙的发生异常, 查看log信息也查不出来,后来看代码,才发现了这个漏掉的break~~
android.os.Process.killProcess(android.os.Process.myPid());
不再用USB线,直接用adb命令将apk push到sdcard中;
#:adb push ./ /sdcard/install
将当前目录下的所有文件push到sdcard中install文件夹。
关于那些烦人的单位:
android:maxWidth Since: API Level An optional argument to supply a maximum width for this view. See {see android.widget.ImageView#setMaxWidth} for details. Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type. This corresponds to the global attribute resource symbol maxWidth.
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="专辑" android:textSize="20sp" />
<ImageButton android:layout_width="100dip" android:layout_height="50dip" android:src="@android:drawable/sym_action_call" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="8dip" android:paddingRight="8dip">
<TextView android:text="@string/table_layout_9_open_shortcut" android:gravity="right" [color=red] android:padding="3dip"[/color] />
<Gallery android:id="@+id/gallery" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" [color=red]android:spacing="16dp"[/color] />
Dimension A dimension value defined in XML. A dimension is specified with a number followed by a unit of measure. For example: 10px, 2in, 5sp. The following units of measure are supported by Android: dp Density-independent Pixels - an abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. The compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp". sp Scale-independent Pixels - this is like the dp unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and the user's preference. pt Points - 1/72 of an inch based on the physical size of the screen. px Pixels - corresponds to actual pixels on the screen. This unit of measure is not recommended because the actual representation can vary across devices; each devices may have a different number of pixels per inch and may have more or fewer total pixels available on the screen. mm Millimeters - based on the physical size of the screen. in Inches - based on the physical size of the screen. Note: A dimension is a simple resource that is referenced using the value provided in the name attribute (not the name of the XML file). As such, you can combine dimension resources with other simple resources in the one XML file, under one <resources> element. file location: res/values/filename.xml The filename is arbitrary. The <dimen> element's name will be used as the resource ID. resource reference: In Java: R.dimen.dimension_name In XML: @[package:]dimen/dimension_name syntax: <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="dimension_name" >dimension</dimen> </resources>elements: <resources> Required. This must be the root node. No attributes. <dimen> A dimension, represented by a float, followed by a unit of measurement (dp, sp, pt, px, mm, in), as described above. attributes: name String. A name for the dimension. This will be used as the resource ID. example: XML file saved at res/values/dimens.xml: <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="textview_height">25dp</dimen> <dimen name="textview_width">150dp</dimen> <dimen name="ball_radius">30dp</dimen> <dimen name="font_size">16sp</dimen> </resources>This application code retrieves a dimension: Resources res = getResources(); float fontSize = res.getDimension(R.dimen.font_size);This layout XML applies dimensions to attributes: <TextView android:layout_height="@dimen/textview_height" android:layout_width="@dimen/textview_width" android:textSize="@dimen/sixteen_sp"/>
res/values/color.xml:
<?xml version="1.0" encoding="utf-8"?> <resources> <drawable name="red">#7f00</drawable> <drawable name="blue">#770000ff</drawable> <drawable name="green">#7700ff00</drawable> <drawable name="yellow">#77ffff00</drawable> <drawable name="screen_background_black">#ff000000</drawable> <drawable name="translucent_background">#e0000000</drawable> <drawable name="transparent_background">#00000000</drawable> <color name="solid_red">#f00</color> <color name="solid_blue">#0000ff</color> </resources>
程序异常终止的原因:
今天在程序中的switch中,忘写了一个break;程序经常莫名其妙的发生异常, 查看log信息也查不出来,后来看代码,才发现了这个漏掉的break~~
发表评论
-
解决32位Linux找不到adb
2012-08-18 15:30 1553sudo apt-get install ia32-libs -
Code Review中的几个提示
2012-06-11 13:18 1253$转载$ 作者:陈皓 Code Review应该是软件工程 ... -
Android 远程Debug的方法和步骤
2012-04-10 10:40 13841.连接上设备后,打开要debug的应用,打开DDMS,在De ... -
Android中的那些sql语句
2012-02-29 14:30 1332Uri baseUri; if (mC ... -
Ubuntu10.10搭建Android开发环境
2012-01-13 10:39 1253Installing the JDK The Sun JDK ... -
最近习惯用txt写日志了,呵呵
2011-07-20 23:00 122好长时间不怎么来,javaeye变化挺大啊 -
ServiceConnection
2011-06-17 17:46 1889ServiceConnection android.cont ... -
Android之Intent
2011-06-16 23:51 1048Intent 1.构造方法 1.Intent(Contex ... -
requestWindowFeature
2011-04-12 14:35 1256一、枚举常量 1.DEFAULT_FEATURES:系统默认 ... -
32位机器Ubuntu系统编译2.2以上源码(默认需要64位机)
2011-04-11 11:44 1445默认下载下来的froyo2.2版本代码,是64位配置的。需要稍 ... -
Android的多分辨率支持
2011-03-28 17:02 2730在设计之初,Android系统 ... -
得到Android系统预置软件的apk!
2011-02-25 16:39 1351先 adb shell 再 cd /system/app 就看 ... -
android图片资源转换
2011-02-18 10:14 1840android在处理一写图片资源的时候,会进行一些类型的转换, ... -
代码3
2011-02-11 16:13 1141ArrayList<ColumnInfo> ... -
Android之IntentService
2011-02-09 17:29 1678参考:http://www.wheremylife.com/h ... -
Android之Animation
2011-02-09 15:02 910先小参考下别人的http://blog.sina.com.cn ... -
代码2
2011-02-09 10:55 1519public abstract void onItemClic ... -
Android VS iOS:2011年的死亡竞技赛
2011-01-28 14:54 1026Android和iOS之间的竞争在 ... -
Android 权限列表permission说明
2011-01-20 15:26 1867public static final String B ... -
Windows下git下载Android源码
2011-01-16 20:06 23231.到这里先下载cygwin,http://www.cygwi ...
相关推荐
该系统的设计与实现主要基于Android客户端应用开发,涉及到移动学习、学习资源、设计与实现等方面的知识点。 一、移动学习系统的需求分析 移动学习系统的需求分析是进行设计与开发的重要工作,就是要清楚这个系统...
知识点: 1. 项目开发目标: * 项目来源:手机电子书阅读器属于自选项目,旨在解决人们在空余时间进行电子书阅读的需求。 * 发展目标:让用户可以把零碎的空余时间有效的利用到书籍的阅读上,并且用户在没有网路...
(主要是从一个Android开发者的角度来述说的,可能比较零碎的一些知识点和经验,如果大家还有补充,欢迎) 总结 1:传参,方法判断 js中 方法中可以传递一个方法作为形参,在java中是不可以的。比如start项目中的 ...
(主要是从一个Android开发者的角度来述说的,可能比较零碎的一些知识点和经验,如果大家还有补充,欢迎) 总结 1:传参,方法判断 js中 方法中可以传递一个方法作为形参,在java中是不可以的。比如start项目中的 ...
计算机网络技术专业毕业论文题目涵盖了多个方面的知识点,包括网络技术、数据分析、人工智能、云计算、网络安全等。 基于挪动互联网下打扮品牌的推行及使用研讨 在这个题目中,研究者可以探讨如何使用挪动互联网...
根据提供的文件信息,以下是对【标题】和【描述】所涉及的知识点的详细阐述: 1. 微信小程序的概念与应用: 微信小程序是一种不需要下载安装即可使用的应用,它实现了“触手可及”的应用体验。用户扫一扫或搜索即可...