Android 解析彩信提取图像
我设法连接到彩信服务器并检索彩信数据 现在我需要解析MMS数据(byte[]responseArray)并获得类似于图像的数据 有什么想法吗Android 解析彩信提取图像,android,sms,android-source,mms,Android,Sms,Android Source,Mms,我设法连接到彩信服务器并检索彩信数据 现在我需要解析MMS数据(byte[]responseArray)并获得类似于图像的数据 有什么想法吗 // Open connection HttpURLConnection connection = (HttpURLConnection) url.openConnection(); // Disable cache connection.setUseCaches(false); // Set the timeouts
// Open connection
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// Disable cache
connection.setUseCaches(false);
// Set the timeouts
connection.setConnectTimeout(TIMEOUT);
connection.setReadTimeout(TIMEOUT);
// Connect to the MMSC
ensureRouteToHost(context, urlMms, apnSettings);
Log.d(TAG, "[MMS Receiver] Connecting to MMS Url " + urlMms);
connection.connect();
try
{
Log.d(TAG, "[MMS Receiver] Response code is " + connection.getResponseCode());
if (connection.getContentLength() >= 0)
{
Log.d(TAG, "[MMS Receiver] Download MMS data (Size: " + connection.getContentLength() + ")");
byte[] responseArray = new byte[connection.getContentLength()];
DataInputStream i = new DataInputStream(connection.getInputStream());
int b = 0;
int index = 0;
while ((b = i.read()) != -1)
{
responseArray[index] = (byte) b;
index++;
}
i.close();
你找到解决办法了吗?