拨号通话
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. 高速决心linux上oracle安装垃圾问题

    问题:在linux安装oracle时间.因为oracle用户local LANG安装问题,原因安装oracle软件.该接口是非常多的安装位置是乱码. 解决方案:在oracle用户运行:export L ...

  2. Spring IOC之基于注解的容器配置

    Spring配置中注解比XML更好吗?基于注解的配置的介绍提出的问题是否这种途径比XML更好.简单来说就是视情况而定. 长一点的答案是每一种方法都有自己的长处也不足,而且这个通常取决于开发者决定哪一种 ...

  3. HDU 2064 汉诺塔III

    汉诺塔III Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submis ...

  4. JSON解析之Gson

    1.Gson简介 Gson是一个将Java对象转为JSON表示的开源类库,由Google提供,并且也可以讲JSON字符串转为对应的Java对象.虽然有一些其他的开源项目也支持将Java对象转为JSON ...

  5. Inno Setup connection to the database and create

    原文 Inno Setup connection to the database and create Description: the first half of this program in I ...

  6. SQL Server 2008 允许远程链接,适用于广域网和局域网

    用户在使用SQL Server 2008远程链接时,可能会弹出如下对话框: 在链接SQL服务器时发生网络链接错误或特定实例错误.SQL服务器不存在或者链接不成功.请验证用户名是否正确或SQL服务器是否 ...

  7. 修改servu数据库密码 servu加密方式

    项目要求可以有用户自行修改servu密码.servu可以通过odbc访问access\mysql\sqlserver数据库.我们直接通过创建web来修改就可以了. 不过问题来了,密码是加密的...通过 ...

  8. Mvc的多层架构

    分享一个Mvc的多层架构,欢迎大家拍砖斧正   多层架构是什么? 多层架构是开发人员在开发过程当中面对复杂且易变的需求采取的一种以隔离控制为主的应对策略,关于多层架构的标准,我认为有一句话是比较有代表 ...

  9. iOS基础 - 文本属性Attributes

    NSKernAttributeName: 调整字句 kerning 字句调整 NSFontAttributeName : [UIFont systemFontOfSize:_fontSize] 设置字 ...

  10. Python语言在企业级应用上的十大谬误

    英文原文:https://www.paypal-engineering.com/2014/12/10/10-myths-of-enterprise-python/ 翻译原文:http://www.os ...