2017-06-15 97 views
-3

我只是想知道如何:如何從一個應用程序將消息發送到另一個

  1. 指定哪些應用程序的選項將在「應用程序選擇器」意圖活動(如顯示有它只是顯示的應用程序,有消息傳遞功能)
  2. 如何從一個應用程序向另一個應用程序傳輸/顯示消息(電子郵件,文本,DM等)?

甚至有可能嗎?我需要使用/研究哪些API /課程?我需要用另一種語言編寫代碼並將其轉移嗎?我目前在使用java的android工作。

+0

「有一個信使功能」是什麼意思?網頁瀏覽器計數?電郵客戶?具有客戶支持聊天功能的應用程序如何?您如何確定任意應用程序是否具有「消息傳遞功能」?同樣,「訪問消息功能」是什麼意思? 「顯示其數據」是什麼意思? – CommonsWare

+0

你爲什麼想用另一種語言?你需要一個網絡服務嗎?這是語言不可知論的,實際上,並沒有綁定到Android –

回答

1

選項列表取決於您設置的Intenet類型。以下是意圖類型你可以使用 -

myIntent.setType(String mimeType) 

image/jpeg 
audio/mpeg4-generic 
text/html 
audio/mpeg 
audio/aac 
audio/wav 
audio/ogg 
audio/midi 
audio/x-ms-wma 
video/mp4 
video/x-msvideo 
video/x-ms-wmv 
image/png 
image/jpeg 
image/gif 
.xml ->text/xml 
.txt -> text/plain 
.cfg -> text/plain 
.csv -> text/plain 
.conf -> text/plain 
.rc -> text/plain 
.htm -> text/html 
.html -> text/html 
.pdf -> application/pdf 
.apk -> application/vnd.android.package-archive 

參考意圖文檔here

0

我想,也許這是你在找什麼。

Send Simple Data to Other Apps

這裏是文檔中的示例。

Intent sendIntent = new Intent(); 
sendIntent.setAction(Intent.ACTION_SEND); 
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send."); 
sendIntent.setType("text/plain"); 
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to))); 
相關問題