j2me app

D

doronguy

how can i embedd the user phone number into the .jar
that the user is downloading ??


Thanx in advanced.
 
A

Andrew Thompson

doronguy said:
how can i embedd the user phone number into the .jar
that the user is downloading ??

Purely out of curiosity.

Why would I want my phone number 'embedded'
in your ..anything? What benefits does that bring
to me, as an end user?

Andrew T.
 
D

doronguy

well, i want to generate a unique key code for
this specific user in order to use my
application.

Andrew Thompson ëúá:
 
S

Simon Brooke

how can i embedd the user phone number into the .jar
that the user is downloading ??

Pack the jar on the fly at delivery time? Actually, it would be much easier
to do it by substituting a value into the jad file at delivery time, which
is what I'm planning to do with bike-race monitoring software I'm
developing. The racer enters his race number and event code into a web
form, they get substituted into a jad file which gets delivered to him,
the jad file causes the phone to download and install the jar file, and
when the racer starts the tracker app it sends his race number back to the
server. His live position during the race then appears on Google Earth...
assuming good phone network coverage, of course!
 
D

doronguy

thanx for the info simon
so, how can i place a value into the jad file on the fly, can you
send me any example link or code.
?

but the actuall jad file doesnt downloaded into the client phone ?
guy.

Simon Brooke ëúá:
 
S

Simon Brooke

doronguy said:
thanx for the info simon
so, how can i place a value into the jad file on the fly, can you
send me any example link or code.
?

You'd put a value in your jad file something like this:

user-phone-number: @phonenumber@

Then you'd have an HTML page with a form with an input

<input name="phonenumber" type="text">

The action of the form go to either a CGI or a Servlet. Actually a PERL CGI
might be a good solution here, because this sort of thing is one of the
(few) things PERL is good at, but because I'm used to Java I'd use Java.

The servlet would do something like (note: off the top of my head, not
tested):


import org.apache.regexp.*;

....

protected void doGet( HttpServletRequest req, HttpServletResponse resp)
throws ServletException, java.io.IOException
{
doPost( req, resp);
}

protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, java.io.IOException
{
String pattern = "@([a-zA-Z0-9_-]+)@";
String phonenumber = req.getParameter( "phonenumber");
ServletOutputStream out = resp.getOutputStream()

RE regexp = new RE( pattern );

BufferedInputStream buffy =
new BufferedReader(
new InputStreamReader( new FileInputStream( jadFile)));

for ( String line = buffy.readLine(); line != null; line ++)
{
if ( phonenumber != null)
{
regexp.subst( line, phonenumber);
}

out.println( line);
}
}
but the actuall jad file doesnt downloaded into the client phone ?
guy.

Yes, it does. That's how 'Over the Air' provisioning works.


--
(e-mail address removed) (Simon Brooke) http://www.jasmine.org.uk/~simon/

The Conservative Party is now dead. The corpse may still be
twitching, but resurrection is not an option - unless Satan
chucks them out of Hell as too objectionable even for him.
 
D

doronguy

thanx alot simone, well, ill go to test is and see of
it will work for me.


Simon Brooke ëúá:
doronguy said:
thanx for the info simon
so, how can i place a value into the jad file on the fly, can you
send me any example link or code.
?

You'd put a value in your jad file something like this:

user-phone-number: @phonenumber@

Then you'd have an HTML page with a form with an input

<input name="phonenumber" type="text">

The action of the form go to either a CGI or a Servlet. Actually a PERL CGI
might be a good solution here, because this sort of thing is one of the
(few) things PERL is good at, but because I'm used to Java I'd use Java.

The servlet would do something like (note: off the top of my head, not
tested):


import org.apache.regexp.*;

...

protected void doGet( HttpServletRequest req, HttpServletResponse resp)
throws ServletException, java.io.IOException
{
doPost( req, resp);
}

protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, java.io.IOException
{
String pattern = "@([a-zA-Z0-9_-]+)@";
String phonenumber = req.getParameter( "phonenumber");
ServletOutputStream out = resp.getOutputStream()

RE regexp = new RE( pattern );

BufferedInputStream buffy =
new BufferedReader(
new InputStreamReader( new FileInputStream( jadFile)));

for ( String line = buffy.readLine(); line != null; line ++)
{
if ( phonenumber != null)
{
regexp.subst( line, phonenumber);
}

out.println( line);
}
}
but the actuall jad file doesnt downloaded into the client phone ?
guy.

Yes, it does. That's how 'Over the Air' provisioning works.


--
(e-mail address removed) (Simon Brooke) http://www.jasmine.org.uk/~simon/

The Conservative Party is now dead. The corpse may still be
twitching, but resurrection is not an option - unless Satan
chucks them out of Hell as too objectionable even for him.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top