Android开发手机拨号程序实现实例源码介绍,在上一篇文章中,我们实现了第一个程序:helloWorld,并成功测试完成。还给大家介绍了Android项目结构和说明。现在写一个手机拨号程序:
首先,我们新建一个项目:phoneActivity.java
在res/values/string.xml中写入两个字符串:
请输入你要拨打的号码
拨打
上述两条字符串一定要写在根目录中;
然后,我们需要在res/layout/main.xml文件中新建两个组件,一个是输入数字的文本框,一个是“拨号”的按钮,也就是button:
android:layout_width=”file_parent”
android:layout_height=”wrap_content”
android:text=”@string/input_info”/>
/>
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:id=”@+id/phone_number”
/>
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”@string/dial_caption”
android:id=”@+