• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Its about uniqueIDs again! Problems with downloading modified jar files

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I created a game. When a user goes to the wap site to download the game I have created a servlet that generates a uniqueID and then creates a java file with the uniqueID in it..
public final class GameProperties {
public final static long userID = 23423526;
public final static int gameID = 1;

public long getUserID(){ return userID;
}
}

I then compile this java file on the server and then add it to the games jar file. This works!
The problem is when I have created the jar file I use an outputstream to send the file to the phone. It works on most of the phones I use to test on, Nokia 6230, Nokia 3510i, Sony Ericsson K700i, Motorolo V80 and Motorola V500. But on the Sony Ericsson T630i I get the error "You client is not allowed to access the requested object" and on the Sharp GX-30 I get "unsupported content type"
So instead I tried to store the modified jar file on the server and use the jad file to send a request to the servlet to modify the jar file. This doesn't work on any phone. Would it be because the file size in the jad file is different from the actual size of the jar file?

I think this is the only possible way of giving a user a unique ID from the server. If anyone has any other way that will stop me having to modify the jar file (I've already tried modifying the jad file and its no good cos some phones don't download them) it would be a great help
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The size of the Jar mentioned in the Jad MUST be the size of the actual jar on the server for OTA to work.

As for the unique ID .. this is a real issue ... but depends on your implementation.. i am lucky in a way that i can ask the downloading user for his/her ID in the WML page before showing them the Jad to download the MIDlet.

Is it possible for you to do it this way ? I really am not sure
- User accesses WAP page.
- Selects link to download Jad
- Now in the earlier step when the user click on Download Jad.. that request is sent to the server. The server creates a new jar file ... gets its size .. writes the new size into the jad ... and then shoots back another WML ( or xHTML) page to the phone having a link "GET IT NOW"
- When the user clicks on GET IT NOW .. they download the new Jad and Jar..

I know this is not the best way .. but it can work .. i.e. if you are willing to add another step from the users perspective ( going to the GET IT NOW page) to the download process..


QUESTION >> Dont all the devices have to download the Jad file during OTA... I am under the impression that this part of the OTA specification.. Can anyone please clear my doubt.


Regards
 
Ian Strain
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm looking into modifying the jad file after creating a new jar file. Seems like the only way about it.
From what I've seen, the Sony Ericsson phones do not download the jad files. I discovered this by trying to put the userID in a user defined key in the jad file is have the midlet retrieve the userID from the jad. It was not possible to do this with Sony Ericsson. Why they have decided to do this is beyond me! Also, can't understand why Motorola phones are so crap, don't they compare them to other phones?! Not just talking about their Java capabilites but eveything else is so slow. It would be nice if every phone manufacter would just copy Nokia!!
 
Punit Raizada
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hmmmm....

something just occurred to me .. Do the SE phones send the install-notify and more important delete-notify messages ???

did u ever try this out ???

Regards
 
Ian Strain
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah they do send install notify. I think they read from the jad file and gets the file info for the download and then downloads the jar but not the jad.
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SE phones read from the MANIFEST file. I was able to modify the jars for SE before download. Since it reads from MANIFEST, no size problem since no such information there.
 
Ian Strain
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good one. Bit late now cos I've got all that sorted. But I'll know in future. Still having problems with downloading images. Can't get a response from the server. Think it might be a provider thing cos it works on some phones.
 
reply
    Bookmark Topic Watch Topic
  • New Topic