×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    10

    Playing SWF within J2ME

    hi all,
    i need any body till me please if i can to run an SWF file (Flash File) Under J2ME, and if it possible i want to know the code which do that.

    thanx

  2. #2
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: Playing swf within J2ME

    Flash is included into third edition phones like nokia N73 and E50 etc. so i am sure there will be a Micro version of the swf file which will work. i will check it out tonight and will let u know tommorrow.
    Regards
    Nouman

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

    Re: Playing swf within J2ME

    More info on Flash Lite is available here.
    http://www.forum.nokia.com/main/reso...ash/index.html

    Regards
    Gopal

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

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

    Re: Playing swf within J2ME

    There is no swf playing capabilities built in the Java ME, so you cannot play the swf files under Java ME.

    Hartti

  5. #5
    Registered User
    Join Date
    Mar 2007
    Posts
    10

    Re: Playing swf within J2ME

    Thanks all,
    so, swf files can't be played from J2ME.
    But what about gif files? if you included a gif image in the common way it won't start its animation, and as far as I know, you can make it animate.
    But I don't know how...

    Any links, documents would be appreciated.

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

    Re: Playing swf within J2ME

    Its possible to use gif images, but is not possible to animate it.
    You can do the necessary animation by using Film strips.you have to create the desired strip image with different frames; and then using setClip()and drawImage() to make the necessary animation.

    Regards
    Gopal

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

  7. #7
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: Playing swf within J2ME

    guys i was wondering why cant swf files work on mobiles. i mean why cant a micro version of swf available so that we can run on mobiles. i am sure mobile now have good graphics capability to support it.
    Regards
    Nouman

  8. #8
    Registered User
    Join Date
    Mar 2007
    Posts
    10

    Re: Playing swf within J2ME

    balagopalks: I have seen a midlet that animates a gif image using the Manager.createPlayer(). But I don't remember how exactly...

    nicenouman: swf files can run on mobiles, but it can't be embedded in J2ME.

  9. #9
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,561

    Re: Playing swf within J2ME

    Quote Originally Posted by nicenouman
    guys i was wondering why cant swf files work on mobiles. i mean why cant a micro version of swf available so that we can run on mobiles. i am sure mobile now have good graphics capability to support it.
    But .swf files already *DOES* work on most (all) current Nokia phones *IF* the .swf file contains Flash Lite content.

    In other words, most current phones have an embedded Flash Lite player (depending on the phone, it is Flash Lite 1.1, 2.0 or 2.1).

    What's not there, is ability to launch the Flash Lite player (as a separate app, or embedded into a MIDlet) from J2ME.

    Note that Flash Lite is a subset of "full" Flash, so all the bells & whistles that work on fancy web sites when using a PC based browser, are not possible today on a mobile phone (not in the standalone player, nor through the phone's web browser).

  10. #10
    Registered User
    Join Date
    Mar 2007
    Posts
    10

    Solved

    I found a way to play gif motion in a midlet, check this:
    Code:
    Player player;
            Form form;
            VideoControl vidc;
            Item videoItem;
            
            form = new Form("Play gif");
            Display.getDisplay(this).setCurrent(form);
            
            InputStream ins = getClass().getResourceAsStream("/image.gif");
            player = Manager.createPlayer(ins, "image/gif");
            player.prefetch();
            player.start();
            
            if ((vidc = (VideoControl) player.getControl("VideoControl")) != null)
                videoItem = (Item)vidc.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null);
            
            form.append(videoItem);
    Thanks All

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

    Re: Solved

    Thanks Petrib for explaining things more clearly than I was able to explain it.

    About GIF files
    The gif file support (including animation) is available on some phones, but not on all phones. For example Series 40 phones are supporting PNG and GIF "playback" starting from Series 40 3rd Edition Feature Pack 1. On S60 sides the support was also added for the S60 3rd Edition FP1 phones.

    See the implementation notes in the Java ME Developer's guide for more details
    http://www.forum.nokia.com/document/...opers_Library/

    Hartti

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

    Re: Solved

    Quote Originally Posted by hartti
    About GIF files
    The gif file support (including animation) is available on some phones, but not on all phones. For example Series 40 phones are supporting PNG and GIF "playback" starting from Series 40 3rd Edition Feature Pack 1. On S60 sides the support was also added for the S60 3rd Edition FP1 phones.

    See the implementation notes in the Java ME Developer's guide for more details
    http://www.forum.nokia.com/document/...opers_Library/Hartti
    Thanks Hartti for this info. I really missed this!.

    Regards
    Gopal

    __________________
    MobiQuil.com
    An initiative by Developers for Developers.
    http://www.mobiquil.com - Alpha - Launched.
    Twitter : @balagopalks
    Linkedin : @balagopalks

  13. #13
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: Playing swf within J2ME

    so in short currently swf files cannot be embedded in J2me but can run on mobile phone having flash player lite.

    thanx for the info guys. really appreciate it.
    Regards
    Nouman

  14. #14
    Registered User
    Join Date
    Apr 2003
    Posts
    62

    Re: Playing swf within J2ME

    Quote Originally Posted by nicenouman
    so in short currently swf files cannot be embedded in J2me but can run on mobile phone having flash player lite.

    thanx for the info guys. really appreciate it.
    And to add an important point (mentioned already above by user petrib): The SWF files cannot be just any generic SWF files from the internet, they will have to be specifically made for Flash Lite. The Flash Lite player displays Flash Lite files.

    Supported Nokia devices are listed and a standalone Flash Lite player for S60 devices can be downloaded at http://www.adobe.com/devnet/devices/nokia.html

Similar Threads

  1. Playing DRM encrypted audio via J2ME
    By ewaldvdw in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2008-10-30, 12:36
  2. Playing Two Videos in One Canvas J2ME
    By satyarajasekhar in forum Streaming and Video
    Replies: 1
    Last Post: 2007-12-19, 10:53
  3. play a flash swf movie from inside j2me application
    By rhalfi in forum Mobile Java General
    Replies: 1
    Last Post: 2006-12-21, 15:29
  4. Replies: 1
    Last Post: 2003-06-21, 16:15

Posting Permissions

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