Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 840
  • Last Modified:

Create Interactive mobile application

I want to create an application for mobile devices using J2ME. I've created an application that can send data to server but i'm quite unable to get the response data directly through this application. The server is sending data through sms and i'm unable to access data arrived in inbox.

Is there a way so that my server application can send data directly to my client application or should i listen to some port.

Or is there is way so that my client application can check the data sent through sms in inbox.

please help me with sample code and description.
0
darkapple
Asked:
darkapple
  • 7
  • 5
2 Solutions
 
darkappleAuthor Commented:
i want some advice on how to access inbox through a J2ME base application?
0
 
CodeFishCommented:
What do you mean by "inbox?" If you build an sms application like the one MicheleMarcon suggests then it is a stand alone application. Are you referring to  the inbox of the OS on a specific phone? What server are you using? Can you post the code that you have? Thanks
0
NEW Internet Security Report Now Available!

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out this quarters report on the threats that shook the industry in Q4 2017.

 
darkappleAuthor Commented:
Its inbox of the OS on a specific phone. I'm implement SMS through SMPP protocol. My application in mobile sends message through SMS and the server responce through another SMS to the mobile not to the mobile application.

Now i want to know how to access that sms in inbox.
0
 
CodeFishCommented:
Can you identify the OS of the phone? This is important. For example, If you are looking at Nokia, then it is not possible on S40 series, it might be possible on S60 series, but you would need to program in C++ for Symbian.  Android would be a better platform to try this on because it is open source.
0
 
darkappleAuthor Commented:
we need to do it for general phone, so that our costumers can interact with our system.

If Symbian C++ is the choice, where should i start, what should i learn.

please help.
0
 
CodeFishCommented:
Hi darkapple, sorry for the delay.

The following link should be helpful. I have not tested the code, but I have little reason to doubt Nokia:
http://www.forum.nokia.com/info/sw.nokia.com/id/5f17ccde-249e-4c7d-ace9-980095ea5db1/S60_Platform_SMS_Example_v2_0_en.zip.html 
"Messages can be sent from the application and they can be received directly into the application (i.e., catching incoming messages before the user gets any notification). In addition, messages can be deleted, copied, or moved to other folders of the message store (inbox, outbox, drafts)."

You may want to post a message/search on the nokia forums for yourself. Here is a link that may be useful:
http://discussion.forum.nokia.com/forum/showthread.php?t=55343

You could try posting in the Symbian TA here at EE:
http://www.experts-exchange.com/Programming/Handhelds_-_PDAs/EPOC_-_Symbian_OS_Programming/

Here is a related question from that TA (for pocketpc):
http://www.experts-exchange.com/Networking/Wireless/Standards/GSM/Q_20543290.html?sfQueryTermInfo=1+inbox+sm

Hope it's helpful.
0
 
darkappleAuthor Commented:
thanks codefish, it did help me but i doubt will these symbian based application will work fine with other handheld devices since our application may make equal conversation with both symbian non-symbian handhelds.

Please suggest me any other idea if not.

Can we listen to the mail incoming port through java based application??

darkapple
0
 
CodeFishCommented:
>>Can we listen to the mail incoming port through java based application??

Yes. You can listen, but you cannot send messages from the inbox with J2ME.

I believe this is what you are looking for:

http://wiki.forum.nokia.com/index.php/CS000981-_Listening_for_incoming_SMS_messages:_Asynchronous_version

The code on that page is listed as for  Nokia S60 devices. I have not had a chance to test it fully on Nokia S40, but I think it will work.

The example listens on port 5000, I believe you want it to listen on port 0 in order to intercept the inbox. I'm not sure if this is possible. I will need at least the weekend to test it out. Work is very busy now.

Please feel free to post a request for additional assistance. Either way I will get back to you by Monday.
0
 
darkappleAuthor Commented:
Sorry codefish, i was bit busy this week.

and have you tested the application using port 0, i'm not getting time for testing. Also i'm confused whether this application will run smoothly on other mobile sets like Sony Ericsson, Motorola etc. etc. coz our application is to be distributed and to different customer?

Thanx a lot codefish.
Appriciated.
0
 
CodeFishCommented:
darapple,

You cannot receive an sms on port 0 in j2me. Any sms sent to port 0 will go to the inbox. If you have an application listening on port 0 the operating system of the phone will override it and deliver the message to the inbox. If you want to receive sms messages to the application, but not the inbox, you will need to listen on another port. Here is a simple example:

import javax.microedition.io.Connector;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.*;
import javax.wireless.messaging.Message;
import javax.wireless.messaging.MessageConnection;
import javax.wireless.messaging.MessageListener;
import javax.wireless.messaging.TextMessage;

public class SMSReceive extends MIDlet implements MessageListener {

    private Display display;
    MessageConnection messageConnection;

    public void startApp() {
        display = Display.getDisplay(this);
        connectSMSServer();
        receiveTextMessage();
    }

    public void pauseApp() {}

    public void destroyApp(boolean unconditional) {}

    public void connectSMSServer() {
        try {
            int port = 5000;
            messageConnection = (MessageConnection) Connector.open("sms://:" + port);
            messageConnection.setMessageListener(this);
        } catch (Exception e) {}
    }

    public void receiveTextMessage() {
        try {
            Message message = messageConnection.receive();

            TextMessage textMessage = (TextMessage) message;
            Form f = new Form("SMSMidlet Form");
            f.append(textMessage.getPayloadText());
            display.setCurrent(f);
        } catch (Exception e) { }
    }
   
    public synchronized void notifyIncomingMessage(MessageConnection conn) {
        synchronized (this) {
            notify();
        }
    }
}

There is no way around this in J2ME. If you want to catch sms messages sent to the inbox you will need to do it in another language.
0
 
darkappleAuthor Commented:
codefish, thanks a lot. I'll try this code soon.

 I was initially thinking of receiving messages through port 0 and failed. thanks for your guidance.

There is no way around this in J2ME. If you want to catch sms messages sent to the inbox you will need to do it in another language.

Do i have to opt Symbian C++?

thanx once again?
0
 
darkappleAuthor Commented:
Thanx codefish & MicheleMarcon:.. I appreciate your patience and help and Happy New Year.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Worried about phishing attacks?

90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now