I've created a midlet that downloads an image to the users phones. I want to be able to identify the user so I can give him a new image every time he uses the midlet. Is there a way of identifing the user on the server or can I send a userID from the midlet to the server?
I could, but would it be unique? How could you create code that generates a completely unique id and not check it against other id's? Can you send a unique id from the server and then store it in the RMS? That way the servlet can generate a random number and check it against other ids.
It depends on the ISPs, you can get an unique ID from the http header on the server for ATT, sprintPCS, ChinaMobile users, but not cingular, TMobile... [ August 03, 2004: Message edited by: Roseanne Zhang ]
How about this: in the jad file have a user defined key of userID. When the user accesses the server to download the game, edit the jad file in a servlet to change the userID key to a unique number. Then when the user plays the game have the midlet access this key and use it to identify the user when downloading an image.
Can you put the key in the JAR manifest file and generate the JAR file on the fly from the servlet? Scalability should not be a problem unless you have many people downloading it at the same time -- then you need to look at operator hosted solutions.
Originally posted by Ian Strain: I'm working on changing <change> to a unique ID now. Any ideas?
You could use a UUID generator like JUG or roll your own. You can get very reliable uniqueness by combining large enough pieces of the generating machine's IP address (MAC address is better if you have access to it), the generating machine's system time, a running counter, and perhaps a random number.
Then again, if you would happen to be using J2SE 1.5 (sorry, I meant Java 2 v5.0... :roll: ), you could use java.util.UUID.
Done that. But hey guess what, sony ericsson phones don't download the jad files. Very nice of them! Got round it by creating a class on the server containing an unique id then adding it to the jar file.
"its bad luck to be superstitious....."
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop