Android MMS Parsing

北慕城南 提交于 2019-12-12 01:26:23

问题


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...

Any help will be appreciated.


回答1:


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.



来源:https://stackoverflow.com/questions/7334244/android-mms-parsing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!