liuzhipin / android-vnc

Automatically exported from code.google.com/p/android-vnc
GNU General Public License v2.0
0 stars 0 forks source link

Sending mose and keyboard event to real devece #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I install the server on real device. I use vnc client connect and it works
fine. I'm trying to send mouse and keyboard events to the device and
receive no indication for the events.

Should it work. What should I do to enable mouse and keyboard events?
Thanks,
Guy

Original issue reported on code.google.com by guy.ari...@gmail.com on 11 Aug 2009 at 10:56

GoogleCodeExporter commented 9 years ago
Please could you write, how you run it on real device, because, i haven't root 
right
for running vnc server in data directory(i don't want to root my phone, i'd 
like to
run server on phone like user). I ran it on emulator, and it works fine, but I 
can't
handle mouse and keyboard events, please write me how????

Original comment by havlenap...@gmail.com on 2 Sep 2009 at 8:20

GoogleCodeExporter commented 9 years ago
I'm using it with root access device.

Original comment by guy.ari...@gmail.com on 2 Sep 2009 at 8:59

GoogleCodeExporter commented 9 years ago
hi, i have one more question. I am compiling vnc server and I will call them 
from
Java (i am using NDK), so It should work on not root access phone. But i have 
this
errors:
out/apps/VNCServer/android-1.5-arm/objs/VNCServer/VNCServer.o: In function
`init_fb_server':
sources/samples/VNCServer/VNCServer.c:151: undefined reference to `rfbGetScreen'
sources/samples/VNCServer/VNCServer.c:163: undefined reference to
`rfbInitServerWithPthreadsAndZRLE'
sources/samples/VNCServer/VNCServer.c:166: undefined reference to 
`rfbMarkRectAsModified'
out/apps/VNCServer/android-1.5-arm/objs/VNCServer/VNCServer.o: In function 
`start':
sources/samples/VNCServer/VNCServer.c:462: undefined reference to 
`rfbProcessEvents'
out/apps/VNCServer/android-1.5-arm/objs/VNCServer/VNCServer.o: In function
`update_screen':
sources/samples/VNCServer/VNCServer.c:434: undefined reference to 
`rfbMarkRectAsModified'
sources/samples/VNCServer/VNCServer.c:437: undefined reference to 
`rfbProcessEvents'
out/apps/VNCServer/android-1.5-arm/objs/VNCServer/VNCServer.o: In function 
`start':
sources/samples/VNCServer/VNCServer.c:460: undefined reference to 
`rfbProcessEvents'
collect2: ld returned 1 exit status
make: *** [out/apps/VNCServer/android-1.5-arm/libVNCServer.so] Error 1

it looks like some lib doesn't link and i can't find any rfb lib in 
LibVncServer dir,
i have latest version of LibVncServer (0.9.7) 

Original comment by havlenap...@gmail.com on 7 Sep 2009 at 7:38

GoogleCodeExporter commented 9 years ago
so i figured out how to run fbvncserver on non rooted real device, but i still 
don't
know how to send keyboard and mouse events to real device?? Did you solved it?

Original comment by havlenap...@gmail.com on 7 Sep 2009 at 11:30

GoogleCodeExporter commented 9 years ago
Same for me - am running fbvncserver on a rooted T-Mobile G1.  I can connect 
and 
view the phone over my subnet with a RealVNC client in Windows, but cannot send 
keyboard or mouse events.  I would be glad to assist in testing any possible 
solutions.

Original comment by pator...@gmail.com on 14 Sep 2009 at 1:04

GoogleCodeExporter commented 9 years ago
now i know how you can, you must comiple your own android core, or just download
image from this page and you must boot this image on your phone. In android 
core on
your phone you have blocked receiving keyboard and mouse events.

Original comment by havlenap...@gmail.com on 15 Sep 2009 at 10:56

GoogleCodeExporter commented 9 years ago
aaaaaaaaaah.  Thanks havlenapetr.  Any tips on where to go to learn more about 
where 
to make the changes in the core before compiling?

Original comment by friendsw...@hotmail.com on 15 Sep 2009 at 1:43

GoogleCodeExporter commented 9 years ago
I think, that you only must download image from this page (go to downloads and
download zImage). Author of this android-vnc server did this for us. If you 
download
src folder of this project in Readme file you will find manual for compiling 
your own
android core with enabled KBDE (mouse keyboard events), if you want to do it 
yourself.
Here is manual from Readme file:

//------------------------------------------------------------------------------
----
1) Download the ARM GNU/Linux cross-compile toolkit from:

http://www.codesourcery.com/gnu_toolchains/arm/download.html

Install according to the instructions there.

2) Install libvncserver:

./configure --host=arm-none-linux-gnueabi --without-pthread 
--prefix=/opt/android
make
sudo make install

3) Build a custom Android kernel using kbde.c, provided in the kernel directory
of this project:

Unpack linux-2.6.23-android-m3-rc20.tar.gz.
cd kernel
patch -p1 < ../android-vnc/kernel/linux-2.6.23-android-m3-rc20-kbde.patch
adb pull /proc/config.gz . && gunzip config.gz && mv config .config
make menuconfig
[ ... enable KBDE under Drivers, Input device support, Keyboards ... ]
CROSS_COMPILE=/opt/android/arm-2007q3/bin/arm-none-linux-gnueabi- make

To boot the kernel:

emulator -kernel arch/arm/boot/zImage

For further reading, see:
http://honeypod.blogspot.com/2007/12/compile-android-kernel-from-source.html

4) Build and install this project:

./configure --host=arm-none-linux-gnueabi --with-libvncserver=/opt/android
make

(NOTE: You can ignore the warning about gethostbyname being statically linked.)

adb push src/fbvncserver /data
adb shell /data/fbvncserver

5) Redirect Android ports:

telnet localhost 5554
redir add tcp:5900:5901

(NOTE: The fbvncserver by default binds port 5901, not 5900!  Android already
has a VNC server running on port 5900, but it sucks.)

6) Connect from localhost:

xvncviewer -noauto localhost

(NOTE: Additional steps are required to connect externally, since Android's
port redirection works only for the local interface).

Original comment by havlenap...@gmail.com on 16 Sep 2009 at 12:18

GoogleCodeExporter commented 9 years ago
try it on emulator first!!

Original comment by havlenap...@gmail.com on 16 Sep 2009 at 12:21

GoogleCodeExporter commented 9 years ago
Thank you havlenapetr!  Excellent post and very helpful to the community.

Original comment by friendsw...@hotmail.com on 16 Sep 2009 at 1:12

GoogleCodeExporter commented 9 years ago
Hi havlenapetr, how did u managed to get rid of errors that are coming when  
called
them fromJava (i am using NDK), not root access phone. 

And how to add rfb lib in LibVncServer dir.

Original comment by usb...@gmail.com on 21 Jan 2010 at 6:37

GoogleCodeExporter commented 9 years ago
Hi havlenapetr, I have a similar question. How did you make NDK work? Did you 
just 
locate pre-installed (/data/fbvncserver) file and tell NDK to execute it? Or 
did you 
compile entire 'fbvncserver' as '.so' file in NDK and ran it?

Original comment by joshuapark82@gmail.com on 8 Feb 2010 at 8:38