×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    13

    How to set username and passwd in jar?

    Hi guys,

    i'm building a j2me game that will allow users to play over the internet. For this each user will receive at registration a username and a password (this is before they get the jar via http). I'm thinking if there is any method that i could include each username and password in the jar that will be downloaded by the user?

    My first solution would be to keep the classes uncompiled, after i have the username and password replace the default string for username and passwd in one of the classes, compile, obfuscate, create jar and send to client. This seems to me very complicated, but this is my first solution... does any of you have a better ideea ?

    Can i set these with some JAD attributes?

    Thanks a lot,
    Mircea
    Last edited by mircearechi; 2007-01-31 at 15:23.

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: How to set username and passwd in jar?

    sure, you can add them in the JAD attributes, like
    username: ???
    password: ???

    and then you can query the contents using getAppProperty("username") and getAppProperty("password")

    The downside is that all this is available as plaintext data to a user (and anyone else). Also if the user wants to change the password, you need to store the new password in the recordStore as you cannot change the jad attributes later on.

    Hartti

  3. #3
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    307

    Re: How to set username and passwd in jar?

    IMHO the best solution wouldn't require passwords at all. I'm not sure about the distribution model you are going to use (SMS-messages, wap or web), but surely, you can add some registration code into your application, or simply prompt users for entering personal registration code at the first launch.

    It's up to you what can be done with the provided registration code. Either you will use it directly (to unlock some functionality in your game), or will send it to the server in accordance to receive a "now really can play the game"-code.

    It might be rather a better solution if you will use the mobile phones' IMEI codes as players' IDs, but on the J2ME platforms an ability to extract the IMEI is rather an exception than rule.

  4. #4
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: How to set username and passwd in jar?

    Quote Originally Posted by mircearechi
    Hi guys,

    i'm building a j2me game that will allow users to play over the internet. For this each user will receive at registration a username and a password (this is before they get the jar via http). I'm thinking if there is any method that i could include each username and password in the jar that will be downloaded by the user?

    My first solution would be to keep the classes uncompiled, after i have the username and password replace the default string for username and passwd in one of the classes, compile, obfuscate, create jar and send to client. This seems to me very complicated, but this is my first solution... does any of you have a better ideea ?

    Can i set these with some JAD attributes?

    Thanks a lot,
    Mircea
    My thoughts are like, let the user register in the web page, create the user name and password, store it in your server, the JAR/JAD will be send to the Mobile. Now when the user starts the MIDlet, he will be prompted to enter the user name and password, validate the username and password with the server, may be store it in your recordstore also. Validating the username and password is required only for the first time.
    Just my weired thoughts!

    Regards
    Gopal
    __________________
    MobiQuil.com
    An initiative by Developers for Developers.
    http://www.mobiquil.com - Alpha - Launched.

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    13

    Re: How to set username and passwd in jar?

    Hi guys,

    i appreciate you answers. I like them all. As a matter of fact the solution suggested by balagopalks and axs is the solution that is now implemented in the game ..the user has to enter his username and password wich then is saved in record store in my opinion this is the best (easy to implement and use) solution. But now we want to include the username and password for each user in the game they download so they would not have to type it...we see this as a feature for ease of use for the game. I think it is a feature that the user will apreciate (so all this is about usability not programming solution)
    Thanks a lot hartti for your answer, i will study today how can i use the jad attributes for my problem.

    Regards,
    Mircea

  6. #6
    Regular Contributor
    Join Date
    Sep 2006
    Location
    Delhi
    Posts
    77

    Re: How to set username and passwd in jar?

    Quote Originally Posted by mircearechi
    Hi guys,

    But now we want to include the username and password for each user in the game they download so they would not have to type it...
    Then what is the use of userID & password ?

  7. #7
    Registered User
    Join Date
    Oct 2006
    Posts
    13

    Re: How to set username and passwd in jar?

    the use of username and password is for the comunity ... as i said the game will be a multiplayer game... so everybody must have a name (username) and also this username and password will be used in the website of the game ...where a comunity will be created.
    Also .. when a player creates a new account (2nd acount) he will not have to redownload the game but he can change the name and the password... what i want to do is just to have the username and password with wich the game was downloaded already in the game.. so for the first time he will not have to type it ... this will be the case of most users ... not many will have more accounts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×