send MMS problem on HTC Tattoo

All your problems with Audio, Video and Images.

send MMS problem on HTC Tattoo

Postby Giselda » Thu Dec 10, 2009 3:11 pm

Hi!

I'm new and first I'm sorry for my english.
Second very compliment for this forum, It's the best android forum on the web!
I'm italian and I hope that you can resolve my strange and maybe stupid question.

In my application I try to send an MMS with an image on my device (an HTC Tattoo) sdk 1.6.
Now if I write a normal code Intent.ACTION_SEND, set of Intent.EXTRA_STREAM etc, I have a strange behavior...

The command:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  startActivity(Intent.createChooser(sendIntent, "Choose destination:"));
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


Show a menu choice with inside all application (Facebook, GoogleMail, Flirck etc.) minus "Messages" when I set correctly the Type MIME like "image/jpeg" or "image/*".

If I set MIME "*/*" magically "Messages" appears on the menu of choice but If I select it doesn't work :(
it understand that is a sms message and not an mms... Stupid phone! :(

I see on the log of my phone that a normal send mms activity (on start send mms from a photo gallery) produce this ouput:

I/ActivityManager( 84):
Starting activity: Intent { act=android.intent.action.SEND_MSG typ=image/png flg=0x3000000 cmp=com.android.mms/.ui.ComposeMessageActiv


Instead my application on starting activity for send mms produce this output:

Starting activity: Intent { act=android.intent.action.SEND typ=image/jpeg cmp=com.android.mms/.ui.ComposeMessageActivity (has extras)


When I tried to set intent Action:

Intent sendIntent = new Intent("android.intent.action.SEND_MSG");

all works fine! Doesn't appear the menu of choise but immediatly the system start the mms client with my image inside...

My question is: This custom

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. String action = "android.intent.action.SEND_MSG"
Parsed in 0.029 seconds, using GeSHi 1.0.8.4


will work only on my htc tattoo?

I don't find this variabe on sdk... There are ACTION_SEND, ACTION_SENDTO and ACTION_MULTIPLE that are:
android.intent.action.SEND, android.intent.action.SENDTO, android.intent.action.SEND_MULTIPLE.

I don't see this variable SEND_MSG... I can't find it anywhere.
The com.android.mms.ui.ComposeMessageActivity is in the android so but I don't know if in other phone the normal Intent.SEND (and especially "android.intent.action.SEND_MSG" custom string) works...

What is wrong with my code on my htc Tattoo?

I hope I explained the problem clearly.
Thanks in advance for any response.

Giselda
Giselda
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Dec 10, 2009 2:27 pm

Top

Postby stevecnz » Sun Jan 17, 2010 11:52 am

Hi, I have the same issue with the HTC Hero. I want to start the MMS app,
passing in the addressee, message body and image attachment, but the only
way to do it on the Hero is by using the undocumented action
android.intent.action.SEND_MSG, as in the following example:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent intent = new Intent("android.intent.action.SEND_MSG");
  2.  
  3. intent.putExtra("address", "0215554444");
  4.  
  5. intent.putExtra("sms_body", "my message text");
  6.  
  7. intent.putExtra(Intent.EXTRA_STREAM, imageUri); // imageUri set previously
  8.  
  9. intent.setType("image/jpeg");
  10.  
  11. startActivity(intent);
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


I'm guessing the action "android.intent.action.SEND_MSG" is specific to HTC's
Sense UI because the above code does not work on my Magic (a phone that does
not come with Sense UI).

Another anoying problem is that there is no documented way to directly launch the MMS
app (with an image attached) for standard android devices either! (By "standard"
I mean devices that use the default apps and UI provided by Google, as opposed to
a customised UI like HTC Sense.) There are a couple of document approaches that *almost* do it,
but not quite.

The first approach is to use Intent.ACTION_SEND, and set Intent.EXTRA_STREAM to
specify the image. This works on the Magic but it first prompts the user to select
the app to complete the action with--one of the offered choices being Messaging.
It can be argued that this choice is a good thing. In certain situations I agree.
However, for some apps (like the one I'm developing), the only appropriate app is
the messaging app (or another MMS client). I don't want the user to be offered a
choice of apps that can't send MMS (Gmail, Picasa, etc). To get it to go straight to
the messaging app I have to use an explicit intent as follows:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent intent = new Intent(Intent.ACTION_SEND);
  2.  
  3. intent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
  4.  
  5. intent.putExtra("address", "0215554444");
  6.  
  7. intent.putExtra("sms_body", "my message text");
  8.  
  9. intent.putExtra(Intent.EXTRA_STREAM, imageUri);  // imageUri set previously
  10.  
  11. intent.setType("image/jpeg");
Parsed in 0.036 seconds, using GeSHi 1.0.8.4


Note that the "address" and "sms_body" arguments are undocumented. They currently work
but there is no guarantee they will continue to work in the future.

The second documented approach that *almost* works, but not quite, is to use the
Intent.ACTION_SENDTO action, and specifying a URI with an "mms" or "mmsto" scheme
for the addressee, as follows:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent intent = new Intent(Intent.ACTION_SENDTO);
  2.  
  3. intent.setData(Uri.parse("mms:0215554444"));
  4.  
  5. intent.putExtra("sms_body", "my message text");
  6.  
  7. intent.putExtra(Intent.EXTRA_STREAM, imageUri);
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


This approach has the benefit of using a documented way to specify that MMS is to be
used and who the addressee is. The user is taken straight to the messaging app.
BUT, the image is ignored. It is not attached to the message. Judging from the earlier
intents that *do* attach the message, it seems that the MIME type has to be explicitly
set. However, if we set the MIME type as well (using intent.setDataAndType instead of
intent.setData), the intent fails to resolve to any activities. That is because the
messaging app's ComposeMessageActivity intent filter for the SENDTO action makes no
provision for mimeType:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <intent-filter>
  2.  
  3. <action android:name="android.intent.action.VIEW" />
  4.  
  5. <action android:name="android.intent.action.SENDTO" />
  6.  
  7. <category android:name="android.intent.category.DEFAULT" />
  8.  
  9. <category android:name="android.intent.category.BROWSABLE" />
  10.  
  11. <data android:scheme="mms" />
  12.  
  13. <data android:scheme="mmsto" />
  14.  
  15. </intent-filter>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


If Google added another filter for ComposeMessageActivity like the following, that
would presumably fix the issue:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <intent-filter>
  2.  
  3. <action android:name="android.intent.action.VIEW" />
  4.  
  5. <action android:name="android.intent.action.SENDTO" />
  6.  
  7. <category android:name="android.intent.category.DEFAULT" />
  8.  
  9. <category android:name="android.intent.category.BROWSABLE" />
  10.  
  11. <data android:scheme="mms" />
  12.  
  13. <data android:scheme="mmsto" />
  14.  
  15. <data android:mimeType="image/*" />
  16.  
  17. <data android:mimeType="video/*" />
  18.  
  19. </intent-filter>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


I'm curious as to which of the above approaches, if any, work with the Motorola Droid.
Has anyone tested this?

Hope this helps.
Steve
stevecnz
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Jan 17, 2010 10:27 am

Re: send MMS problem on HTC Tattoo

Postby rathulla » Wed May 19, 2010 11:55 am

Does anyone know how to get the blackberry curve 8320 to receive mms messages & internet? I just bought a blackberry curve 8320 and I have a go phone account with at & t and everything works fine except for sending and receiving mms and accessing the internet. Can anyone help me get this set up?
________________________
external keyword tool ~ keyworddiscovery.com ~ keycompete.com ~ compete.com ~ webmasterworld.com
rathulla
Freshman
Freshman
 
Posts: 2
Joined: Wed May 19, 2010 7:07 am

Re: send MMS problem on HTC Tattoo

Postby hasitharandika » Mon Jun 14, 2010 7:37 am

hi guys,

even i have tested the code with HTC TATTOO and Motorolla milestone. in both phones pop up screen displays.
i think it should have been very nice if android gives a public API for MMS.

in this way developers will not be able to develop MMS application for android.

regards,
Randika
hasitharandika
Developer
Developer
 
Posts: 45
Joined: Mon Feb 15, 2010 8:37 am
Location: Sri Lanka

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 11 guests