當前位置:首頁 » 安卓系統 » android調用簡訊界面

android調用簡訊界面

發布時間: 2022-09-27 10:03:00

Ⅰ 【高分懸賞】在Android系統中,利用系統的瀏覽器展示我們的頁面,其中有一個鏈接,點擊後打開簡訊列表。

分兩種情況:
1.如果你是沒有客戶端的,用系統瀏覽器打開,那麼點擊你網頁里的鏈接,是不可能調用到android的簡訊列表的,因為沒有許可權。
2.如果你打算做一個客戶端版的,這時候你需要添加讀取簡訊的許可權,而把你的網頁用webView來進行載入,在點擊頁面此鏈接時有一個交互,收到此命令,程序實現打開簡訊列表的功能。

至於WebView的交互,你可以在網上查一下資料,打開簡訊也是,容易找到的,難度不大。
但是想僅僅通過瀏覽器,能調出簡訊列表,這是不現實的。

Ⅱ intent激活Android自帶的簡訊系統,發送簡訊

//取得一個默認實例的SmsManager
SmsManager sm=SmsManager.getDefault();
if(isPhoneNumberValid(s01)&&isWithin70(s02)){
/**
* 當兩個判定條件都通過時發送簡訊,先構建一個PendingIntent對象並使用getBroadcast()廣播
* 然後將PendingIntent,簡訊,電話號碼等內容傳入SmsManager的sendTextMessage()方法中*/
try {
PendingIntent pi=PendingIntent.getBroadcast(myActivity.this, 0, new Intent(), 0);
sm.sendTextMessage(s01, null, s02, pi, null);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
以上,題主可以參考下,傳入的參數有不懂的,可以看下API介紹。

Ⅲ Android開發中,怎樣調用系統的功能,注意下面的說明。

你指的信息模塊是手機點擊簡訊圖標所進入的界面嗎?
android中的簡訊,通訊錄其實也是程序,在這些程序中通過使用者對界面的操作,調用系統的功能,比如發簡訊,打電話等等.
你可以點擊菜單之後直接調用發簡訊的功能,也可以打開系統的簡訊程序.

Ⅳ 如何調用Android系統程序詳細信息界面

調用Android系統「應用程序信息(Application Info)」界面「Android系統設置->應用程序->管理應用程序」列表下,列出了系統已安裝的應用程序。選擇其中一個程序,則進入「應用程序信息(Application Info)」界面。這個界面顯示了程序名稱、版本、存儲、許可權等信息,並有卸載、停止、清除緩存等按鈕,可謂功能不少。如果在編寫相關程序時(比如任務管理器)可以調用這個面板,自然提供了很大的方便。那麼如何實現呢?

在最新的Android SDK 2.3(API Level 9)中,提供了這樣的介面。在文檔路徑

docs/reference/android/provider/Settings.html#ACTION_APPLICATION_DETAILS_SETTINGS

下,有這樣的描述:

public static final String ACTION_APPLICATION_DETAILS_SETTINGS Since: API Level 9

Activity Action: Show screen of details about a particular application.
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: The Intent's data URI specifies the application package name to be shown, with the "package" scheme. That is "package:com.my.app".
Output: Nothing.
Constant Value: "android.settings.APPLICATION_DETAILS_SETTINGS"

就是說,我們只要以android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS作為Action;「package:應用程序的包名」作為URI,就可以用startActivity啟動應用程序信息界面了。代碼如下:

view plain
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts(SCHEME, packageName, null);
intent.setData(uri);
startActivity(intent);

但是,在Android 2.3之前的版本,並沒有公開相關的介面。
通過查看系統設置platform/packages/apps/Settings.git程序的源碼,可以發現應用程序信息界面為InstalledAppDetails。
在這里(2.1)還有這里(2.2),我們可以分別看到Android2.1和Android2.2的應用管理程序(ManageApplications.java)是如何啟動InstalledAppDetails的。
view plain
// utility method used to start sub activity
private void () {
// Create intent to start new activity
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setClass(this, InstalledAppDetails.class);
intent.putExtra(APP_PKG_NAME, mCurrentPkgName);
// start new activity to display extended information
startActivityForResult(intent, INSTALLED_APP_DETAILS);
}

但是常量APP_PKG_NAME的定義並不相同。
2.2中定義為"pkg",2.1中定義為"com.android.settings.ApplicationPkgName"
那麼,對於2.1及以下版本,我們可以這樣調用InstalledAppDetails:
view plain
Intent i = new Intent(Intent.ACTION_VIEW);
i.setClassName("com.android.settings","com.android.settings.InstalledAppDetails");
i.putExtra("com.android.settings.ApplicationPkgName", packageName);
startActivity(i);

對於2.2,只需替換上面putExtra的第一個參數為"pkg"

綜上,通用的調用「應用程序信息」的代碼如下:
view plain
private static final String SCHEME = "package";
/**
* 調用系統InstalledAppDetails界面所需的Extra名稱(用於Android 2.1及之前版本)
*/
private static final String APP_PKG_NAME_21 = "com.android.settings.ApplicationPkgName";
/**
* 調用系統InstalledAppDetails界面所需的Extra名稱(用於Android 2.2)
*/
private static final String APP_PKG_NAME_22 = "pkg";
/**
* InstalledAppDetails所在包名
*/
private static final String APP_DETAILS_PACKAGE_NAME = "com.android.settings";
/**
* InstalledAppDetails類名
*/
private static final String APP_DETAILS_CLASS_NAME = "com.android.settings.InstalledAppDetails";
/**
* 調用系統InstalledAppDetails界面顯示已安裝應用程序的詳細信息。 對於Android 2.3(Api Level
* 9)以上,使用SDK提供的介面; 2.3以下,使用非公開的介面(查看InstalledAppDetails源碼)。
*
* @param context
*
* @param packageName
* 應用程序的包名
*/
public static void showInstalledAppDetails(Context context, String packageName) {
Intent intent = new Intent();
final int apiLevel = Build.VERSION.SDK_INT;
if (apiLevel >= 9) { // 2.3(ApiLevel 9)以上,使用SDK提供的介面
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts(SCHEME, packageName, null);
intent.setData(uri);
} else { // 2.3以下,使用非公開的介面(查看InstalledAppDetails源碼)
// 2.2和2.1中,InstalledAppDetails使用的APP_PKG_NAME不同。
final String appPkgName = (apiLevel == 8 ? APP_PKG_NAME_22
: APP_PKG_NAME_21);
intent.setAction(Intent.ACTION_VIEW);
intent.setClassName(APP_DETAILS_PACKAGE_NAME,
APP_DETAILS_CLASS_NAME);
intent.putExtra(appPkgName, packageName);
}
context.startActivity(intent);
}

Ⅳ android 如何進入簡訊編輯界面

Intent intent = new Intent("android.intent.action.SENDTO",
Uri.parse("smsto:" + "手機號"));
intent.putExtra("sms_body","test"); //默認簡訊文字
startActivity(intent);

Ⅵ android可不可以調用系統的發送簡訊頁面

簡訊設置中在簡訊和彩信兩項下都有「發送報告」選項,打鉤就好了。

Ⅶ Android開發,各位大神誰知道怎麼在後台發Email或發簡訊,不用跳轉到系統界面,感激不盡!

郵件可以使用java mail api, 發簡訊就直接調用Android api SmsManager.sendMessage()就行

Ⅷ android中如何美化發送簡訊息的程序界面。

1.跟開發WEB程序一樣,先做出UI界面,因為這里我們是要實其功能,界面不作過多的美化。代碼如下:
Activity_main.xml
<TextView
android:id="@+id/tv_input_number" //這個是提示用戶輸入電話號碼的TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/please_input_number"
android:textSize="20px" />
<EditText
android:id="@+id/et_number" //這個是輸入電話號碼的文本框
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_input_number"
android:ems="10"
android:inputType="phone" >
</EditText>
<TextView
android:id="@+id/tv_input_content" //提示輸入內容的文本
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/et_number"
android:layout_below="@+id/et_number"
android:text="@string/please_input_content"
android:textSize="20px"
android:textColor="#333333"
/>
<EditText
android:id="@+id/et_content" //這是輸入文本內容的文本編輯器
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_input_content"
android:singleLine="true"
android:lines="5"
android:inputType="textMultiLine" />
<Button
android:id="@+id/bt_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/et_content"
android:layout_below="@+id/et_content"
android:layout_marginTop="17dp"
android:height="30px"
android:text="@string/send"
android:textColor="#ff3333"
android:textSize="20px" />
</RelativeLayout>
備註:要注意創建相應該元件的ID號。
2.開始實功能代碼.在MainAcivity.java文件中加入以下代碼:
MainAcivity.java
public class MainActivity extends ActionBarActivity implements OnClickListener {
private EditText et_number;
private EditText et_content;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et_number = (EditText) findViewById(R.id.et_number);
et_content= (EditText) findViewById(R.id.et_content);
Button bt_send=(Button) findViewById(R.id.bt_send);
bt_send.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.bt_send:
String number=et_number.getText().toString().trim();
String content=et_content.getText().toString().trim();
if(TextUtils.isEmpty(number)||TextUtils.isEmpty(content)){
Toast.makeText(this, "手機號和內容不能為空", Toast.LENGTH_LONG).show();
return;
}else{
SmsManager smsManger=SmsManager.getDefault();
ArrayList<String> contents=smsManger.divideMessage(content);
for(String str:contents){
smsManger.sendTextMessage(number, null, str, null, null);
}
}
break;
default:
break;
} }}

