拨号通话
ListView
GridView
AdapterView


在路径android-sdkr16\android-sdkr16\platform-tools确认存在adb.exe
下载youlu_android_1_2_7.youlu.apk
运行cmd
d:
cd D:\0701\android0701\android-sdkr16\android-sdkr16\platform-tools
adb install youlu_android_1_2_7.youlu.apk
安装adb.exe


D:\0701\android0701\android-sdkr16\android-sdkr16\docs\reference\android\widget
可看android的参考文档

Adapter的4个方法
getCount
getView

getItem
getItemId

D:\0701\android0701\android-sdkr16\android-sdkr16\tools
点开draw9patch.bat
完成图像的自由拉伸
如:call_log_type_item_bg_a.9.png



常志鹏
18046501727
changzp@tarena.com.cn
QQ群:326285800

拨号通话:
现完成的是键盘的设置
--------------------------------------------------------------
PhoneManager.java
package cpm.tarena.Phone;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class PhoneManagerActivity extends Activity {
 
//ImageButton mImagebutton_1,mImageButton_2,mImageButton_3,mImageButton_4,mImageButton_5,mImageButton_6,mImageButton_7,mImageButton_8,mImageButton_9,mImageButton_10,mImageButton_11,mImageButton_12;
 
ImageButton key_hide;
LinearLayout mLinearLayout;
 
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        mLinearLayout = (LinearLayout)findViewById(R.id.keyboard_layout);
        
        key_hide = (ImageButton) findViewById(R.id.key_hide);
        key_hide.setOnClickListener(new OnClickListener(){

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mLinearLayout.setVisibility(View.GONE);
}

        });   
    }
}

------------------------------------------------------------
main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
 
    <LinearLayout
android:id="@+id/keyboard_layout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"      
        android:orientation="vertical"
android:background="#fcfcfc">
        
       <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/keyboard_line_bg" >

            <ImageButton
                android:id="@+id/key_hide"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:background="#0000"
                android:src="@drawable/keyboard_hide" />

            <ImageButton
                android:id="@+id/key_del"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:background="#0000"
                android:src="@drawable/keyboard_backspace" />

            <Button
                android:id="@+id/call_button"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_toLeftOf="@id/key_del"
                android:layout_toRightOf="@id/key_hide"
                android:background="@drawable/dial_call_bg"
                android:text="139111111"
                android:textSize="18sp"
                android:textColor="#fff"
                android:ellipsize="start" />
        </RelativeLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <ImageButton
                android:id="@+id/key_1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_1"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
android:id="@+id/key_2"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_2"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_3"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_3"
                android:background="@drawable/key_bg_s"/>
        </LinearLayout>
        
         <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <ImageButton
                android:id="@+id/key_4"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_4"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_5"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_5"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_6"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_6"
               android:background="@drawable/key_bg_s"/>
        </LinearLayout>
        
          <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <ImageButton
                android:id="@+id/key_7"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_7"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_8"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_8"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_9"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_9"
                android:background="@drawable/key_bg_s"/>
        </LinearLayout>
        
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >       

            <ImageButton
                android:id="@+id/key_jin"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_hash"
                android:background="@drawable/key_bg_s"/>
            
             <ImageButton
                 android:id="@+id/key_0"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_0"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_xin"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_star"
                android:background="@drawable/key_bg_s"/>
        </LinearLayout>
         
    </LinearLayout>

</RelativeLayout>


-----------------------------------------------------
在res下新建文件夹drawable
在该文件下,新建selector
命名key_bg_s
(实现按键时,改变按键的颜色)
实现方法为设置背景时,设置为key_bg_s
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
        <item 
       android:drawable="@drawable/key_bg_a"
       android:state_pressed="true"/>        
        <item
            android:drawable="@drawable/key_bg"/>
</selector>


注意:严格的要求在上面
实现的效果为:

