因此,我遇到了三类MMS消息类型:
Plain Text - "text/plain"
Image - "image/jpeg", "image/bmp", "image/gif", "image/jpg", "image/png"
SMIL (Synchronized Multimedia Integration Language) - "application/smil"
因此,在MMS中获取属于前两个类别的数据时,我没有问题。然而,我在从消息类型为application/smil的彩信中获取数据时遇到了问题
下面我包括了5个不同的application/smil彩信的例子,我已经从我的手机上拉出。
[31, 22, -1, application/smil, 123_1.smil, 106, null, null, <0000>, 0.smil, null, null, null, <smil>
<head>
<layout>
<root-layout height="160" width="240"/>
<region fit="meet" height="67%" id="Image" left="0%" top="0%" width="100%"/>
<region fit="meet" height="33%" id="Text" left="0%" top="67%" width="100%"/>
</layout>
</head>
<body>
<par dur="8000ms">
<img region="Image" src="cid:992"/>
</par>
<par dur="8000ms">
<img region="Image" src="cid:993"/>
</par>
</body>
</smil>]。
[22, 14, -1, application/smil, null, null, null, null, <smil>, smil.xml, null, null, null, <smil>
<head>
<layout>
<root-layout width="320px" height="480px"/>
<region id="Image" left="0" top="0" width="320px" height="320px" fit="meet"/>
<region id="Text" left="0" top="320" width="320px" height="160px" fit="meet"/>
</layout>
</head>
<body>
<par dur="5000ms">
<img src="8555" region="Image"/>
<text src="text_0.txt" region="Text"/>
</par>
</body>
</smil>]。
[13, 11, -1, application/smil, 123_1.smil, null, null, null, <0000>, null, null, null, null, <smil>
<head>
<layout>
<root-layout/>
<region fit="scroll" height="30%" id="Text" left="0%" top="70%" width="100%"/>
<region fit="meet" height="70%" id="Image" left="0%" top="0%" width="100%"/>
</layout>
</head>
<body>
<par dur="10000ms">
<text region="Text" src="cid:928"/>
</par>
</body>
</smil>]。
[16, 13, -1, application/smil, mms.smil, null, null, null, <AAAA>, AAAA, null, null, null, <smil>
<head>
<layout>
<root-layout width="240" height="160"/>
<region id="Image" width="100%" height="67%" left="0%" top="0%" fit="meet"/>
<region id="Text" width="100%" height="33%" left="0%" top="67%" fit="meet"/>
</layout>
</head>
<body>
<par dur="8000ms"><text src="text__01.txt" region="Text"/></par></body>
</smil>]。
[5, 5, -1, application/smil, smil.smil, 106, null, null, <0000>, smil, null, null, null, <smil>
<head>
<layout>
<root-layout height="160" width="240"/>
<region fit="meet" height="67%" id="Image" left="0%" top="0%" width="100%"/>
<region fit="meet" height="33%" id="Text" left="0%" top="67%" width="100%"/>
</layout>
</head>
<body>
<par dur="8000ms">
<img region="Image" src="cid:351"/>
<text region="Text" src="cid:352"/>
</par>
</body>
</smil>]你到底是如何解析这类彩信的?其他短信应用程序如何处理不同类型的彩信?任何帮助都将不胜感激。
发布于 2012-10-23 11:44:28
所以问题是我创建了一个像这样的Cursor
Uri uri = Uri.parse("content://mms/part");
String[] projection = new String[] { "*" };
String selection = "_id = " + messageId;
Cursor cursor = mContentResolver.query(uri, projection, selection,null, null);问题是选择参数实际上应该是
String selection = "mid = " + messageId;现在我的光标包含多个条目:
我想感谢@wnafee在这篇文章Android: what to do with application/smil MIME type中指出了这一点。
发布于 2012-07-24 14:58:34
你可以启动here,它是android彩信查看器。支持SMIL。我将此代码用于我当前的项目SMIL player for android。
发布于 2012-08-24 07:36:25
w3有一个很好的库来处理SMIL。在这里查看http://www.w3.org/TR/1999/WD-smil-boston-dom-19991115/java-binding.html
https://stackoverflow.com/questions/11556633
复制相似问题