×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    10

    Question Full screen mode?

    hi.

    i know that canvas support the full screen mode for mobile applications but it wont show the commands in full screen mode, and I'm searching if there is another way to make my application runs with full screen mode and showing the commands "i think it's not possible", but anyone comes with a solution? let me know please.

    10x in advance

    HSwaidan.

  2. #2
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Sri Lanka, Colombo
    Posts
    204

    Smile Re: Full screen mode?

    hi HSwaidan,

    there's no another way in j2me, this will depend on the mobile device.

    MIDP 1.0 does not support this feature, only MIDP 2.0 will support this feature,

    if you want to do this u can do it using LWUIT....

    cheers,
    Randika

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Full screen mode?

    Commands don't show (on most devices) in full-screen mode. Though, there is no specific definition of what "full-screen" means. On Motorolas, "full-screen" still shows the status bar (battery, signal, etc) at the top.

    Most devices do give you keyPressed() events for softkeys (but not always keyReleased()), so there's nothing to stop you implementing your own softkeys. This is simpler if you only want two commands.

    Downside is: since you need to hard-code the key-codes for the softkeys, this needs modification for different devices.

    But, here's a sample.

    Code:
    public abstract class FullCommandCanvas extends Canvas {
        /// set these values appropriate to the device
        private static final int LEFT;
        private static final int RIGHT;
    
        private CommandListener listener;
        private Command left;
        private Command right;
        private int softkeyRegionHeight;
    
        public FullCommandCanvas() {
            setFullScreenMode(true);
            softkeyRegionHeight = Font.getDefault().getHeight();
        }
    
        public void addCommand(Command c) {
            throw new IllegalStateException();
        }
    
        public void removeCommand(Command c) {
            throw new IllegalStateException();
        }
    
        public void setLeftCommand(Command c) {
            left = c;
        }
    
        public void setRightCommand(Command c) {
            right = c;
        }
    
        public void setCommandListener(CommandListener l) {
            listener = l;
        }
    
        public int getHeight() {
            return super.getHeight() - softkeyRegionHeight;
        }
    
        public abstract void paintDelegate(Graphics g);
    
        public final void paint(Graphics g) {
            // paint softkey area
            int softkeyTop = getHeight();
            int w = getWidth();
            g.setColor(0xffffff);
            g.fillRect(0, softkeyTop, w, softkeyRegionHeight);
            g.setColor(0x000000);
            g.drawString(left.getLabel(), 0, softkeyTop, Graphics.LEFT | Graphics.TOP);
            g.drawString(right.getLabel(), w, softkeyTop, Graphics.RIGHT | Graphics.TOP);
    
            // delegate to subclass
            g.clipRect(0, 0, w, softkeyTop);
            paintDelegate(g);
        }
    
        public abstract void keyPressedDelegate(int keycode);
    
        public final void keyPressed(int keycode) {
            if (listener != null && keycode == LEFT) {
                listener.commandAction(left, this);
            } else if (listener != null && keycode == RIGHT) {
                listener.commandAction(right, this);
            } else {
                keyPressedDelegate(keycode);
            }
        }
    }
    Cheers,
    Graham.

  4. #4
    Registered User
    Join Date
    Jan 2009
    Posts
    10

    Re: Full screen mode?

    10x for replying

    i realized before that full screen mode with commands wont work on most devices , i just tried to see if someone gets a solution but i think it's not available, anyway 10x for ur help.

Similar Threads

  1. Screen mode change bug
    By joemarshall in forum Symbian User Interface
    Replies: 5
    Last Post: 2010-09-20, 12:48
  2. plz help : screen mode issue
    By Mark-07 in forum Symbian
    Replies: 0
    Last Post: 2008-11-04, 07:26
  3. how to exit full screen?
    By sunny8285 in forum Symbian User Interface
    Replies: 8
    Last Post: 2008-10-23, 08:24
  4. Full screen listbox skin not rendered correctly
    By template60 in forum Symbian
    Replies: 2
    Last Post: 2007-09-11, 04:34
  5. How to switch off full screen on N93
    By Wacek in forum Streaming and Video
    Replies: 0
    Last Post: 2007-01-17, 14:25

Posting Permissions

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