2011-06-13 53 views
0

我試圖通過使用POST How to send image via MMS in Android?編程方式發送彩信....問題與彩信代理和MMS端口空值,而發送MMS

我試圖找回APN值MMSC,MMSProxy和MMSPort,但我得到MMSProxy和MMSPort的空值..然後我通過瀏覽「設置 - >無線網絡 - > MobileNetworks - > AccessPointNames - > MMS - >」 在我的HTC設備中檢查這些值但這裏實際上沒有什麼是爲MMSProxy和MMSPort設置.... ,但我可以手動發送彩信..
請幫我在如何獲得MMSProxy和MMSPort值..或PLZ告訴我,如果內置MMS應用程序將會我使用任何其他機制發送彩信.. ??

PLZ幫我在這...

+0

我有問題,甚至得到APNs http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-mms-in-android – toobsco42 2013-03-09 20:44:54

回答

0

它可能沒有關係,代理可以指「備用」的路線。也許發送彩信不需要替代路由,因此它是空的?

內置的MMS應用程序使用一個名爲TransactionSettings.java的類,該類查詢電話服務內容提供程序,代碼摘錄。

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(); 
    } 

這就是說,我使用這種方法,仍然得到空值。

也許你有更好的運氣?