Solved

Create Interactive mobile application

Posted on 2008-10-14
13
825 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
  • 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
 
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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
DECT technology has become a popular standard for wireless voice communication. DECT devices are not likely to be affected by other electronic devices and signals because they operate in a separate frequency-band.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now