Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (565)
Games in Android Showcase (151)
games submitted by our members
Games in WIP (606)
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  
  Http connection is delaying canvas.keypressed  (Read 5225 times)
0 Members and 1 Guest are viewing this topic.
Offline Hooble

Junior Newbie

I love YaBB 1G - SP1!

« Posted 2007-05-18 13:38:57 »

Hello all!

I havn't been back here for quite some time, but I have one that is stumping me for the moment. My name is Adam Schmelzle, and I have been making J2ME games for a while(Attack Chopper 1/2, Attack Breaker Pro, Attack Brain), so I'm not really new to this.

I am working on an online system for my next game, and all my messaging is done through an HttpConnection for now. I am trying to make this compatible with Midp1.0, which is why I am using http. I have everything working fine on the Sun WTK25, but when it comes to using my phones, I run into problems with my canvas.keypressd() events.

Sometimes the keypresses/releases will work fine, sometimes a delay of a second or two, sometimes it won't fire until I hit some buttons a few times.

Example 1: So I can press and hold "up", get the "up-pressed" event, wait a couple seconds then release, but not get the "up-release" event. If I press "up" again I don't get the "up-pressed" event at all, but when I release I finally get the original "up-release" from the first keypress.

Example 2: Press "up", get "up-pressed" event. Release "up", and never get the "released-up" event at all.

This only happens if my network IO thread is sending/receiving data. On one of my phones I experience problems for the entire duration of my game after even doing just 1 httpConnection on the main game thread.

I guess I want to know if anybody has some advice for me regarding network IO. I assume that somewhere along the line the runtime is starving the thread that handles the keypresses, but is there any way to avoid this? Maybe sleeping/waiting briefly(1ms) in the middle of transfering data every once in a while? It does take a second or two to send/recieve.

I plan on implementing socket IO for Midp2.0 phones after I've got all the kinks worked out for Midp1.0. My server will use nio, which I have used before in an applet game with positive results.

Help please,
Offline OverKill

Junior Devvie

Java games rock!

« Reply #1 - Posted 2007-05-21 07:53:37 »

Are you not using a thread to handle your network connections?
Making a connection is the most time-consuming part.

Also writing a realtime.multiplayer game for mobile might not be the best idea, nothing personal.
Seeing the problems we have with our messaging client, I would not go down that path.
A TBS or similar game would be a different issue.

Though I'd love to be proven wrong.
Offline Hooble

Junior Newbie

I love YaBB 1G - SP1!

« Reply #2 - Posted 2007-05-22 13:15:36 »

Thanks for the reply! I was looking at the timestamps on the most recent posts, and getting discouraged. I'm not doing anything that's obviously completely silly.

From my own post:
1. Of course I'm using a separate thread for IO, QUOTE: "This only happens if my network I/O thread is sending/receiving data." You don't honestly think somebody that has made even 1 game doesn't know how to handle I/O?
2. I didn't say "real-time" anywhere. I've got a 2+sec ping.

With that cleared up, here's an update: It's not my fault. That's right; I purchased a new phone, and it passed with flying colours. Not only that but I 'hacked' one of my other phones to remove the 'network access allowed?' screen, and the problem magically went away.

So here's what I think was happening: After the phone's stupid OS pops up the 'network allowed?' screen, it never cleans up after itself properly, and buggers up the keypresses. Since to solve my problem the only thing I did was remove this screen, it's the obvious culprit. There's always something wacky when it comes to mobiles.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline OverKill

Junior Devvie

Java games rock!

« Reply #3 - Posted 2007-05-22 13:50:57 »

Don't take is personally, without the info I have to guess and, well you know the 'I wanna make an MMO on my mobile' types Wink
And the line you re-quoted hinted at sending data each keypress.

And yes, it is your fault. /me jumps behind a large rock Wink

Ah the permissions and the security system. The royal PITA!
If you want to never see those again you would have to set all permissions (watch out, can have device specific issue) and sign your midlet.
Just setting the permissions lets you get to 'Ask first time', signing gets you the 'never ask me again':

In the WTK you can set your midelt to manufacturer and it will never ask you.

There's always something wacky when it comes to mobiles.
And that is why we earn a lot of money for doing this.
Offline Hooble

Junior Newbie

I love YaBB 1G - SP1!

« Reply #4 - Posted 2007-05-22 16:24:16 »

Well I still contend that it's "not my fault", since it's not the permissions that cause the problem, but the 'popup ' screen that is doing the asking. The security question is there to ask the user about allowing the connection, not delaying the keypresses in strange and unpredictable ways.

