Solved

Create Interactive mobile application

Posted on 2008-10-14
13
824 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
Comment Utility
0
 
LVL 9

Author Comment

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

Expert Comment

by:CodeFish
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 6

Expert Comment

by:CodeFish
Comment Utility
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
Comment Utility
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
Comment Utility
>>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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanx codefish & MicheleMarcon:.. I appreciate your patience and help and Happy New Year.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SIM enable  androde  TAB 3 34
solarwind tftp server 2 30
internet passcode 14 52
MITM attack on Android phones 8 53
Need WiFi? Often, there are perfectly good networks that don't have WiFi capability - and there's a need to add it.  - Perhaps you have an Ethernet port into a network but no WiFi nearby. - Perhaps you have a powerline extender and no WiFi at the…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

771 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

11 Experts available now in Live!

Get 1:1 Help Now