Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (843)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Samsung e317 bug  (Read 1848 times)
0 Members and 1 Guest are viewing this topic.
Offline wooD

Senior Newbie

J2ME Developer

« Posted 2005-01-13 14:33:48 »

I have an odd issue with a Samsung e317. The app works on every other phone and I'm beginning to believe it is an actual problem with the phone. i've tested this on three other phones and it works fine (Samsung a620, Sanyo 8100, Nokia 3595).

This is the code in question. It draws images from within images so I can limit my file size by cramming everything into one or two images.
public void drawSubImage(Graphics g, Image src,int x,int y, int subx, int suby, int width, int height)

  // reset the clip rect so further drawing works

The problem seems to be with the second setClip which sets the clip rect back to the full screen. I have checked scrx and scry values and they are fine.

Only the graphical elements show up after calls to drawSubImage and none of the hand drawn stuff. Subsequent calls to drawSubImage do seem to work because all the image elements on the screen are drawn, just not the line/fill elements.

This is drawn to an offscreen (mutable) image and not the screen, but I don't see how that would matter. Especially since it works on other phones.

Anyone seen similar problems on the e317?


Offline wooD

Senior Newbie

J2ME Developer

« Reply #1 - Posted 2005-01-17 14:08:54 »

I'm convinced that the Samsung e317 (Cingular) has a bug in the Graphics.fillRect method.

I did a bunch more testing with Ofscreen bitmaps and found that fill rect will not draw outside screen size if the offscreen bitmap is larger than the screen.   I found a page that describes a very similar problem with Graphics.drawLine on earlier Samsung phones.  This talks about drawLine problems and the way to fix it with fillRect, but similar in behavior.

The offscreen image is larger than the screen size by 20 pixels (my tile size) so I only have to draw into the bitmap when the screen offset is larger than 20. Then I scroll smoothly and only update on the edges when the offset is > 20.

Samsung's developer website doesn't describe any problems what so ever with any phone and it has message boards that have questions that have gone unanswered for months. Quite stale. Welcome the J2ME hell. Bad implementations and bad developer support.


To describe the J2ME world as bad gives it way too much justice. A better description would be the absolute worst environment anyone could possibly work with. The next "worst" environment would be a million times better. Coming from someone who's been in the trenches for 5 years now. It has never improved and has only progressively gotten worse. If you plan to enter this market, take this into acount as a huge huge risk. Every phone you plan to support will require a special version of your program and hours and hours of time to test and write phone specific work arounds with no debug capability on the device, not even System.out.  Not only do we get the performance hit of a JVM, but we have the same problems as C anyways. Very disappointing.

This is not one of my required phones (yet),  just the phone I carry so I'm not sure if I'm going to fix it or not. The work around I'm thinking about is to have three offscreen images, one as large as the screen and two 20 pixel wide strips, one horizontal and one vertical at the bottom and right. I'll typically have to draw all three to update the screen and do some odd behavior to update them all when the scroll factor reachs 20.

The other workaround is funny. Since the other phones have drawLine problems and the work around is to use fillRect with a width of 1, I was thinking I could maybe use drawLine in a loop to fill in the rect. Hmmm, probably a performance pig but it would be a lot easier to implement than the three separate offscreen bitmaps. Assuming drawLine didn't have the same problem.

Hope that helps some one out there.


Offline wooD

Senior Newbie

J2ME Developer

« Reply #2 - Posted 2005-01-26 13:13:27 »

Just a note on one of my work arounds. Rewriting the fillRect with drawLine calls did not fix the problem. I'm betting the same bug exists in drawLine in that you cannot draw into an offscreen image in the areas that are larger than screen size.

The only solution I see is to have three offscreen images. One will be screen size, the other two will be my tile width/height and I will draw the second two on the right and bottom. I have not yet implemented this and may or may not depending on distribution.

Pages: [1]
  ignore  |  Print  

EgonOlsen (38 views)
2018-06-10 19:43:48

EgonOlsen (20 views)
2018-06-10 19:43:44

EgonOlsen (40 views)
2018-06-10 19:43:20

DesertCoockie (187 views)
2018-05-13 18:23:11

nelsongames (122 views)
2018-04-24 18:15:36

nelsongames (121 views)
2018-04-24 18:14:32

ivj94 (861 views)
2018-03-24 14:47:39

ivj94 (122 views)
2018-03-24 14:46:31

ivj94 (758 views)
2018-03-24 14:43:53

Solater (139 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!