I am trying to send a message from 1 phone to another and came up with the following codes .. - Main class::
-
-
public void commandAction(Command command, Displayable displayable)
-
{
-
if (displayable == form1) {
-
-
if (command == cancelCommand) {
-
-
exitMIDlet();
-
-
} else if (command == okCommand) {
-
-
// write pre-action user code here
-
//GEN-LINE:|7-commandAction|4|25-postAction
-
// m=new message(textField1,textField2,stringItem);
-
Thread th=new Thread(this);
-
th.start();
-
-
-
-
}
-
}
-
}
-
-
-
public void run() {
-
try {
-
-
// write pre-action user code here
-
-
m=new message(textField1,textField2,stringItem);
-
MessageConnection cn= getcnnc("sms://+230"+textField1.getString()+":5000");
-
m.message( cn, textField2.getString(), "sms://+230"+textField1.getString()+":5000");
-
-
-
// m.send();
-
// write post-action user code here
-
}
-
catch(Exception e){
-
-
}
-
}
-
-
-
-
-
Message class:
-
public class message implements Runnable{
-
TextField tx2;
-
TextMessage tmsg;
-
StringItem status;
-
message(TextField textField,TextField textField2,StringItem text) {
-
tx1=textField;;
-
tx2=textField2;
-
status=text;
-
}
-
-
-
TextField tx1;
-
MessageConnection mc;
-
public void run() {
-
try{
-
-
MessageConnection cn=getcnnc("sms://+2307479110:5000");
-
message(cn,tx2.getString(),"sms://+2307139151:5000");
-
-
// cn.send(tmsg);
-
// mc.setMessageListener(this);
-
status.setLabel("Delivered");
-
}
-
catch(Exception e){
-
status.setLabel(e.getMessage());
-
-
e.printStackTrace();
-
}
-
}
-
-
-
public MessageConnection getcnnc(String url) throws IOException{
-
return (MessageConnection)Connector.open(url);
-
}
-
-
public void message(MessageConnection mc,String aaadr,String url) throws IOException{
-
TextMessage tmsg=(TextMessage)mc.newMessage(MessageConnection.TEXT_MESSAGE);
-
tmsg.setAddress(url);
-
tmsg.setPayloadText(aaadr);
-
mc.send(tmsg);
-
//mc.setMessageListener(this);
-
-
}
-
-
-
-
public void send(){
-
try{
-
-
MessageConnection cn=getcnnc("sms://+230"+tx1.getString()+":5000");
-
-
message(cn,tx2.getString(),"sms://+230"+tx1.getString()+":5000");
-
-
mc.send(tmsg);
-
// mc.setMessageListener(this);
-
status.setLabel("Delivered");
-
}
-
catch(Exception e){
-
status.setLabel("Failed");
-
}
-
}
-
}
I deployed it in a phone and send a message to another. The other phone was using the default message program and it received a message “You have no message”. How do I sort this problem out?
0 1173 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Dave Smithz |
last post by:
Hi,
In summary:
I want to a form to submit information via a HTTP POST, however, when using
Internet Explorer I want to be able to use the back button and all the
information retained. Presently we get a "Page has expired" message. How can
we avoid this?
Full details:
Having searched for postings on how to avoid the "Page has Expired" they are
|
by: Jeff Magouirk |
last post by:
Dear All,
I have written an update trigger that should write a message to an audit
table When I try to update any field in the table I recieve the following
error message -
Stirng or Binary data would be
trunicated
The statement has been termined.
|
by: Dr Duck |
last post by:
GDay all,
Something seems odd to me....
I wrote a simple C# function
public void bind(ref object a, ref object b, bool atob)
{
if(atob)
b = a;
else
|
by: yaron |
last post by:
Hi,
I have a problem when sending data over TCP socket from c# client to java
server.
the connection established ok, but i can't send data from c# client to java
server.
it's work ok with TcpClient, NetworkStream and StreamWriter classes.
but with low level socket it doesn't work (When using the Socket class Send
method).
|
by: Liz Patton |
last post by:
Here's the exception:
System.Exception: Unable to send mail: Could not access 'CDO.Message'
object. ---> System.Web.HttpException: Could not access 'CDO.Message'
object. ---> System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x80004005): Unspecified
error
--- End of inner exception stack trace ---
| |
by: blueapricot416 |
last post by:
I have some javascript in a standard HTML page that uses the ubiquitous
"XMLHttpRequest" to send data to a remote ASP page.
If that page "answers back" by sending a string using a simple
Response.Write, which I then use in the original HTML page to
dynamically update stuff, is this "AJAX"?
Specifically, is there anything "wrong" with sending back info from
classic ASP pages using simple Response.Writes? (Is there usually
something...
|
by: Martin Jørgensen |
last post by:
Hi,
Today I got a really strange problem... I've made myself a data-file and
I read in data from that file....
When I read something like this line:
03 04 05, 00 04 01, 05 03 07, 08 03 00, 09 06 03 ... etc.
with something like scanf("%i %i %i, ", &var1, &var2, &var3);
|
by: Frank |
last post by:
I am attempting to develop a solution where I handle bounced e-mails.
I wish to field all bounced emails in a custom email account such a
bounced@mycompany.com
From the aricle at http://www.systemwebmail.com/faq/2.7.aspx, I gather I
could use:
mail.Headers.Add( "Reply-To", "alternate_email@mycompany.com" );
When I test this from a test web app, I don't seem to field a bounced email
|
by: crystal2005 |
last post by:
I found such eror message when i tried to test sending email.
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /www/110mb.com/h/e/a/v/e/n/t/u/heaventure/htdocs/send_contact.php on line 10
Do we have to set something on the hosting server in order to be able to send message??
This is my code that i encountered the problem
|
by: Alexnb |
last post by:
Basically I want the code to be able to pick out how many strings there are
and then do something with each, or the number. When I say string I mean how
many "strings" are in the string "string string string non-string string"
Does that help?
Fredrik Lundh wrote:
--
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |