Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    4

    What is the best way to target multiple devices?

    Hello All,
    I am still quite new to the topic of mobile phone programming.

    the first striking problem is how can i make my programs run on more than one device...

    The main problem is that the screen sizes are not the same..
    so, a program that run well on Nokia 7650 will look horrible on a 3510i for example

    Basically, i always make my coordinates in terms of getWidth() and getHeight()
    But, what about IMAGES?

    AFAIK, there is no scaling routine in the standards?
    What are possible solutions?
    Is the best approach is to make separate versions for every platform?

    Another question: Where can i see a list of all J2ME enabled devices along with screen sizes and resolution? This would be very helpful..

    Thank you very much in advance

  2. #2
    Registered User
    Join Date
    Mar 2004
    Posts
    29
    You can use the getHeight() and getWidth() and make your application adapt to the screen size of the device it´s running on. This is how I do it, then of course there are other concerns as that some devices may not report the width and height correctly, in which case you could use hard coded values. To ease this even more, you could use a preprocessor to have one setup of code with preprocessor directives telling it for what platform the compiler should compile your game. I know there are some java preprocessors out there, but you could just as well use a C preprocessor in theory.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    26
    If you don't use any images, its possible to scale your game
    width getHeight() and getWidth(), Once you start using images
    its another story (since you can't scale images). I usally do
    all paint (and help methods) in a View Class, so you just have
    to do another View Class.

  4. #4
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414
    If you use images the only choice is to build different versions for each different screen type.
    I prefer using final int constants for positioning images and define boundaries for each device. The game logic and paint method use these constants. The Ant with Antenna (build tool) can preprocess and build my apps for different devices in one go.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    26

    Screen size etc

    You can find out if a phone is Java enabled by looking at
    the Device Specification for each phone your intrested in, there's
    a link a the forum.nokia.com start page.

    Screen sizes are (to my experience) based on the series of the
    phone.

    Series 30: 96x65 pixels
    Series 40: 128x128 pixels
    Series 60: 176x208 pixels

  6. #6
    Registered User
    Join Date
    Mar 2004
    Posts
    4

    Thanks

    Thank you all for the replies.. that really helped...
    Really grateful for your efforts... :-)

Posting Permissions

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