iCall是由哥开发的一款android平台的电话拨号小工具,简单不能再简单的Android手机拨号程序。
代码不过几行:
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/mobilelabel" />
- <EditText android:id="@+id/mobile"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"/>
- <Button android:id="@+id/call"
- android:text="@string/callbutton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
- </LinearLayout>
- package gphone.cc.iCall;
- import android.app.Activity;
- import android.content.Intent;
- import android.net.Uri;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- public class iCallActivity extends Activity
- {
- EditText mobile;
- Button call;
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- mobile=(EditText)this.findViewById(R.id.mobile);
- call=(Button)this.findViewById(R.id.call);
- call.setOnClickListener(new Button.OnClickListener(){
- public void onClick(View view) {
- String mobileNumber=mobile.getText().toString();
- Intent intent=new Intent(Intent.ACTION_CALL, Uri.parse("tel:"+mobileNumber));
- iCallActivity.this.startActivity(intent);
- }
- });
- }
- }
下载地址:简易拨号器iCall 1.0 (扩展名改为apk后安装) 或登录谷歌市场搜索iCall或简易拨号器