William Frantz

Ranch Hand
+ Follow
since Dec 08, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by William Frantz

This may be a better question for the J2EE forum although I don't doubt that somebody around here has done exactly what you are asking about.

William Frantz
http://sprintdevelopers.com
12 years ago
Yeah, it's too far fetched.

Some devices do have APIs that allow you to read/write to the file system. The vast majority of devices only allow access to RMS.

You can't 'redirect output' to RMS.

William Frantz
http://sprintdevelopers.com
12 years ago

Originally posted by Anandh Ramesh:
I need an application which does exactly what your friend has done (sending data from phone to server).


Actually, the original question was regarding pushing data from a server to a phone.

If you want to push data from a phone to a server, that's easy. You could write a J2ME MIDlet that posts data to an HTTP server, but the easiest thing would be to use a native web browser to access a simple form on a standard web server.

What carrier/handset are you trying to use and what data are you tring to move?

William Frantz
http://sprintdevelopers.com
12 years ago
If there is an application to record a phone call then it won't be a J2ME MIDlet. That's beyond the capabilities of the MIDP APIs.

You may find a Symbian OS program to do the job.

William Frantz
http://sprintdevelopers.com
12 years ago

Originally posted by Peter Rooke:
Does anyone know if it is possible to have a server send data to a mobile device?



Which carrier and which device are you asking about? The answer may vary.

Most (all?) wireless carriers use dynamic IP addresses for mobile devices so it's impossible to directly initiate a socket connection.

You may have heard about dynamic DNS services that could, in theory, map a domain name to the dynamic IP address of your phone. However, these services rely on a 24/7 client running on your phone that would report IP address changes to a domain name server. This solution won't help you. If you are going to run a 24/7 client on the device then you might as well make that device keep an open channel directly to your server rather than mess with all the dynamic DNS stuff.

What you might be able to do is use a text message to the device is a wake-up call. When the phone receives the special SMS then it runs an application to retrieve the payload from your server.

Depending on the phone/carrier, you may be able to automate the entire process. The phone would listen for specially coded messages, launch your MIDlet, and so on. Alternatively, you can just send a message intended for the owner. Something like, "Hey, run the FooBar program now!"

William Frantz
http://sprintdevelopers.com
[ January 06, 2006: Message edited by: William Frantz ]
12 years ago
You should consider your target device/carrier. For example, Sprint distributes their own WTKs that include Sprint specific extensions to the standard APIs. If you are developing for Sprint devices, you don't want to use any of the Sun WTKs. You need to find the WTK that most closely matches your device.

William Frantz
http://SprintDevelopers.com
12 years ago
There is no sense naming multiple commands with the same priority.

For example, assume a device has two softkeys and you want to display 4 commands. It should put the highest ranked command on one of the softkeys. The other key will display something like "menu" where the remaining 3 commands will appear.

Move that same application to a three softkey device and commands 1 and 2 will be visible while 3 and 4 will be under one key called "menu".

It's also possible that the JVM will simply ignore the priorities and put all the commands under a single "menu" key.

All of the above is purely conjecture on what is likely. As Mark pointed out, it's really up to the JVM and there are no guarantees.

I usually make a "static final" called lowPriority and set it to 99. Then I make a highPriority set to 1. When I start defining commands I use expressions like highPriority, highPriority+1, highPriority+2, or lowPriority, lowPriority-1, lowPriority-2, etc.

William Frantz
http://sprintdevelopers.com
12 years ago
Which handset/carrier are you asking about?

In general, there is no works-on-everything solution for extracting the phone number from a handset. Some phones include it in the HTTP headers. Some will support proprietary extensions to the APIs to allow it. Sprint phones include a proprietary, encrypted device ID in the HTTP headers which only Sprint can decode into the subscriber's phone number.

The best suggestion is to store the number in the JAD or RMS. If you provision the MIDlet over the air, prompt the user for their phone number on your website. Embed the number into the JAD and send an SMS to the phone with the download link. Once your program starts, extract the number from the JAD properties.

William Frantz
http://sprintdevelopers.com
12 years ago

I ask this cos most of the mobiles these days carry Symbian OS and not Java OS.



That's not my experience at all. First of all, you can always get a JVM for a Symbian phone. That means all Symbian devices are effectively Java devices too.

The reverse is not true. I can't pick up any J2ME handset and add Symbian to it.

Even ignoring that fact, I still think there are way more J2ME devices than Symbian devices world wide. In North American there are practically no Symbian phones at all. Nearly all Sprint and Cingular phones include J2ME. Verizon phones are mostly BREW.

William Frantz
http://sprintdevelopers.com
If you are buying the RAZR with the intention of running your own MIDlets, you should make sure you can provision applications to it.

The last time I installed my own MIDlets on a RAZR, I had to go through some complicated steps involving a SEAM editor to hack the phone before it would allow me to install an application over a cable. I could not simply download my MIDlet over the air.

William Frantz
http://sprintdevelopers.com
There are always caveats, but yes, you can manipulate image bits within a J2ME application. They're just bits.


William Frantz
http://sprintdevelopers.com
12 years ago

Originally posted by Hari Krishna:
I am new to J2ME. I have to send sms to GSM and CDMA mobiles. Please Explain the process to do this project. I have to send sms through web.

If you are sending messages through a web server, you don't need anything written in J2ME. Most carriers maintain a website for sending messages to their subscribers. For example, this is Sprint's: http://messaging.sprintpcs.com. This is Cingular's: http://www.cingularme.com/do/public. Here is Verizon's: http://www.vtext.com.

Another alternative is to use an email-to-SMS gateway. For example, send a message to 8005551212@messaging.sprintpcs.com and Sprint will forward the message as an SMS to 800-555-1212.

Finally, you could use an email-to-SMS aggregator service like Teleflip. Just send email to 8005551212@teleflip.com and they will forward it as a text message to the appropriate carrier.

William Frantz
http://sprintdevelopers.com
[ December 06, 2005: Message edited by: William Frantz ]
12 years ago
Not many J2ME devices can listen for incoming messages and then act on them (a.k.a. receive a push).

You'll mostly be limited to devices which support something like JSR 205.

The MessageListener interface provides a mechanism for the application to be notified of incoming messages.

When an incoming message arrives, the notifyIncomingMessage() method is called. The application MUST retrieve the message using the receive() method of the MessageConnection. MessageListener should not call receive() directly. Instead, it can start a new thread which will receive the message or call another method of the application (which is outside of the listener) that will call receive().


William Frantz
http://sprintdevelopers.com
12 years ago
I'll go out on a limb here and just say "it can't be done".

You are trying to figure out how a MIDlet could initiate a connection to a standard FAX machine and transmit an image to it. I don't think you'll find any phone capable of doing that.

My best suggestion would be to use an e-mail to FAX service like efax. You can send them a standard e-mail message which they will, in-turn, FAX to a standard phone line.

If you have a service like that available, then you can send FAXes from your MIDlet as simply as sending an e-mail message. While that's not exactly simple, it's at least possible. You just need an SMTP client.

William Frantz
http://sprintdevelopers.com
13 years ago