2012-05-08 2 views
1

mms 메시지가 생성되었습니다. 문제는 : 내 앱에 표시되지만 Android 기본 메시지 애플리케이션에는 표시되지 않습니다. 무엇이 잘못 될 수 있는지 알고 있습니까? thread_id에 대해 무엇을 설정해야합니까? 미리 감사드립니다. 내 응용 프로그램에 MMS 메시지를 만들었지 만 기본 메시지 응용 프로그램에 표시되지 않습니다.

--- 여기에 내 코드 ---입니다

ContentResolver cr = getContentResolver(); 

ContentValues cv = new ContentValues(); 
cv.put("thread_id", System.currentTimeMillis() % 100); 
cv.put("ct_t", "application/vnd.wap.multipart.related"); 
cv.put("read", "1"); 
Uri temp_mms = cr.insert(Uri.parse("content://mms/inbox"), cv); 
String str_uri = temp_mms.toString(); 
String newID = temp_mms.getLastPathSegment().trim(); 

ContentValues cv_addr2 = new ContentValues(); 
cv_addr2.put("address", "112233"); 
Uri temp_mms_addr2 = cr.insert(Uri.parse("content://mms/"+ newID +"/addr"), cv_addr2); 

// ------------------------------PART Table ContentValues 
Uri uriPart = Uri.parse("content://mms/"+ newID +"/part"); 
ContentValues cv_part2 = new ContentValues(); 
cv_part2.put("ct", "image/jpeg"); 
Uri temp_mms_part2 = cr.insert(uriPart, cv_part2); 

OutputStream os = cr.openOutputStream(temp_mms_part2); 
InputStream is = cr.openInputStream(selectedImageUri); 
byte[] buffer = new byte[256]; 
for (int len = 0; (len = is.read(buffer)) != -1;) { 
    os.write(buffer, 0, len); 
} 

답변

1

부분 답 : 확실하지 왜 그것은에 표시되지 않는 메시징 응용 프로그램 내장,하지만 방법은 How to Read MMS Data in Android?에 대한 답변을 확인 스레드 ID를 얻으려면.

편집 : 보낸 사람에 대해 content://mms/{id}/addr에 주소 항목을 추가해야 할 수도 있으며, 현재 기기에서 오는 경우 주소는 insert-address-token이면 충분합니다. 주소 입력에도 type이 필요합니다. 수신 주소는 151, 발신자는 137으로 설정해야합니다.

더 많은 정보가 필요합니다. 기존 데이터베이스를 읽고 필드별로 필드를 살펴보고 거기에있는 내용이 null 또는 0이 아닌지 확인하십시오.

관련 문제