今天课程记得结尾老师使用现在刚刚接触的 Android 写了一款打电话的小程序。
首先建立名字为 Phone的项目,
res/layout/ values/String.xml中的代码:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Phone</string>
<string name="input_info" >需要拨打的电话号码: </string>
<string name="dial_caption">拨打</string>
</resources>
接着就是在 layout/main.xml中的代码:
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/input_info" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
&nbs

这篇博客介绍了如何使用Android编程创建一个简单的虚拟拨打电话应用程序。通过在XML布局文件中定义用户界面,如输入框和拨打按钮,然后在PhoneActivity.java中编写逻辑,监听按钮点击事件并调用系统的拨号服务来实现电话拨打功能。开发者需要在AndroidManifest.xml中添加拨打电话的权限。最终,可以在两个Android模拟器之间测试通话功能。

2234

被折叠的 条评论
为什么被折叠?



