Author Topic: Java/ J2ME mobile orbiter  (Read 312538 times)

niz23

  • Guru
  • ****
  • Posts: 361
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #225 on: November 26, 2008, 03:15:13 pm »
sambuca.
I did some tweaks to the JavaMO code a few days ago.
* Changed image quality
 It seems that transferring a 100k + image over bluetooth takes too much time. Changing the image quality setting from 100 (png) to 30 radically improved responsiveness. Image size is now below 10k, and usually around 6k.
* Added quite a bit of logging
 Trying to work out the mysterious crashes and malfunctions of the JavaMO on my phone, I added more logging to find out where the problem is.
* Some more exception handling.
 Sometimes the JavaMO just quits on my phone. I suspect that some major unhandled exception causes this. I am trying to add handling and logging to work out this problem.
* Added a explicit exit button to the media list, as my phone had no way of returning from the media list.

Still to do (from a stability perspective):
* Debug the media list
  My phone shows no text for the audio list entries (the last entry has text), while other lists (pictures for instance) shows the texts correctly.
* Debug the connection stuff, to find out what makes the MO crash and/or drop the connection.

I don't feel that I am finished by any means, but if someone is interested in testing this version of the JavaMO, I can put it up for download.
Not sure if it will work on more phones, but the improvement in responsiveness might help a bit, and the extended logging might give us a better idea of what the problem might be.

I can also make a patch for the current SVN tree. Hari, can you comment on how (and when) you would like a patch?

I will continue working on the stability of the mo, and maybe some of the other issues mentioned here if I get the time. The repeated key presses might be the next thing on my list, but my primary goal is making it usable first. (What are the repeated key presses for anyway?)

br,
sambuca


Im interesting in testing this new version.
JavaMO is pretty stable on an SE P1i. No sudden crashes or so. At least not up until now.

Where can I get it?

/niz23

sp00nhead

  • Veteran
  • ***
  • Posts: 69
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #226 on: November 26, 2008, 03:22:27 pm »
I've got a Nokia 6500 slide i can test it on too

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #227 on: November 26, 2008, 03:43:41 pm »
You can download my modified version from http://hob.dyndns.org/javamo/. Just point your mobile browser to the JavaMO.jad file and it should download and install. Depending on your phone you will have to confirm the installation.

niz32, do you think the P1 is faster Java-wise than other phones? I think the Java speed might be a factor in the random crashes, since did not crash as much when it worked much better when I reduced image quality.

On a general note: This version does display more logging messages to start-up screen. While I probably will look into debugging my Sony Ericsson phone using a method similar to what hari described on the wiki, I think it might be useful to get some feedback from other phones without the users needing to set up any debugging.

niz23

  • Guru
  • ****
  • Posts: 361
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #228 on: November 26, 2008, 03:57:25 pm »
sambuca.
You can download my modified version from http://hob.dyndns.org/javamo/. Just point your mobile browser to the JavaMO.jad file and it should download and install. Depending on your phone you will have to confirm the installation.

niz32, do you think the P1 is faster Java-wise than other phones? I think the Java speed might be a factor in the random crashes, since did not crash as much when it worked much better when I reduced image quality.

On a general note: This version does display more logging messages to start-up screen. While I probably will look into debugging my Sony Ericsson phone using a method similar to what hari described on the wiki, I think it might be useful to get some feedback from other phones without the users needing to set up any debugging.


Don´t know. Will get back to you on how its feeling now.
Haven´t used it for several month, though.

/niz23

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #229 on: November 26, 2008, 04:06:17 pm »
sambuca, wanted to say, thank you for your help on this. It's nice to see hackers starting to come in and help us flesh out the pieces.

*smile*

-Thom

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #230 on: November 26, 2008, 04:26:50 pm »
I should really thank you all for this great system.

That said, I hope I am able to contribute more in the future. Just figured this was a good starting point.

sambuca

niz23

  • Guru
  • ****
  • Posts: 361
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #231 on: November 26, 2008, 08:03:49 pm »
sambuca.

I had to edit CLDC-1  to read CLDC-1.1
Otherwise my P1i complained (inompatible application).

Get back to you after I have done some tests.

/niz23

niz23

  • Guru
  • ****
  • Posts: 361
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #232 on: November 26, 2008, 08:47:53 pm »
sambuca.

It work pretty well now.
Very responsive, compared to previous versions.

