I'm reading lots of bytes over bluetooth and it seems that my decoding part of my code is slower than the bluetooth receiving speed.
will buffered reader help in preventing overruns on my situation?
how would i implement using this read statement?
if((len = _port.read(_rec eiveBuffer, 0, length == -1 ? _receiveBuffer. length : length)) != 0)
thanks...
User Profile
Collapse
-
got it working nicely using the last method i discussed. it works like any other keyboard repeating. there is a delay when the timer is started. this provides some time before the repeating starts so that the timer can be canceled if the key is not held down. after the initial startup delay the timer rate kicks in and begins to send repeat commands at the rate programmed.
When you hold the key down on the keyboard there is no rapid...Leave a comment:
-
Yes. my application is sitting waiting for data to be received. I'm using bluetooth for communications so I have a bluetooth.liste ner waiting for events in my case data to come in through the port. I take the data which is some key codes and process it. the codes is usually 2 bytes indicating a down/up key position. using this info i post an event to push the appropriate character to the screen.
kinda fun seeing something occur. :-)...Leave a comment:
-
I'm using this bluetooth keyboard the ones made of fabric with the key membrane in side it. the device I'm using is "java based has api that allows background applications to post events. I guess its just like programming language used for windows to post keyboard events into whatever application is running in the foreground.
Really i can't say much technically because i'm not really a programmer. just started learning because...Leave a comment:
-
I think i figured out a way to control my time problem. learned that mytimer.cancel( ) will cancel mytimer and will not run anymore.
however, setting mytimer = null; will allow me to reschedule mytime for use again.
i've tested starting/stopping mytimer in the simulator without any crashes. My thinking is that by starting and stopping mytimer, i would know that the timer is always starting from time zero or whatever....Leave a comment:
-
sorry... i guess newbie is an overstatement.
so from the start I got this gift from a friend. a keyboard and i'm trying to make it work with my pda. The manufacture does not have a driver for my PDA so i started out on this grand idea of making one myself... Like i said its working I can type and post single keyboard character into my pda applications.
The problem i'm facing is adding repeating keys.
...Leave a comment:
-
Yes just as you described: {'b','e','t','t ','e','r'} i'm having a hard time controlling my repeat timer when I need to post a SINGLE character ex: {'b','e','t','t ','e','r','r'} . the code looks something like this:
protected void repeatTimer()
{
repeatTimer = new Timer();
updateTask = new TimerTask()
{
public void run()
{ ...Leave a comment:
-
using timers for repeating characters
programming newbie. I'm work on a program that post characters into foreground application. everything is working nicely except for repeating characters. I thought using a task timer was the way to go but it seems that as the JVM cleans its garbage the time tries to catchup therefore posting more cycles in it preset duty cycle.
any hints on using java to control repeating characters or tasks?
No activity results to display
Show More
Leave a comment: