그것은 중요하지 않을 수는, 프록시는 "대체"경로를 의미 할 수있다 ...이 날 도움이됩니다. MMS를 보내면 대체 경로가 필요하지 않으므로 null일까요?
내장 된 MMS 앱은 TransactionSettings.java라는 클래스를 사용하며 해당 클래스는 Telephony 콘텐츠 공급자 (코드 발췌문)를 쿼리합니다.
public TransactionSettings(Context context, String apnName) {
String selection = (apnName != null) ? APN + "='" + apnName.trim() + "'" : null;
Cursor cursor = SqliteWrapper.query(context, context.getContentResolver(), Uri.withAppendedPath(Uri.parse(TELEPHONY_CONTENT_URI), "current"),
APN_PROJECTION, selection, null, null);
if (cursor == null) {
Log.e(TAG, "Apn is not found in Database!");
return;
}
boolean sawValidApn = false;
try {
while (cursor.moveToNext() && TextUtils.isEmpty(mServiceCenter)) {
// Read values from APN settings
if (isValidApnType(cursor.getString(COLUMN_TYPE), APN_TYPE_MMS)) {
sawValidApn = true;
mServiceCenter = cursor.getString(COLUMN_MMSC).trim();
mProxyAddress = cursor.getString(COLUMN_MMSPROXY);
if (isProxySet()) {
String portString = cursor.getString(COLUMN_MMSPORT);
try {
mProxyPort = Integer.parseInt(portString);
} catch (NumberFormatException e) {
if (TextUtils.isEmpty(portString)) {
Log.w(TAG, "mms port not set!");
} else {
Log.e(TAG, "Bad port number format: " + portString, e);
}
}
}
}
}
} finally {
cursor.close();
}
나는이 방법을 사용하며 여전히 null 값을 얻는다.
어쩌면 당신은 행운을 빕니다.
APN을 가져 오는 데 문제가 있습니다. http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-mms-in-android – toobsco42