IT Community - Software Programming, Web Development and Technical Support

Auto Resize Applications in J2ME ?

This is a discussion on Auto Resize Applications in J2ME ? within the J2ME forums, part of the Mobile Software Development category; Auto Resize Applications in J2ME ?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > Mobile Software Development > J2ME

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-22-2007, 09:27 PM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 547
itbarota is on a distinguished road
Question Auto Resize Applications in J2ME ?

Auto Resize Applications in J2ME ?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-22-2007, 11:11 PM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: Auto Resize Applications in J2ME ?

When you have programmed your midlet for perfect fitting of your test device screen resolution, for instance 176x208, and now you want to make the application adapt automatically for other screen sizes, you can do that with out making much of a change in the Midlet.

First of all you need to declare two public variables accessible through out the midlet. At the load of the midlet, get the getWidth and getHeight values of Display object.

scrnW=getWidth();
scrnH=getHeight();
hfactor=scrnW/176f;
vfactor=scrnH/208f;

Now multiply these factors with each hard coded values you have set for vertical and horizontal components of your drawing code. Make sure that you add the “f” after your constants for floating point accuracy
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-06-2007, 08:21 AM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 547
itbarota is on a distinguished road
Default Re: Auto Resize Applications in J2ME ?

Thanks. But some devices report the width and height improperly and cause my application to go out of screen. Is there any way to solve this problem ?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-08-2007, 12:42 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 320
amansundar is on a distinguished road
Default Re: Auto Resize Applications in J2ME ?

hi there,
there is a class provided in motorola sdk com.motorola.extensions.ScalableJPGImage
in which you can scale jpg images to fit correctly in you application needs..
not only for jpg images but for png too...


ScalableJPGImage sImage = ScalableJPGImage.createImage(
"/test.jpg", 10, 10);

where test.jpg is the image in resource folder..

in this example i have set the image size 10 for width and height respectively
it can modified to screen size using GETheight() and getwidth() property
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-08-2007, 06:22 AM
jeyaprakash.c jeyaprakash.c is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 228
jeyaprakash.c is on a distinguished road
Arrow Re: Auto Resize Applications in J2ME ?

Hi all

is sclableimage method supports nokia phones AFAIK it only supports motorola only is this correct?
__________________
thanx n regards
jeyaprakash.c
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 08-08-2007, 06:32 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 320
amansundar is on a distinguished road
Default Re: Auto Resize Applications in J2ME ?

ya.. this scalableimage class can be used only in motorola phones

since coz this optional package

scalableImageEnhancement 1.0 is provided by only motorola and no other

manufacturing companies like nokia, sony ericsson provide functionality for

scaling images....
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 08-08-2007, 06:40 AM
jeyaprakash.c jeyaprakash.c is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 228
jeyaprakash.c is on a distinguished road
Arrow Re: Auto Resize Applications in J2ME ?

HI aman

what are the scalable image funtionalities provided by nokia, sonyericsson manufacturers..is it possiable can u explain some more
__________________
thanx n regards
jeyaprakash.c
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 08-09-2007, 12:06 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 320
amansundar is on a distinguished road
Default Re: Auto Resize Applications in J2ME ?

As far as i know there is no manufactures except motorola provides

scalableimage functionalities...may be nokia or sony ericsson provide

this type of functionality in future api....
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
can i make auto login? saravanan Operating Systems 0 03-21-2008 04:33 AM
How to resize a visitor's browser? jeyaprakash.c HTML, CSS and Javascript Coding Techniques 4 10-14-2007 09:20 PM
Stage and Background resize but other objects not to resize aramesh Flash Actionscript Programming 1 08-22-2007 10:33 PM
Explain Connecting External Hardware to J2ME applications itbarota J2ME 2 08-06-2007 08:11 AM
Auto Update Copyright [PHP] sanray316 PHP Programming 1 03-25-2007 12:26 PM


All times are GMT -7. The time now is 02:37 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0