Solved

Create Interactive mobile application

Posted on 2008-10-14
13
830 Views
Last Modified: 2013-11-24
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
Comment
Question by:darkapple
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
13 Comments
 
LVL 13

Assisted Solution

by:MicheleMarcon
MicheleMarcon earned 50 total points
ID: 22710353
0
 
LVL 9

Author Comment

by:darkapple
ID: 22948184
i want some advice on how to access inbox through a J2ME base application?
0
 
LVL 6

Expert Comment

by:CodeFish
ID: 23022181
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 9

Author Comment

by:darkapple
ID: 23032758
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
 
LVL 6

Expert Comment

by:CodeFish
ID: 23040211
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
 
LVL 9

Author Comment

by:darkapple
ID: 23047753
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
 
LVL 6

Expert Comment

by:CodeFish
ID: 23059342
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
 
LVL 9

Author Comment

by:darkapple
ID: 23074835
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
 
LVL 6

Expert Comment

by:CodeFish
ID: 23102284
>>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
 
LVL 9

Author Comment

by:darkapple
ID: 23191092
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
 
LVL 6

Accepted Solution

by:
CodeFish earned 450 total points
ID: 23222141
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
 
LVL 9

Author Comment

by:darkapple
ID: 23226587
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
 
LVL 9

Author Closing Comment

by:darkapple
ID: 31505796
Thanx codefish & MicheleMarcon:.. I appreciate your patience and help and Happy New Year.
0

Featured Post

Retailers - Is your network secure?

With the prevalence of social media & networking tools, for retailers, reputation is critical. Have you considered the impact your network security could have in your customer's experience? Learn more in our Retail Security Resource Kit Today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Here, we have shared an easy step by step tutorial on how to download instagram images and videos on PC, Android Mobile and iOS mobile.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question