For a SE P1i there is no need to patch libBDCommon.so which is a big pro.

There are still problems with connecting to lmce from the phone.
Sometimes it just not work (Waiting for connection).
This problem have nothing to do with libBDCommon, patched or not.
Have tried this before so. It is something else.

Things that do not work:
* Media list only show text. Which is not to bad. Maybe that is the way forward and just add some graphics around it so it look nicer. Instead of shuffling images between phone and core.

*Pause/Play button do not work when playing video. (have not tested audio yet).

*Do not seem to reconnect to core if router is reloaded. However there is debug output when it happen (disconnect is shown on screen with some more text). This probably mean that javamo detect when it is offline so if we handle that...

Gonna do more tests tomorrow an see if audio work as expected.

Let me know how I can help.



/niz23

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #233 on: November 26, 2008, 10:17:36 pm »
I had to edit CLDC-1  to read CLDC-1.1
Otherwise my P1i complained (inompatible application).

Oops, I probably mis-edited the jad file.

There are still problems with connecting to lmce from the phone.
Sometimes it just not work (Waiting for connection).
This problem have nothing to do with libBDCommon, patched or not.
Have tried this before so. It is something else.
Maybe the bluetooth_dongle log file can shed some light on this? As the JavaMO is just listening for incoming connections, I am not sure we can do anything to help the situation from this side.

Things that do not work:
* Media list only show text. Which is not to bad. Maybe that is the way forward and just add some graphics around it so it look nicer. Instead of shuffling images between phone and core.
The media list uses the phones default list implementation, so there is limited possibilities to change it. This, I guess, is to save data transfer. But it is possible to use an image for each item in the list (a small image on the left of the text I think). This might require some changes to the bluetooth_dongle to send the images, and of course would require much more data transferred. Our best chance would be to first display the list, and them add images to the list as they are transferred. I fear this is too much work to implement and would be dead slow (my 600+ list of artists already takes 5 seconds + to display).

*Pause/Play button do not work when playing video. (have not tested audio yet).
Can you check the bluetooth_dongle log file, and see if the button press is received from the phone?

*Do not seem to reconnect to core if router is reloaded. However there is debug output when it happen (disconnect is shown on screen with some more text). This probably mean that javamo detect when it is offline so if we handle that...
Don't know if the JavaMO receives any notification about router reload. But anyway, I am trying to make it survive bluetooth reconnects, so this would probably help.

Another thing I remember that I changed in this version; Because the image transfer took so long, the screen saver kicks in, thus I wont see when the image was finally loaded. I added some code to flash the display to hopefully turn it on again. Let me know if it is for the better or worse.

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Java/ J2ME mobile orbiter
« Reply #234 on: November 26, 2008, 10:22:26 pm »
Things that do not work:
* Media list only show text. Which is not to bad. Maybe that is the way forward and just add some graphics around it so it look nicer. Instead of shuffling images between phone and core.
The media list uses the phones default list implementation, so there is limited possibilities to change it. This, I guess, is to save data transfer. But it is possible to use an image for each item in the list (a small image on the left of the text I think). This might require some changes to the bluetooth_dongle to send the images, and of course would require much more data transferred. Our best chance would be to first display the list, and them add images to the list as they are transferred. I fear this is too much work to implement and would be dead slow (my 600+ list of artists already takes 5 seconds + to display).
regarding TSCHAK datagrids will be rendered even by the Bluetooth_Dongle orbiter instance when they are bigger than one row. So this would be worth checking with the designer.

Quote
*Do not seem to reconnect to core if router is reloaded. However there is debug output when it happen (disconnect is shown on screen with some more text). This probably mean that javamo detect when it is offline so if we handle that...
Don't know if the JavaMO receives any notification about router reload. But anyway, I am trying to make it survive bluetooth reconnects, so this would probably help.
I fixed an exception regarding that lately. Bascially I tried to still send stuff when the socket was already down and did not catch the exception. Dunno if there is something else to fix, as I have not really tested this.

br, Hari
rock your home - http://www.agocontrol.com home automation

niz23

  • Guru
  • ****
  • Posts: 361
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #235 on: November 27, 2008, 07:56:05 pm »
sambuca.

When I hit play/pause button when watching/listening to media the following is written into bluetooth log file,

