[android-developers] Question: are Math.getExponent and Math.scalb supported on Android?

2010-08-11 Thread Danke Xie
Hi,

As an experiment, I am trying to port a virtual machine written in
Java to Android platform. However, it heavily uses some special
floating point functions, like getting the exponent, or multiplying a
floating point by a power of 2. These are done with new Java Math
functions scalb and getExponent. It appears that they can be done by
manipulating the binary representation of the floating points.
However, because these functions don't seem to be available on Android
yet (are they?), all I could think of is implementing them with other
functions, like

public static float scalb(float f, int scaleFactor) {
  return f * Math.pow(2, scaleFactor);
}

public static int getExponent(float f) {
  return (int) (Math.log(f)/Math.log(2));
}

The question is... if the library doesn't have stock scalb and
getExponent functions, but the code is compiled with a new Java SDK
supporting the new math functions, could the Java compiler still
figure out a way to optimize these functions and operate on the binary
numeric level?

Thanks,
Danke

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Android VNC server

2010-08-04 Thread Danke Xie
Hi Anil,

In case you were asking how the server passed the options to the
client, this would be done by the libvncserver during the handshake.
Before starting the server, the file fbvncserver.c needed to
configure some options, and the resolution is obtained through an
ioctl call to the /dev/graphics/fb0 device. Please check if that was
an issue.

Thanks,
Danke

On Aug 3, 9:19 pm, Danke Xie danke@gmail.com wrote:
 Hi Anil,

 Thanks for the feedback. Because the client gets the resolution and
 color depths from the server, we probably don't need to set the
 resolution on the client (hopefully). I used several vnc clients, and
 they can all get the resolution from the server, so I haven't tried to
 force a specific resolution at the client (i could find out how to do
 so though). I guess if the client didn't get the right resolution/
 color depth, it may mean that the server didn't get them right either.
 Did you check the printout when the server starts up? Does it show the
 right resolution? If not, can you please turn on DEBUG and
 DEBUG_VERBOSE and send me the logs?

 Regards,
 Danke

 On Aug 2, 11:55 pm, Anil Sasidharan anil...@gmail.com wrote:



  Hi Danke,

                   Great job. I've pulled your sources and re-built with
  Android-eclair. I'm able to deploy and run the vnc server on my target
  board. However there is some incompatibility in terms of color/pixel depth
  between my target and host-PC and because of which the vncviewer shows
  garbled display. The configuration of the target platform's display is
  480x800 and 16bpp. Please provide some tips on what config options to be
  passed to  vncviewer.

  Warm Regards,
  Anil

  On Mon, Aug 2, 2010 at 12:49 AM, Danke Xie danke@gmail.com wrote:
   I put together a vnc server for Android. It is based on some existing
   source scattered around like fbvncserver.c, but didn't really work. I
   have fixed up a few issues like missing frames, keyboard and mouse
   input support, and made it a bit faster.

   Can anyone try it and give me some feedback on any issues that you may
   find? The source/doc is hosted onhttp://code.google.com/p/fastdroid-vnc/

   Thanks
   Danke

   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs
cr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Android VNC server

2010-08-03 Thread Danke Xie
Hi Anil,

Thanks for the feedback. Because the client gets the resolution and
color depths from the server, we probably don't need to set the
resolution on the client (hopefully). I used several vnc clients, and
they can all get the resolution from the server, so I haven't tried to
force a specific resolution at the client (i could find out how to do
so though). I guess if the client didn't get the right resolution/
color depth, it may mean that the server didn't get them right either.
Did you check the printout when the server starts up? Does it show the
right resolution? If not, can you please turn on DEBUG and
DEBUG_VERBOSE and send me the logs?

Regards,
Danke

On Aug 2, 11:55 pm, Anil Sasidharan anil...@gmail.com wrote:
 Hi Danke,

                  Great job. I've pulled your sources and re-built with
 Android-eclair. I'm able to deploy and run the vnc server on my target
 board. However there is some incompatibility in terms of color/pixel depth
 between my target and host-PC and because of which the vncviewer shows
 garbled display. The configuration of the target platform's display is
 480x800 and 16bpp. Please provide some tips on what config options to be
 passed to  vncviewer.

 Warm Regards,
 Anil



 On Mon, Aug 2, 2010 at 12:49 AM, Danke Xie danke@gmail.com wrote:
  I put together a vnc server for Android. It is based on some existing
  source scattered around like fbvncserver.c, but didn't really work. I
  have fixed up a few issues like missing frames, keyboard and mouse
  input support, and made it a bit faster.

  Can anyone try it and give me some feedback on any issues that you may
  find? The source/doc is hosted onhttp://code.google.com/p/fastdroid-vnc/

  Thanks
  Danke

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs 
  cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android VNC server

2010-08-02 Thread Danke Xie
I put together a vnc server for Android. It is based on some existing
source scattered around like fbvncserver.c, but didn't really work. I
have fixed up a few issues like missing frames, keyboard and mouse
input support, and made it a bit faster.

Can anyone try it and give me some feedback on any issues that you may
find? The source/doc is hosted on http://code.google.com/p/fastdroid-vnc/

Thanks
Danke

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en