本文介绍了Android的MMS解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序之一,我要的解析彩信的内容。我能够得到的连接codeD彩信内容字节[] 的形式。现在,我必须去code这个字节[]和需要提取根据其内容类型和标头值的所有内容。但我在这里挣扎。我不知道如何开始解码...

In one of my application, I have to parse the MMS content. I am able to get the encoded MMS content in the form of byte[]. Now I have to decode this byte[] and need to extract all the content based on their content types and header values. But I am struggling here. I don't know how to start decoding...

任何帮助将AP preciated。

Any help will be appreciated.

推荐答案

您在字节内容[]所以你可以尝试这样的:

you have the content in byte[] so you can try this:

byte[] buffer;
String incomingNumber = new String(buffer);
int indx = incomingNumber.indexOf("/TYPE");
if(indx>0 && (indx-15)>0){
   int newIndx = indx - 15;
   incomingNumber = incomingNumber.substring(newIndx, indx);
   indx = incomingNumber.indexOf("+");
   if(indx>0){
   incomingNumber = incomingNumber.substring(indx);
}

您可以继续解析这个样子。

you can continue to parse like this.

这篇关于Android的MMS解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 14:55