Chosing "always allow" doesn't fix the problem with the keypresses, it just lets my connection have permission. Heck, on one phone it asks "always allow" for every connection regardless of the user chosing "yes". The keypresses are screwy because of the question, not the answer. One of my phones asks permission for every single midi note, no joke.

I can't sign the apps. I upload them to my advertiser, who in turn ads their advertising code to the app, and then distributes it for free from their site and others. If anyone is going to sign it it'd have to be them, but because this isn't limited to specific manufacturers/cariers/regions/countries/languages/continents, it's not really practical.

"And that is why we earn a lot of money for doing this.", I'm not quite in the "lot of money" category yet myself.

*shameless plug* Check out , my games are actually some of the top ad-revenue generating free games out there. It's nice to pay the bills while working from home.

Offline OverKill

Junior Devvie

Java games rock!

« Reply #5 - Posted 2007-05-23 08:23:13 »

We have the permissions and the signing and there are no problems on our side.
Might be a firmware issue? What phone is this?

Ah ok, that changes a lot. I have been down that road.

Where are you located? I might have something.

Which ones are yours? I can see my last project from my old comp there as well.
Offline Hooble

Junior Newbie

I love YaBB 1G - SP1!

« Reply #6 - Posted 2007-05-23 12:35:42 »

My games are these:

Attack Breaker Pro:

3D Attack Chopper:

3D Attack Chopper 2:

The listings are all done by  (#times played) / (#players) for the current month. Currently my best performing game "Attack Breaker Pro" is at #9 in the "Action" category, and #1 for the "puzzle" category  for the whole catalog. Actually it's under-ranked at the moment, 'cause I advertised it a whole bunch at the start of the month which brought up the (#downloads) significantly thus moving my rank lower until the (#plays) evens out again from all the new players. By this time next week, I'll be back in the overall top 10 list.

AC1 is currently the most downloaded game on, and is at  #58 in the "Action" category. It's been that way for a couple months. AC2 doesn't do nearly as well as AC1, though I like it better, and it's still new

I have another game: "Attack Brain":
, but that was more of a side project I did to show a friend how to make mobile games. His favorite board game is "mastermind", so we re-made it.

I live in London, Ontario Canada. I'm not really looking for a better paying job, since I've only been doing the ad-game thing since September, and I can already bring in enough money to work from home and still pay the bills. Every game I put out brings in more money, so unless I see an amazing job I'm not likely to be enticed.
Offline OverKill

Junior Devvie

Java games rock!

« Reply #7 - Posted 2007-05-23 13:23:30 »

nice. Attack Chopter looks like a game for me. Smiley

For the life of me I cannot figure out to get the listing. Or are the categories done this way?
Funky Monkey was my last project at HandyGames.

Unfortunetly Canada is slightly off the map for people we are looking for.
Offline Hooble

Junior Newbie

I love YaBB 1G - SP1!

« Reply #8 - Posted 2007-05-24 00:35:51 »

The listings arn't numbered on the site. They are however completely ordered from left->right, top->bottom. #1 in top-left, #2,3, on top row, 4,5,6 next row etc..

This is a recent development. They only started ordering all the listings within the categories this way a month or so ago. Up until then they didn't have an automated way to rank the games. So any category you pick will have all the games listed in order, just not numbered.

I'd love to hear some feedback from a developer on any of my games. Please come and post on my messageboard:

I'm always updating it with my current progress, and asking for input from players, though it's a bit difficult getting others to post .
Offline OverKill

Junior Devvie

Java games rock!

« Reply #9 - Posted 2007-05-24 10:11:51 »

@People not commenting:
Might be because there is a problem with the registration.
I get a "It appears that you attempted to register for this forum using the wrong form. Please use the form below to register."

MIght have some ideas for future games.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Hooble

Junior Newbie

I love YaBB 1G - SP1!

« Reply #10 - Posted 2007-05-24 17:29:32 »

I had no idea that there might have been a problem with registration. Thanks for pointing that out. Unfortunately it's a free board (ProBoards), and I can't really fix any problems that pop up beyond the admin settings.

*EDIT* I had a go at creating a new user, and didn't have any trouble. Hmm, very puzzling.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

theagentd (12 views)
2015-03-27 23:08:20

wxwsk8er (53 views)
2015-03-20 15:39:46

Fairy Tailz (46 views)
2015-03-15 21:52:20

Olo (29 views)
2015-03-13 17:51:59

Olo (30 views)
2015-03-13 17:50:51

Olo (39 views)
2015-03-13 17:50:16

Olo (44 views)
2015-03-13 17:47:07

ClaasJG (57 views)
2015-03-10 11:36:42

ClaasJG (41 views)
2015-03-10 11:33:01

Pippogeek (49 views)
2015-03-05 14:36:23
How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27 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!