Ⅸ android 開發 一個通過服務端內容自動發送簡訊到指定號碼

伺服器和手機端通信,如果要實時通信,就需要使用推送,自己寫的推送一般不夠好,還是使用專業推送比較好,國內的可以使用極光推送,網路推送等等,如果是國際的可以使用谷歌的google cloud message,或者使用友盟……友盟還是比較靠譜的。

然後手機發送簡訊只需要一個許可權,然後會有很簡單的代碼就可以發送簡訊了,而且,一般的第三發推送也可以給服務端發消息,所以你的要求就齊全了。

如果不是用第三方的向伺服器報告,也可以自己寫和伺服器的通信。

如果推送都要自己寫,那麼android的推送有3種方式,第一socket長連接,比較耗費手機資源和電……第二種輪詢,有一點點延遲,看你的實時性有多高……第三種,使用簡訊息,服務端要有簡訊網關,手機端則監聽手機簡訊資料庫,用這個的比較少,一般長連接比較多。

我的號碼就是我qq,有什麼問題可以進一步的問我,或者我沒時間的話也有很多android開發群 可以介紹給你 隨便問問題,有很多高人解答

熱點內容
編譯成debug版本 發布:2024-03-29 09:06:55 瀏覽:884
wms伺服器地址 發布:2024-03-29 09:05:55 瀏覽:415
mep編程器 發布:2024-03-29 09:05:13 瀏覽:139
大小s我們一家訪問人 發布:2024-03-29 09:03:16 瀏覽:532
造物者編程 發布:2024-03-29 08:50:27 瀏覽:534
sql技能 發布:2024-03-29 08:50:23 瀏覽:56
希沃安卓下載安裝應用在哪裡 發布:2024-03-29 08:22:51 瀏覽:631
python和excel 發布:2024-03-29 07:47:03 瀏覽:861
postfix源碼下載 發布:2024-03-29 07:42:03 瀏覽:143
怎麼在電腦上玩手機伺服器 發布:2024-03-29 07:30:13 瀏覽:141