×

Discussion Board

Results 1 to 5 of 5

Thread: 7650 or 3650?

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    2

    7650 or 3650?

    Hi there,

    I've had a look around and can't find an answer to this post so here goes......

    Is there any way to detect what phone you are running on?

    I have a series 60 app and I want to map the keys a different way if it is a 3650 to if it is a 7650.

    I could put an option in but I would rather just auto detect it.

    Thanking you in advance.

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Try using System.getProperty("microedition.platform").

    shmoove

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    2
    Thanks but I have tried that. It returns "j2me".

    Any other ideas?

  4. #4
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    Sequal
    I am not answering your exact question, but
    ..but if all you need, is using arrow keys correctly, then your approach is unrecommended both by Nokia and Sun.

    You should use Canvas.getGameAction() to get "logical" key value (UP, DOWN, etc)

    Portable applications that need arrow key events and gaming-related events should use game actions in preference to key codes and key names. MIDP defines the following game actions: UP, DOWN, LEFT, RIGHT, FIRE, GAME_A, GAME_B, GAME_C, and GAME_D.

    Each key code may be mapped to at most game action. However, a game action may be associated with more than one key code. The application can translate a key code into a game action using the getGameAction(int keyCode) method, and it can translate a key code into a game action using the getKeyCode(int gameAction) method. The implementation is not allowed to change the mapping of game actions and key codes during execution of the application.

  5. #5
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Well another REALLY UGLY workaround you could use (and of course like dr. dwarf said, very unrecomended by everyone), would be to try out on a phone to see what are the keycodes return by Canvas.getKeyCode(int gameAction) on the different models for different game actions, and if the returned values are different on a 3650 and a 7650 then you could use those to differentiate between the two phones. This would mean that the portability of your app would go to @#$#% though.

Posting Permissions

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