當前位置:首頁 » 安卓系統 » android打電話

android打電話

發布時間: 2022-02-16 07:27:03

㈠ android開發怎麼撥打電話

無許可權版(彈出撥號界面並自動輸入電話號碼,用戶選擇是否撥號):

java">importandroid.content.Context;
importandroid.content.Intent;
importandroid.net.Uri;
publicvoidCall(StringNum,Contextc){
if(Num!=null&&Num.length()>0){
Intentitt=newIntent(Intent.ACTION_DIAL,Uri.parse("tel:"+Num));
itt.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
c.startActivity(itt);
}
}

許可權版(彈出撥號界面,自動輸入電話號碼並立刻撥號,在部分系統中會觸發安全警告):

<!---許可權--->
<uses-permissionandroid:name="android.permission.CALL_PHONE"/>
importandroid.content.Context;
importandroid.content.Intent;
importandroid.net.Uri;
publicvoidCall(StringNum,Contextc){
if(Num!=null&&Num.length()>0){
Intentitt=newIntent(Intent.ACTION_CALL,Uri.parse("tel:"+Num));
itt.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
c.startActivity(itt);
}
}

㈡ android怎樣點擊號碼就撥打電話

點好號碼的話,應該是監聽listview的item的點擊事情,然後調用intent,就可以撥打電話了。

㈢ android 鎖屏打電話怎麼實現

我朋友手機也發生過這樣的情況 一般是第三方軟體造成的 恢復出廠設置就可以了 但是你的是刷過機的 硬格 恢復出廠設置 看看有用沒有 不然就得找專業人士了

㈣ Android怎麼實現打電話源碼

Activity對應的xml的布局
<RelativeLayout xmlns:android="schemas.android.com/apk/res/android" ,前面加上http xmlns:tools="schemas.android.com/tools" 前面加上http
android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" >
<EditText android:id="@+id/telNo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="25dp" android:layout_marginTop="26dp" />
<Button android:id="@+id/btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/telNo" android:layout_below="@+id/telNo" android:layout_marginTop="37dp" android:text="Button" />
</RelativeLayout>

主項目裡面的Activity裡面的方法,注意,添加命名空間
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button btn = (Button)findViewById(R.id.btn); final EditText phoneNoText = (EditText)findViewById(R.id.telNo); btn.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { String telNo = phoneNoText.getText().toString(); if((telNo!=null)&&(!"".equals(telNo.trim()))){ Intent intent = new Intent(Intent.ACTION_CALL,Uri.parse("tel:"+telNo)); startActivity(intent); } } }); }
在AndroidManifest.xml裡面修改關鍵部分。
<uses-permission android:name="android.permission.CALL_PHONE"/>
上述功能是准許用戶,可以執行,撥號功能,這是必不可少的,沒有的話,會包異常。

安卓系統用來打電話的是哪些軟體

去下載一個卡刷的包吧,用winrar之類的壓縮軟體可以打開壓縮包,撥號的那個一般在system/app下,名字一般叫「phone.apk」

㈥ android 撥打電話界面。可以使用鍵盤撥打,也可以點擊listview的item撥打。如果系統

你好,很高興為你解答問題!
學習了。
新軟體。
如果這個答案能夠幫到你,請及時採納噢,謝謝!

㈦ android如何獲取textview里的值 然後撥打電話,已經有一個撥打電話的按鈕了,如何獲取值然後撥打

TextView text=(TextView)findViewById(R.id.textview01);
String s=text.getText().toString().trim();
Intent myIntentDial=new Intent("android.intent.action.CALL",Uri.parse("tel:"+s));
startActivity(myIntentDial);

㈧ 安卓怎麼判斷撥打打電話是否接通了

android源碼裡面是有以下狀態的:
IDLE,//待機,沒有連接
ACTIVE,//通話
HOLDING,//掛斷通話
DIALING,//響鈴
ALERTING,//提醒
INCOMING,//來電
WAITING,//等待接通
DISCONNECTED,//連接斷開後
DISCONNECTING;//連接斷開工程中

㈨ android如何實現後台打電話

第一種方法,撥打電話跳轉到撥號界面。源代碼如下:
?

1
2
3
4

Intent intent = new Intent(Intent.ACTION_DIAL);
Uri data = Uri.parse("tel:" + "135xxxxxxxx");
intent.setData(data);

㈩ android怎麼調用手機系統打電話

新建一個Android工程,取名為TestCallphone

打開res|layout|activity_main.xml

編輯activity_main.xml,添加如下代碼:
<Button android:id="@+id/btn_call" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="直接呼叫聯通客服10010" />

打開MainActivity.java,並編輯,添加如下代碼:
import android.app.Activity;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;
public class MainActivity extends Activity { private Button mCallButton;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mCallButton = (Button) findViewById(R.id.btn_call); mCallButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_CALL, Uri .parse("tel:10010")); startActivity(intent); } }); }
}

打開AndroidManifest.xml,添加撥打電話的許可權,
<uses-permission android:name="android.permission.CALL_PHONE"/>
必須添加這條許可權,否則無法撥打電話

6
連接手機,運行程序

熱點內容
怎麼才能知道電視是不是安卓系統 發布:2025-02-07 03:04:23 瀏覽:815
銀行更改密碼紅色預警是什麼意思 發布:2025-02-07 02:54:22 瀏覽:551
androiddomain 發布:2025-02-07 02:46:04 瀏覽:843
埠掃描源碼 發布:2025-02-07 02:31:01 瀏覽:470
androidurl獲取圖片 發布:2025-02-07 02:22:11 瀏覽:482
調用上傳 發布:2025-02-07 02:19:53 瀏覽:84
aix編譯安裝 發布:2025-02-07 02:19:52 瀏覽:906
android界面設計尺寸 發布:2025-02-07 02:16:25 瀏覽:898
zenly安卓為什麼會一直閃 發布:2025-02-07 02:12:02 瀏覽:358
為什麼安卓手機界面總出廣告 發布:2025-02-07 02:10:33 瀏覽:244