How to programmatically send MMS in blackberry? - blackberry

How to programmatically send an MMS in blackberry?

MMS API (4.6 and >)
There is a net.rim.blackberry.api.mms class which "Provides advanced utilities for interaction with the MMS messaging system.". But this gives only ability to "modify the message before it is sent or deny it from being sent completely" using addSendListener
Using MMS protocol in connection
from javax.microedition.io.Connector API:
mms
This protocol opens an MMS connection across the wireless network. The open request should be formatted as follows:
(MessageConnection) Connector.open("mms://[<peer_address >]:[<application_Id>]");
where:
< peer_address > is the phone number or the email address of recipient.
< application_Id > is used to identify a Java application.
For example, to send a mms message to specific application use
Connector.open("mms://+123456789:applicationID");
To open a server mode MessageConnection use
Connector.open("mms://:applicationID");
Also see Introduction of MMS in J2ME and sample code - How to send MMS? and Sending and Receiving MMS on J2ME devices
I have never tried this approach, so I can't tell if it's working.
Invoking Messages application
Other option is open Messages application programmatically, to compose MMS:
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES,
new MessageArguments(MessageArguments.ARG_NEW_MMS));
Also see Invoking MMS with attachment using application.

Related

How to obtain final STATUS from a text sent to mobile phone

I am sending a text to a mobile number (US phone number) using the Programmable Messaging Quickstart for C# with .NET Core example. The message is sent and received successfully but the STATUS in the response shows "queued".
Is there a sample callback in C# to obtain the final status after the text is sent?
You have 3 options, either of the first two are suggested.
Subscribe to statusCallbacks, which will alert your application of the delivery status of the send message.
Use Event Streams to subscribe to specific message delivery event types (this option provides the ability to select different types of message delivery events).
Less efficient and not very scalable, make a request to the /Messages endpoint to determine the final disposition of the sent message (via its unique message SID).
Best Practices for SMS Message Logging

Twilio - Super Sim - Incoming SMS to Sim card

I am trying to achieve 2 way messaging with a super sim. I have been able to successfully configure sms received on my virtual Twilio number to be delivered to my sim by Http post (with authentication).
I would like to find a way to send an SMS from the sim and receive the SMS at a specific phone number. I've tried several flows without any success. I was able to get this working on Make.com and retrieve the data structure of the webhook but I still cant get this working on Twilio.
Thank you for the reply.
The sim is in an iot device and I am able to achieve 2 way communication utilizing webhooks with make.com. What I would like to achieve is to utilize a virtual number with Twilio to be the associated number for the iot device.
I have successfully received incoming "SMS" messages (commands) to the iot device, using a studio flow. When an sms is received via my virtual number number on twilio, the studio flow fires an https Post with the appropriate payload, populated from the received webhook from the virtual number., in turn receiving the "SMS" on the iot device.
Now I would like to create a flow or something similar on Twilio, that would generate a Twilio webhook that would listen for SMS commands (replies) "sent from" my appropriate Super Sim.
On Make.com I am able to generate the webhook and analyze the data structure, successfully receiving the payload of the webhook, from my Sim Fleet. I would like to utilize only Twilio for the webhooks, if possible. Do you have any more suggestions? Thank you in advance.
The Twilio Super Sim is not intended for use in a phone and does not support voice or regular SMS.
The Super Sim does support sending and receiving command (machine to machine, M2M) messages over SMS which can be used to send instructions to the device or receive data from a device. In this case the sim card can send messages to the number 000 and those messages will be received by Twilio and turned into a webhook request.
There is some documentation for how to send command messages from the Super Sim from a Raspberry Pi 4 or Raspberry Pi Pico and an in depth article on AT Commands that you can use to control the Sim.

Blackberry Push Implementation and waiting for acknowledgement

I already implemented the first 4 steps of the push initiator for blackberry
Send a push request
BlackBerry service returns a response
BlackBerry service pushes data to an assigned, specific port on device
Device returns response to BlackBerry service
Now I am working on the following two steps but nothing has happened yet:
5. BlackBerry service forwards acknowledgement to content provider
6. Read notification is returned to the BlackBerry service
Does anyone know how to implement that? I provided a domain when filling out the request but how do I achieve connection between me and the blackberry servers and how long do I have to wait for their response?
Actually your content provider send message to blackberry server and also specified the pin number of the device to which content provider want to send the message.
Your device automatically register with bb server if you have bb data service.
Your application is listening in the background on a particular port and your application also has particular app id that is provided by the rim.
So when content provider send message to bb server it also specify the app id and bb server has info about the port corresponding to this app id.and send message to the port of device whose pin is specified by the content provider.

how to listen to email event in Blackberry

I am developing and simple application in blackberry JDE 6.
My application will listen to any incoming or outgoing event i.e SMS event, MMS event, Email Event. After the occurrence of those event. App will prompt user about event and will do some processing.
for listening to SMS and MMS event i am implementing the OutboundMessageListener interface and passing it to the MessageConnection class object as shown belowe.
i have found the protocol for SMS and MMS (sms:// and mms://)
referred to this link Connector class protocol support
for SMS and MMS i am using this code to listen to the events
MessageConnection sms= (MessageConnection)Connector.open("sms://:0");
sms.setMessageListener(customPhoneListener);
MessageConnection mms = (MessageConnection) Connector.open("mms://0");
mms.setMessageListener(customPhoneListener);
But for email i am not able to find any protocol like sms and mms
how can i listen to email events any idea ??
any help appreciated :)
I have tried using the below code (jst to try even if i knw its not correct) to listen to email event but no luck as expected
MessageConnection email = (MessageConnection) Connector.open("email://0");
email.setMessageListener(customPhoneListener);
Take a look at net.rim.blackberry.api.mail.event.FolderListener and Store.addFolderListener()

Can a native Blackberry application (not MIDlet) use MIDP Push Registry?

If I am writing a MIDlet, and if the device supports SMS push registration (i.e. supports WMA 1.1 spec), I will be able to send push messages to the application that is installed on the phone and is listening to SMS messages at the assigned port.
However, if I am writing a Blackberry application, can I still go ahead and use the procedure that applies to MIDP 2.0 devices. If so, can I specify static SMS push registration in JAD file, as we do for a MIDlet?
Would the appropriate JAD property be still specified as MIDlet-Push-1:{}?
Another question, that is not totally unrelated is- are there any bulk SMS providers that allow SMS bearers specify the destination ports that can be integrated with this kind of a solution?
Thanks
A regular blackberry application does not support the push registry. You'll have to keep a DatagramConnection open and listen for the incoming SMS messages that way.
DatagramConnection connection = (DatagramConnection)Connector.open("sms://:1234");
Datagram dgram = connection.newDatagram(connection.getMaximumLength());
connection.receive(dgram); // blocking call so this should be in a separate thread
String message = new String(dgram.getData());
where 1234 is the port you're listening on.
As to you're second question I'm not entirely sure, but I think mblox supports port directed SMS.
For the second question, if the bulk SMS service provider provides you with HTTP API which included the UDH field, you can send messages to application listening in that particular port

Resources