dynamic repackaging of java code

Dear All

I have a java ( j2me ) mobile application that I want to sell thru my web site, this application depends very much on the home location of each customer, so I want the customer to specify his location ( city ) , and then I can repackage the jar file for him , is it possible ?.

thnks for the help
Who is Participating?
use the .jad file add a parameter called city, so ur jad file will look like this:

MicroEdition-Profile: MIDP-1.0
MicroEdition-Configuration: CLDC-1.0
MIDlet-Version: 2.0
MIDlet-Name: MyApp
MIDlet-Vendor: myApp
MIDlet-Jar-URL: MyApp.jar
MIDlet-Jar-Size: 10107
MIDlet-1: NumberGuessMIDlet, /res/duke_ce.png, urpackage.MyMidlet
city: London

from ur midlet get the city property value:

        String City= getAppProperty("city");

and then continue ur logic based on this

it is easy to rewrite ur application JAD file rather than programatically repackage ur J2ME application

Is this enouph for u?
khamoudaAuthor Commented:

thanks but the problem is that I have a very large array that needs to be defined in the code it self, this array depends on the city, and I cannot put such arrays for many cities !

did you get me ?
no problem manipulate this in ur jad too, add to ur jad the following:

city: london
city-data: xyz, wzu, ...., ......, ........., ........

just read it from ur application using

String city-data= getAppProperty("city-data");

and parse based on "," and put into ur Vector
also if u r affraid to put all data in one line comma separated u can do some thing like this:

city-data1 = 50 items
city-data2 = more 5o items

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.