French Envoi photo via SMS

willk

Member
Licensed User
Bonjour,
est-il possible avec B4A de programmer l'envoi d'une photo enregistrée sur le Smartphone.
Si oui, est-il possible d'en avoir un exemple

Merci

Willk
 

klaus

Expert
Licensed User
Longtime User

willk

Member
Licensed User
Bonjour Klauss,

j'ai toujours le problème d'envoi de photo via mms.
Je connais d'autres langages mais je suis débutant sur B4A.
J'ai appliqué les exemples cités sur le forum et j'obtiens toujours le message d'erreur suivant :
ActivityNotFoundException:
Unable to find explicity activity class {com.android.mms/com.android.mms.ui.
ComposeMessageActivity}; have you declared this activity in your AndroidManifest.xml?
Continue?

Le Pb semble venir du contenu d'AndoidManifest.Xml

Voici un extrait de code de mon application:

<<Sub SendPhotoMessage(PhoneNumber As String, Message As String, Dir As String, FileName As String)
Dim iIntent As Intent
iIntent.Initialize("android.intent.action.SEND_MSG", "")
'iIntent.Initialize("android.intent.action.SEND", "")
iIntent.SetComponent("com.android.mms/.ui.ComposeMessageActivity")
iIntent.setType("vnd.android-dir/mms-sms")
iIntent.PutExtra("android.intent.extra.STREAM", CreateUri("file://" & File.Combine(Dir, FileName)))
iIntent.PutExtra("sms_body", Message)
iIntent.PutExtra("address", PhoneNumber)
iIntent.SetType("image/png")
StartActivity(iIntent)
End Sub

Sub CreateUri(uri As String) As Object
Dim r As Reflector
Return r.RunStaticMethod("android.net.Uri", "parse", Array As Object(uri), Array As String("java.lang.String"))
End Sub>>

et Voici le contenu de mon AndoidManifest.xml

'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136

AddManifestText(<uses-feature android:name="android.hardware.location.gps"/>
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="19" />
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"

android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
AddPermission("android.permission.READ_CONTACTS")
AddPermission("android.permission.SEND_MMS")
AddActivityText(Main,
<!-- Activity that allows the user to send new SMS/MMS messages -->
<activity android:name=".ComposeMessageActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</activity>)

Où est le problème ?

Merci par avance pour votre aide.

WillK
 
Top