android实习程序6——拨号通话的更多相关文章

  1. android实习程序7——通话记录显示

    下载SQLiteSpy.exe 打开模拟器5554 打开perspective,选择DDMS 打开Devices,确认存在emulator-5554 打开file Explorer 打开data文件夹 ...

  2. 建立一个类似于天眼的Android应用程序:第4部分 - 持久收集联系人,通话记录和短信(SMS)

    建立一个类似于天眼的Android应用程序:第4部分 - 持久收集联系人,通话记录和短信(SMS) 电话黑客android恶意软件编程黑客入侵linux 随着我们继续我们的系列,AMUNET应用程序变 ...

  3. Mono for Android (2)-- Android应用程序初认识

    一:日志记录 先添加using Android.Util; 在该命名控件下有log类 Log.Info("HA", "End onCreate"); //记录消 ...

  4. android 应用程序框架

    携带Android软件开发时间,由开发商开发Android应用程序是通过应用程序框架和Android底层交互,因此,发展以达到最大的部分是应用程序框架. 应用集成框架 那里4一个重要组成部分,以下. ...

  5. 【Android】2.1 PhonewordApp—第1个Android应用程序

    分类:C#.Android.VS2015:  创建日期:2016-02-04 本例子演示如何添加一个简单的单页导航,在此基础上,再演示如何在第2个页面中显示第1个页面中拨打过的所有电话号码. (1)通 ...

  6. 与Android应用程序相关的文件目录都有哪些?(转载)

    与Android应用程序相关的文件目录都有哪些? | 浏览:1312 | 更新:2014-09-28 19:43 | 标签:android 一.方法介绍:   每个Android应用程序都可以通过Co ...

  7. [转]Android应用程序框架思路整理

    一.一般Android应用程序架构(Book,购彩,Market). 普通的应用程序由于只需要用到Android的联网与显示的功能,所以应用程序大体上是呈现为UI(Activities)与网络(Net ...

  8. android的程序运行数据存放在哪里?

    Android应用开发中,给我们提供了5种数据的存储方式1 使用SharedPreferences存储数据2 文件存储数据3 SQLite数据库存储数据4 使用ContentProvider存储数据5 ...

  9. Android卸载程序之后跳转到指定的反馈页面

    一个应用被用户卸载肯定是有理由的,而开发者却未必能得知这一重要的理由,毕竟用户很少会主动反馈建议,多半就是用得不爽就卸,如果能在被卸载后获取到用户的一些反馈,那对开发者进一步改进应用是非常有利的.目前 ...

随机推荐

  1. android 使用asm.jar将android手机屏幕投射到电脑

    使用asm.jar将Android手机到电脑屏幕投影 有时候可能须要将手机上的一些操作投影出来,比方一些App Demo的展示等.事实上,有专门的硬件设备能干这件事儿.但不是必需专门为展示个Demo去 ...

  2. 3. SQL Server数据库状态监控 - 可用空间

    原文:3. SQL Server数据库状态监控 - 可用空间 数据库用来存放数据,那么肯定需要存储空间,所以对磁盘空间的监视自然就很有必要了. 一. 磁盘可用空间 1. 操作系统命令或脚本.接口或工具 ...

  3. 原生JS的DOM节点操作

    DOM(Document Object Model/文档对象模型)是针对HTML和XML文档的一个API.DOM节点树:在文档中出现的空格.回车.标签.注释.文本.doctype.标签等都属于DOM节 ...

  4. OCP-1Z0-051-题目解析-第5题

    5. Which SQL statements would display the value 1890.55 as $1,890.55? (Choose three .) A. SELECT TO_ ...

  5. .NET的微型Web框架 Nancy

    .NET的微型Web框架 Nancy .NET的微型Web框架 Nancy   大部分微软平台的开发人员如果选择开发框架只能是在ASP.NET WEBFORM和ASP.NET MVC两个之间选择. 而 ...

  6. ACE_Message_Block 学习

    本文参考http://www.cnblogs.com/TianFang/archive/2006/12/30/607960.html 1. ACE_Message_Block 的length() 返回 ...

  7. EF 关系描述

    网络上常常看到有ef 1对1 1对多等关系的描述,按照我的理解,其根本就是为了呈现出一个视图,我最近设计了一个ef关系,请大家看一看. 需求描述 在gps车辆信息管理中,有个开户需求,其根本就是三种关 ...

  8. 解决设置redmineblacklog的按钮无效问题

    安装了redemin+backlog后,想要设置backlog, 先用管理员登录,然后访问网页: http://localhost/settings/plugin/redmine_backlogs 发 ...

  9. JavaScript等比例缩放图片

    js等比例缩放图片,这个功能非常实用,当网页加载一个尺寸比较大的图片时,往往会把一个网页撑的变形,页面变得很难看,于是我们就想到了用JS去控制超出一定范围的图片,以稳定页面布局,本代码段就是完成了此功 ...

  10. SignalR 2.0 入门与提高

    SignalR 2.0 入门与提高 SignalR 2.0 最近整理了SignalR2.0 部分知识点,原文翻译,由于自己是土鳖,翻译得不好的地方,欢迎指正!仅供各位初学者学习! 第一节. 入门ASP ...