拨号通话
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. APP 半自适应 WEB页面

    特别赶,响应式纯自适应的,有空写了新的发. (在手机上看,页面上看一定乱) <!DOCTYPE html><html> <head> <meta http-e ...

  2. android 控制手机的体积的大小 切换音效模式

    (1)项目介绍 于android API的AudioManager于,它提供了一种方法来调整电话音量. audioMa.adjustVolume(AudioManager.ADJUST_LOWER, ...

  3. installshield 32位打包和64位打包的注意事项

    原文:installshield 32位打包和64位打包的注意事项 32/64位问题要把握几点:1. 明确你的产品是否需要区分32/64位2. 明确你的产品中是否有32/64位的服务注册3. 了解In ...

  4. ym——android源代码大放送(实战开发必备)

    转载请注明本文出自Cym的博客(http://blog.csdn.net/cym492224103),谢谢支持! 目录 PATH 列表 卷序列号为 000A-8F50 E:. │  javaapk.c ...

  5. NHibernate中使用memcache二级缓存

    在NHibernate中使用memcache二级缓存 一.Windows下安装Memcache  1. 下载   http://jehiah.cz/projects/memcached-win32/  ...

  6. jquery中的一点工作小记

    在做一个页面的时候,网页中由许多块相同的地方 ,例如页面中会有多个地方用到TAB 效果,在使用each()遍历以后  不一定会正常显示,这是因为写的html静态页面中只有当前板块中有这个的类,若是用J ...

  7. ASP.NET-FineUI开发

    ASP.NET-FineUI开发 随笔分类 - FineUI   ASP.NET-FineUI开发实践-10 摘要: 嵌套Grid,光棍月大放送,不藏着掖着.实在写的不好,没脸藏啊~只考虑显示排序修改 ...

  8. CSS知识点:font小细节

    font是用来设置网页字体属性的关键字,使用频率非常高,大家也比较熟悉.它有两种写法,一种是简写,一种分开写. 简写--font:italic bold 12px/20px arial,sans-se ...

  9. beanutils通过SimpleProperty使用get或set方法赋值

    public class Employee { private String  firstName;    private String lastName;    public Employee() ...

  10. 由于检索用户的本地应用程序数据路径时出错,导致无法生成 SQL Server 的用户实例

    /”应用程序中的服务器错误. 由于检索用户的本地应用程序数据路径时出错,导致无法生成 SQL Server 的用户实例.请确保该用户在此计算机上有本地用户配置文件.该连接将关闭. 堆栈跟踪: [Sql ...