|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.engine.activities.MmsDecoder
public class MmsDecoder
Helper class to 'decode' MMS messages to provide suitable content for Timeline summary.
Field Summary | |
---|---|
private static int |
ANY_CHARSET
|
private static int |
BIG5
|
private static int |
COLUMN_DATE
|
private static int |
COLUMN_MMS_ID
|
private static int |
COLUMN_MSG_BOX
|
private static int |
COLUMN_MSG_THREAD_ID
|
private static int |
COLUMN_SUBJECT
|
private static int |
COLUMN_SUBJECT_CS
|
private static java.lang.String |
ELLIPSIZE
|
private static java.lang.String |
ID
|
private static int |
ISO_8859_1
|
private static int |
ISO_8859_2
|
private static int |
ISO_8859_3
|
private static int |
ISO_8859_4
|
private static int |
ISO_8859_5
|
private static int |
ISO_8859_6
|
private static int |
ISO_8859_7
|
private static int |
ISO_8859_8
|
private static int |
ISO_8859_9
|
private static int |
MESSAGE_BOX_INBOX
|
private static int |
MESSAGE_BOX_SENT
|
private static java.lang.String |
MIMENAME_ANY_CHARSET
|
private static java.lang.String |
MIMENAME_BIG5
|
private static java.lang.String |
MIMENAME_ISO_8859_1
|
private static java.lang.String |
MIMENAME_ISO_8859_2
|
private static java.lang.String |
MIMENAME_ISO_8859_3
|
private static java.lang.String |
MIMENAME_ISO_8859_4
|
private static java.lang.String |
MIMENAME_ISO_8859_5
|
private static java.lang.String |
MIMENAME_ISO_8859_6
|
private static java.lang.String |
MIMENAME_ISO_8859_7
|
private static java.lang.String |
MIMENAME_ISO_8859_8
|
private static java.lang.String |
MIMENAME_ISO_8859_9
|
private static java.lang.String |
MIMENAME_SHIFT_JIS
|
private static java.lang.String |
MIMENAME_UCS2
|
private static java.lang.String |
MIMENAME_US_ASCII
|
private static java.lang.String |
MIMENAME_UTF_16
|
private static java.lang.String |
MIMENAME_UTF_8
|
protected static Uri |
MMS_CONTENT_URI
|
private static java.lang.String |
MMS_SORT_ORDER
|
private static java.lang.String[] |
MMS_STATUS_PROJECTION
Fields to be returned from MMS query. |
private static int |
MS_IN_SECONDS
|
private static java.lang.String |
PART
|
private static int |
PART_COLUMN_CONTENT_TYPE
|
private static int |
PART_COLUMN_ID
|
private static java.lang.String[] |
PART_PROJECTION
|
private static int |
PDU_FROM_FIELD
|
private static int |
PDU_TO_FIELD
|
private static int |
SHIFT_JIS
|
private static java.lang.String |
TEXT_PLAIN
|
private static java.lang.String |
THREAD_ID
|
private static int |
UCS2
|
private static int |
US_ASCII
|
private static int |
UTF_16
|
private static int |
UTF_8
|
Constructor Summary | |
---|---|
MmsDecoder()
|
Method Summary | |
---|---|
private static java.lang.String |
decodeString(int charset,
byte[] data)
Decode MMS data based on character set. |
protected static Cursor |
fetchMmsListCursor(ContentResolver cr,
boolean refresh,
long oldestTimestamp,
long newestTimestamp)
Get a Cursor for MMS message item from native message log. |
private static java.lang.String |
getMimeName(int charset)
Return the MIME-type for specified character-set. |
private static byte[] |
getMmsBytes(java.lang.String data)
Return byte array from supplied String. |
protected static boolean |
getMmsData(Context context,
ContentResolver cr,
Cursor mmsCursor,
ActivitiesTable.TimelineSummaryItem item,
DatabaseHelper db,
int maxDescLength)
Get the MMS data for the message at current Cursor position and use it to populate a TimelineSummaryItem. |
private static java.lang.String |
getMmsText(ContentResolver cr,
long msgId,
int maxLength)
Generate text required for Timeline entry from content of MMS message. |
protected static long |
getTimestamp(Cursor mmsCursor)
|
private static java.lang.String |
getToOrFrom(ContentResolver cr,
ActivityItem.Type msgType,
Uri uri)
Retrieve the sender/recipient of MMS (based on whether received or sent message). |
private static ActivityItem.Type |
nativeToNpMessageType(int type)
Convert Native message type (Inbox, Sent) to corresponding ActivityItem type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int ANY_CHARSET
private static final int US_ASCII
private static final int ISO_8859_1
private static final int ISO_8859_2
private static final int ISO_8859_3
private static final int ISO_8859_4
private static final int ISO_8859_5
private static final int ISO_8859_6
private static final int ISO_8859_7
private static final int ISO_8859_8
private static final int ISO_8859_9
private static final int SHIFT_JIS
private static final int UTF_8
private static final int BIG5
private static final int UCS2
private static final int UTF_16
private static final java.lang.String MIMENAME_ANY_CHARSET
private static final java.lang.String MIMENAME_US_ASCII
private static final java.lang.String MIMENAME_ISO_8859_1
private static final java.lang.String MIMENAME_ISO_8859_2
private static final java.lang.String MIMENAME_ISO_8859_3
private static final java.lang.String MIMENAME_ISO_8859_4
private static final java.lang.String MIMENAME_ISO_8859_5
private static final java.lang.String MIMENAME_ISO_8859_6
private static final java.lang.String MIMENAME_ISO_8859_7
private static final java.lang.String MIMENAME_ISO_8859_8
private static final java.lang.String MIMENAME_ISO_8859_9
private static final java.lang.String MIMENAME_SHIFT_JIS
private static final java.lang.String MIMENAME_UTF_8
private static final java.lang.String MIMENAME_BIG5
private static final java.lang.String MIMENAME_UCS2
private static final java.lang.String MIMENAME_UTF_16
protected static final Uri MMS_CONTENT_URI
private static final int PDU_FROM_FIELD
private static final int PDU_TO_FIELD
private static final java.lang.String THREAD_ID
private static final java.lang.String ID
private static final java.lang.String ELLIPSIZE
private static final java.lang.String[] MMS_STATUS_PROJECTION
private static final int COLUMN_DATE
private static final int COLUMN_MMS_ID
private static final int COLUMN_SUBJECT
private static final int COLUMN_SUBJECT_CS
private static final int COLUMN_MSG_BOX
private static final int COLUMN_MSG_THREAD_ID
private static final java.lang.String[] PART_PROJECTION
private static final int PART_COLUMN_ID
private static final int PART_COLUMN_CONTENT_TYPE
private static final int MESSAGE_BOX_INBOX
private static final int MESSAGE_BOX_SENT
private static final java.lang.String MMS_SORT_ORDER
private static final java.lang.String PART
private static final java.lang.String TEXT_PLAIN
private static final int MS_IN_SECONDS
Constructor Detail |
---|
public MmsDecoder()
Method Detail |
---|
protected static long getTimestamp(Cursor mmsCursor)
protected static Cursor fetchMmsListCursor(ContentResolver cr, boolean refresh, long oldestTimestamp, long newestTimestamp)
cr
- ContentResolvertimestamp
- Timestamp to search against (may be null)
protected static boolean getMmsData(Context context, ContentResolver cr, Cursor mmsCursor, ActivitiesTable.TimelineSummaryItem item, DatabaseHelper db, int maxDescLength)
context
- Context.cr
- ContentResolver.mmsCursor
- Cursor pointing to MMS message entry in native message
log.item
- TimeLineSummaryItem to populate using MMS message detailsdb
- Handle to People database.maxDescLength
- maximum length of the description.
private static java.lang.String getMimeName(int charset) throws java.io.UnsupportedEncodingException
charset
- Character set.
java.io.UnsupportedEncodingException
- if un-supported character set
specified.private static java.lang.String decodeString(int charset, byte[] data)
charset
- Character set.data
- MMS data.
private static byte[] getMmsBytes(java.lang.String data)
data
- String containing MMS data.
private static java.lang.String getToOrFrom(ContentResolver cr, ActivityItem.Type msgType, Uri uri)
cr
- ContentResolver.msgType
- ActivityItem type (i.e. MESSAGE_MMS_SENT).uri
- MMS URI based on MMS_CONTENT_URI.
private static ActivityItem.Type nativeToNpMessageType(int type)
type
- Native message type.
private static java.lang.String getMmsText(ContentResolver cr, long msgId, int maxLength)
cr
- ContentResolvermsgId
- ID of MMS message as retrieved from message log.maxLength
- maximum length for text.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc