Android 拨号器开发一、软件功能 1 、实现使用自定义键盘进行拨打电话。 2 、实现从手机中获取通讯录。 3 、实现从手机中获取通话记录。二、实现界面三、设计步骤 1、在 Eclipse 中新建 Android 项目, 命名为“拨号器”, 然后一直“ next ”最后“ Finish ”。新建成功后文件目录结构为 2、先进行拨打电话的页面布局。在 res —>layout--> 把 l 布局文件删除,因为这是默认的相对布局,我们需要的是 TabHost 。新建 TabHost ,命名为 如下图。在 中的布局代码如下: < TabHost xmlns:android = "http://schemas./apk/res/android" android:layout_width = "match_parent" android:layout_height = "match_parent" android:background = "#FFFFFF" > < GridView android:id = "@+id/gridview_softkeyboard" android:layout_width = "fill_parent" android:layout_height = "wrap_content" android:layout_alignParentBottom = "true" android:layout_alignParentLeft = "true" android:background = "#FFFFFF" android:gravity = "center" android:horizontalSpacing = "5dip" android:numColumns = "4" android:stretchMode = "columnWidth" android:layout_marginTop = "200dp" android:verticalSpacing = "5dip" > </ GridView >< LinearLayout android:id = "@+id/tab1" android:layout_width = "match_parent" android:layout_height = "wrap_content" android:layout_marginTop = "50dp" android:orientation = "vertical" > < EditText android:id = "@+id/etnumer" android:layout_width = "match_parent" android:layout_height = "wrap_content" android:layout_alignParentLeft = "true" android:layout_gravity = "center_horizontal" android:ems = "15" android:inputType = "number" > </ EditText > </ LinearLayout > </ TabHost >3 、新建自定义键盘相对布局相对文件 ,事先需要在 res 下的 drawable-hdpi 文件夹下添加 图片. 添加布局代码: <? xml version = "" encoding = "utf-8" ?> < RelativeLayout xmlns:android = "http://schemas./apk/res/android" android:id = "@+id/RelativeLayout_Item" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_margin = "5dip" >< ImageView android:id = "@+id/item_image_softkeyboard" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_centerHorizontal = "true" android:src = "***@drawable/a" > </ ImageView >< Tex
安卓拨号器总结 来自淘豆网m.daumloan.com转载请标明出处.