05      11/27/08 19:38:59.676           Ready to send a picture, size 8539, reporting signal strength 0 <0xb4018b90>
01      11/27/08 19:39:05.675           Current screen: 2165.0.0 <0xb4018b90>
05      11/27/08 19:39:05.676           Repeated keys list 31,30:  <0xb4018b90>
05      11/27/08 19:39:05.676           Ready to send a picture, size 8539, reporting signal strength 0 <0xb4018b90>
05      11/27/08 19:39:08.528           Received BD_PC_MouseEvent from PlutoMO. <0xb5066b90>
05      11/27/08 19:39:10.296           Inquiry complete
 <0xb6869b90>
05      11/27/08 19:39:10.297           Inquiry started <0xb6869b90>
01      11/27/08 19:39:11.676           Current screen: 2165.0.0 <0xb4018b90>
05      11/27/08 19:39:11.676           Repeated keys list 31,30:  <0xb4018b90>
05      11/27/08 19:39:11.676           Ready to send a picture, size 8539, reporting signal strength 0 <0xb4018b90>


when clicking on any of the main items like lights, media etc.
Everytime I back out back to main menu with C och if I click on the screen there is a big red F on top of media icon if that was the category I used last.

Playing audio I have manged to skip song twice.
But havent figured out a way to reproduce. Button work sometimes and sometimes not.

hehe. Found a way to make it work now.
I can skip songs by wating for the keylock to kick in. then unlock the phone.
After that I can skip song one or two times.
have to wait for the kelock to kick in again. And repeat.
Above does not work all the time, around 85% of the times I try it work.

Question is. Can we disable the keylock from javamo when it is running?

/niz23

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #236 on: November 28, 2008, 11:02:12 am »
niz23

I guess the phone you are using (SE P1?) has a touch screen, since your log reports mouse events. I haven't looked at the bluetooth dongle side of things (yet), so I can't really say why it only works sometimes. Maybe someone with more knowledge of the BD can comment? Or maybe anyone that uses another touch screen phone can try it out too?

Haven't had as much time to work on this as I would have liked, but I have looked into optimizing the performance more. Anyone who has done similar knows it can be a pain. Which is how it is now. There are some buffer copies in the code that I am trying to take out, but I must have messed up cause now it wont display anything any more. I'll keep looking. I hope to have it sorted out and cleaned up enough to make a patch for hari maybe next week.

hari, when you say that repeated keypresses are not implemented, is that in the JavaMO, or in the BD library?

sambuca

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Java/ J2ME mobile orbiter
« Reply #237 on: November 28, 2008, 12:43:44 pm »
I guess the phone you are using (SE P1?) has a touch screen, since your log reports mouse events. I haven't looked at the bluetooth dongle side of things (yet), so I can't really say why it only works sometimes. Maybe someone with more knowledge of the BD can comment? Or maybe anyone that uses another touch screen phone can try it out too?
I just report the mouse events back over BD when i receive them from the canvas.

Quote
hari, when you say that repeated keypresses are not implemented, is that in the JavaMO, or in the BD library?
in JavaMO, there are already "traces" of code for that. BD only wants one repeated event, but the canvas sends multiple as long as the key is pressed. This just needs to be filtered on the JavaMO side.

br, Hari
rock your home - http://www.agocontrol.com home automation

crudpuppy

  • Newbie
  • *
  • Posts: 10
  • Hitec Redneck
    • View Profile
    • Infinifire - Freelance Web development
Re: Java/ J2ME mobile orbiter
« Reply #238 on: November 28, 2008, 08:34:03 pm »
Hey guys,

I'm a bit rusty as I havent touched java in about 1.5 years but did j2ee for 6+ so figured I'd play around a bit.  I know hari is more or less too crunched to get more done on this but is sambuca working on it?  If so could I get a copy of your current work set?  Or the one for the last jad you did with the noted improvements...

I've not done much mobile development(mostly web stuff for me) but was wondering about a more robust system using maybe jsr75(which would mean probably only smart phones) to not only do logging but allow config files etc to be read/written.

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Java/ J2ME mobile orbiter
« Reply #239 on: November 28, 2008, 08:38:10 pm »
last time when i've checked jsr075 support was not widely deployed. Plenty of mobiles support on device debugging, that is maybe the better approach. This should also help finishing the missing BD commands, they are not all handled.

best regards,
Hari
rock your home - http://www.agocontrol.com home automation