[NDK App and Java App] Working on a new VNC Server V1.86

Search This thread

knoxbrder

Senior Member
Jan 10, 2009
338
79
** You need to have root to run this app! **

I have been hacking up a vnc server from old code I found on Google. I will try to get the changes merged into the original project; if that fails I will start a new project or just post the source.
This one works with my rooted Transformer Prime, a rooted Galaxy S2 and a CyanogenMod Nexus One perfectly. On a non-rooted Galaxy S2 everything works except the mouse/touch.

This uses the new Screenshot code for Android and either the "uinput" user space input device, the "input" command line tool to send keys, or direct access to the Linux keyboard device. It uses either the "uinput" user space input device if specified for the keyboard or the Linux touch device / mousepad device (like on my Prime).

I have been pushing the NDK app to /data/local/vncs using adb.
Open an "adb shell" or local connectbot session. cd /data/local. and then a command like below:

Try this first:
./vncs

galaxy s2 has no mouse pointer: (touch won't work without root)
./vncs -t /dev/input/event2 -s -g -x 480 -y 800

galaxy nexus has no mouse pointer: (touch won't work without root)
./vncs -t /dev/input/event1 -s -n -x ? -y ? (I don't know the values for the nexus touch size or if it auto detects)

prime with keyboard has visible mouse pointer: (rooted ICS)
./vncs -t /dev/input/event5

prime without keyboard has no mouse pointer: (rooted ICS)
./vncs -t /dev/input/event3

nexus one with cyanogenmod: (rooted Gingerbread)
./vncs -t /dev/input/event3

local Escape key is "back" on remote Android device
local Windows or Home key is "home" on remote Android device
local F1 or Menu or Pg-Up key is "menu" on remote Android device
local F6 key is "camera" on some devices (not all)
local Pg-Dn key is "call" on some devices (not all)
local End key is "end call" and/or power on/off
local Alt-o / Alt-i is "power off/on" on some devices
local Alt-u is "volume up" on some devices
local Alt-d is "volume down" on some devices

Press F2 or Alt-p to pause/resume screen refresh. This is great for watching videos on the TV. If you don't disable the remote refresh then the video will jerk because of the screenshots being taken.
If you have a Prime with the keyboard then you can use the mouse pointer version and see what you are clicking on even with screen refresh off.

Press F4 or Alt-r to rotate the screen 90 degrees. 0,90,180,270 then back to 0. The connection disconnects for now so you will need to reconnect again. To keep reconnecting, in a shell on my laptop I use "while :; do vncviewer 192.168.0.5:1; sleep 1; done".

Press F3 or Alt-s to change the scaling, normal, half, quarter then back to normal. The connection disconnects for now so you will need to reconnect again. To keep reconnecting, in a shell on my laptop I use "while :; do vncviewer 192.168.0.5:1; sleep 1; done".

Press Alt-q to close the connection from the server side. It can be opened again from the client.

I haven't tested on many other devices yet. Let me know of failures or successes!

Command line switches on the server:
-h show help
-s swap red/blue colors
-g galaxy s2 touchscreen
-n galaxy nexus touchscreen
-x touchscreen maximim x
-y touchscreen maximim y
-r rotate mode 0,1,2,3 = 0,90,180,270 degrees, default is 0
-T touchscreen pointer rotate offset, 0-3=0,90,180,270, default is 0 (same rotation as screen)
-m magnification 1/m, 1=fullsize, 2=half size, 4=quarter size
-t touch device
-k keyboard device, default is uinput command
-p : password, default is none
-d : delay between events, default is 300000
-P : port, default is 5901
-32 32bpp; default is 32 for snapshot, 16 for framebuffer
-16 16bpp; default is 32 for snapshot, 16 for framebuffer
-o hack to send touch events on non-rooted device
-c red offset, red length, green offset, green length, blue offset, blue length; defaults 16,8,8,8,8,0
-R connect to remote host:remote port
-a average when scaling (slower but better looking)
-C reconnect to listener if connection dropped

Version 1.86

---------------------------------------
Version 1.86 includes many new features such as connect to remote vnc listener, deliver VNC Java client on port 5800+, average pixels when scaling, touchscreen pointer rotation offset and generic color sequence settings (needed for some devices).
If all connected clients support it then size and rotation are updated without disconnecting the client; if any client doesn't support it, then all clients are disconnected as it worked previously. Normally not a problem since most people only connect to a device with one client at a time.

Connect to your device from a java enabled web browser with something like http://192.168.0.8:5801 if your normal port is 5901. The downloaded jar supports most things the standalone vnc clients support.

---------------------------------------
Version 1.86 includes a Java Control App as well.
It has the NDK app included in it so you only need to download the standalone exe if you don't want the Java App. The Java App extracts the NDK App when it runs and keeps it in its own Android directory structure (not in /data/local anymore).

The GUI is now compiled for Android 2.2+ and now includes two desktop widgets: 1x1 and 4x1 and an option to turn on a notification that shows the current server status and a start/stop button. Notification icon and widgets change icon to give visual indication when the server is running.

Custom Launchers and other apps can call activities to start/stop the server.
Tasker Action Intent setup:
Action: com.mrk2012.android.preferences.START (or STOP)
Cat: Launcher
Target: Broadcast Receiver

For instance, I have my phone setup to start the server when I place it in the dock or connect power.

I found/fixed a small bug with the refresh code, hopefully that will a) keep the widgets/notifications updating unless you stopped them from the menu and b) fix the "VNCPrefs has Stopped" display.

** You need to have root to run this app! **

You can configure everything from the Java GUI. Check out the About/Help menu option to see the list of special keys and their functions.
Also look in the Help section for a quick guide on how to configure the options for different types of devices. Post if you find some more working or not working devices.

---------------------------------------
Todo:
+ done: scale viewer
+ done: switch between portrait/landscape in viewer
+ done: launch/control from gui
+ create generic option for specifying pointer setup so anyone can add a new device (superseded by using uinput)
+ fix input on undocked Prime (fixed with uinput)
+ add a way to start/stop the server from an email, sms or google voice
+ http server/applet
- upgrade to latest vnc server library/applet
- ctrl key (for connectbot mainly)

Prime specifc keys:
- page up/down keys
- home/end keys
- insert/delete keys
- media/volume keys
- other prime hard keys: wireless/mouse/bluetooth/contrast/camera/etc
 

Attachments

  • vnclauncher.apk
    274.2 KB · Views: 3,538
  • vncs.zip
    189.9 KB · Views: 2,902
Last edited:

glenn85

New member
Nov 18, 2007
3
1
Rotterdam
I'm trying this on my rooted Galaxy Nexus (4.0.2) using connectbot, but I keep on getting "cannot execute - Permission denied" even though I'm using superuser prompt.

EDIT: I forgot to set permissions to the file, it works now, although the framerate seems a bit low and the colors are inverted...
 
Last edited:

knoxbrder

Senior Member
Jan 10, 2009
338
79
I only get a couple frames per second. I don't think the snapshot code is very fast.

Try the command line switch -s to swap the red/blue colors.
-h shows all the options.
 
  • Like
Reactions: glenn85

glenn85

New member
Nov 18, 2007
3
1
Rotterdam
The -s switch does the trick with the inverted colors. Unfortunately I can not get keyboard and mouse input to work.
About the low framerate, I can see that "surfaceflinger" is taking up a lot of cpu usage when I start vncs, maybe that has something to do with it...

Please keep up the good work, I really like it already!
 
  • Like
Reactions: magnetboard

knoxbrder

Senior Member
Jan 10, 2009
338
79
Did you try the -g option for the pointer? That format is what the Galaxy S2 uses. The Nexus may be the same.

If that doesn't help, read on.....

Since your device is rooted, do you have busybox installed?

If so, can you post the output of "which input"? I currently use that program to inject the keys and I have found it to work on several devices although it is a bit slow.

For the pointer, try using the -t option to specify different /dev/input/eventX options where X is usually 0 - 6. An "ls -l /dev/input/" will show you which ones are available. Different phones/tablets use different event devices and I haven't tried to figure out how to auto detect which is which.

If you run something like "od -x /dev/input/eventX", where X is 0 - 7, and touch the touchscreen you should get output on the one the touchscreen uses.

If you find the right -t option by using od, but still can't get the mouse to work over VNC, post the output of this:
- run "od -x /dev/input/event3" (or whichever event file works for you)
- carefully touch/release the screen as quickly as possible so you get one or two "touch" events outputting from the od command
- post the values (I would do this over adb so you can copy/past the output)

I will look at the output to see how it differs from the devices I have tested.
 

jdbower

Senior Member
Apr 24, 2011
55
10
Massachusetts
www.ebower.com
Also running a Galaxy Nexus with 4.0.2 (VZW, deodexed but otherwise stock ROM, rooted [as all Nexus devices should be]). The -s fixed the color inversion, with or without -g I can't use the touch or keyboard input (although I wasn't thorough about keyboard testing).

I would like to request a scaling factor or allowing 90 degree rotation since the 1280 pixel vertical resolution exceeds my 1080p monitor, but that's pretty minor as of now.

Code:
# which input
/system/bin/input

It looks like the touchscreen is actually on event1:
Code:
root@android:/ # od -x /dev/input/event1                                       
0000000     00d2    0000    0f70    0001    0003    0039    001e    0000
0000020     00d2    0000    0f70    0001    0003    0030    000e    0000
0000040     00d2    0000    0f8f    0001    0003    003a    0081    0000
0000060     00d2    0000    0f8f    0001    0003    0035    01ca    0000
0000100     00d2    0000    0f8f    0001    0003    0036    0120    0000
0000120     00d2    0000    0fad    0001    0000    0000    0000    0000
0000140     00d2    0000    2d5c    0001    0003    0039    ffff    ffff
0000160     00d2    0000    2d5c    0001    0000    0000    0000    0000

Here are the input devices:
Code:
# ls /dev/input
event0
event1
event2
event3
event4
event5
mice

Thanks for your work on this, I really miss having a VNC server on my phone!
 

knoxbrder

Senior Member
Jan 10, 2009
338
79
New Version 1.1 up; see first post.
Added scaling and rotation.
Tweaked the input handling.

For Galaxy S2 try ./vncs -t /dev/input/event2 -s -g -x 480 -y 800.
Other devices let me know if this version works better.
 

glenn85

New member
Nov 18, 2007
3
1
Rotterdam
The touchscreen indeed seems to be on event1. So I tried the following commands:
./vncs -t /dev/input/event1 -s -g -x 720 -y 1280
./vncs -t /dev/input/event1 -s

But mouse input still doesn't work, unfortunately.
I also found out when the phone goes to stand-by mode while running vncs, the touchscreen stops working at all. Had to take out my battery to restart the phone...
 
Last edited:

knoxbrder

Senior Member
Jan 10, 2009
338
79
I forgot to actually attach the new version.
Check -h when you run it to make sure it says version 1.1.

See if this fixes the event problem.

I have never seen the device hang when it goes to sleep.
I will see if I can reproduce that.
 

knoxbrder

Senior Member
Jan 10, 2009
338
79
jdbower:
Please try to capture a couple more touchscreen presses. I don't think there is enough information in your previous log.
I see the headers, and x/y movement. But I'm not sure I see the actual "finger down/release". Or I don't understand it.

Thanks
 

jdbower

Senior Member
Apr 24, 2011
55
10
Massachusetts
www.ebower.com
This was a quick tap on the home screen:

Code:
# od -x /dev/input/event1                                       
0000000     0521    0000    13ee    000a    0003    0039    000c    0000
0000020     0521    0000    140c    000a    0003    0030    000b    0000
0000040     0521    0000    140c    000a    0003    003a    006e    0000
0000060     0521    0000    142b    000a    0003    0035    014d    0000
0000100     0521    0000    142b    000a    0003    0036    02e1    0000
0000120     0521    0000    142b    000a    0000    0000    0000    0000
0000140     0521    0000    5afa    000a    0003    0039    ffff    ffff
0000160     0521    0000    5b18    000a    0000    0000    0000    0000

And another:
Code:
# od -x /dev/input/event1                                   
0000000     0549    0000    a50e    0005    0003    0039    000d    0000
0000020     0549    0000    a52d    0005    0003    0030    000e    0000
0000040     0549    0000    a52d    0005    0003    003a    008f    0000
0000060     0549    0000    a52d    0005    0003    0035    0218    0000
0000100     0549    0000    a54b    0005    0003    0036    02f1    0000
0000120     0549    0000    a54b    0005    0000    0000    0000    0000
0000140     0549    0000    c280    0005    0003    0039    ffff    ffff
0000160     0549    0000    c29e    0005    0000    0000    0000    0000

And a swipe in case it helps:
Code:
# od -x /dev/input/event1                                   
0000000     0572    0000    3e50    000d    0003    0039    000e    0000
0000020     0572    0000    3e6e    000d    0003    003a    0079    0000
0000040     0572    0000    3e6e    000d    0003    0035    00f3    0000
0000060     0572    0000    3e8d    000d    0003    0036    02dd    0000
0000100     0572    0000    3e8d    000d    0000    0000    0000    0000
0000120     0572    0000    63fb    000d    0003    003a    007c    0000
0000140     0572    0000    6438    000d    0003    0035    0101    0000
0000160     0572    0000    6438    000d    0003    0036    02db    0000
0000200     0572    0000    6438    000d    0000    0000    0000    0000
0000220     0572    0000    88d1    000d    0003    003a    007e    0000
0000240     0572    0000    88d1    000d    0003    0035    011f    0000
0000260     0572    0000    88d1    000d    0003    0036    02d8    0000
0000300     0572    0000    88f0    000d    0000    0000    0000    0000
0000320     0572    0000    ada7    000d    0003    003a    007f    0000
0000340     0572    0000    adc6    000d    0003    0035    0148    0000
0000360     0572    0000    adc6    000d    0003    0036    02d5    0000
0000400     0572    0000    adc6    000d    0000    0000    0000    0000
0000420     0572    0000    d484    000d    0003    003a    0080    0000
0000440     0572    0000    d484    000d    0003    0035    0178    0000
0000460     0572    0000    d484    000d    0003    0036    02d2    0000
0000500     0572    0000    d4a3    000d    0000    0000    0000    0000
0000520     0572    0000    f91d    000d    0003    003a    0081    0000
0000540     0572    0000    f91d    000d    0003    0035    01a8    0000
0000560     0572    0000    f91d    000d    0003    0036    02ce    0000
0000600     0572    0000    f93b    000d    0000    0000    0000    0000
0000620     0572    0000    1e11    000e    0003    003a    0082    0000
0000640     0572    0000    1e30    000e    0003    0035    01d9    0000
0000660     0572    0000    1e30    000e    0003    0036    02cc    0000
0000700     0572    0000    1e30    000e    0000    0000    0000    0000
0000720     0572    0000    426d    000e    0003    003a    0081    0000
0000740     0572    0000    426d    000e    0003    0035    0207    0000
0000760     0572    0000    426d    000e    0003    0036    02cb    0000
0001000     0572    0000    426d    000e    0000    0000    0000    0000
0001020     0572    0000    6780    000e    0003    003a    007a    0000
0001040     0572    0000    6780    000e    0003    0035    0233    0000
0001060     0572    0000    679f    000e    0000    0000    0000    0000
0001100     0572    0000    8c75    000e    0003    003a    0050    0000
0001120     0572    0000    8c75    000e    0003    0035    0262    0000
0001140     0572    0000    8c75    000e    0003    0036    02cc    0000
0001160     0572    0000    8c75    000e    0000    0000    0000    0000
0001200     0572    0000    affb    000e    0003    0039    ffff    ffff
0001220     0572    0000    affb    000e    0000    0000    0000    0000

Let me know if there's anything else I can provide. Thanks!
 

knoxbrder

Senior Member
Jan 10, 2009
338
79
Just taking a stab in the dark with 1.2 for the nexus since I don't know anyone nearby who has one.

If it doesn't work, try running the od command while using vnc so I can compare the output with what it should be.
 

jdbower

Senior Member
Apr 24, 2011
55
10
Massachusetts
www.ebower.com
Here's the output of a click on the VNC window with -g:

Code:
# od -x /dev/input/event1                                   
0000000     00e4    0000    0786    0008    0000    0002    0000    0000
0000020     00e4    0000    07a5    0008    0000    0000    0000    0000
0000040     00e4    0000    07e2    0008    0000    0002    0000    0000
0000060     00e4    0000    07e2    0008    0000    0000    0000    0000
0000100     00e4    0000    07e2    0008    0000    0002    0000    0000
0000120     00e4    0000    07e2    0008    0000    0000    0000    0000

And without -g:
Code:
# od -x /dev/input/event1                                   
0000000     0144    0000    47d8    000b    0000    0002    0000    0000
0000020     0144    0000    47f6    000b    0000    0000    0000    0000
0000040     0144    0000    49fd    000b    0000    0002    0000    0000
0000060     0144    0000    4a1c    000b    0000    0000    0000    0000
0000100     0144    0000    4c41    000b    0000    0002    0000    0000
0000120     0144    0000    4c41    000b    0000    0000    0000    0000

Note that there's a pretty long delay between the click and the response, on the order of 5 seconds.

I'm not sure exactly what I'm reading, but it seems like lifting my finger from the screen produces ffff ffff in the second to last value, it seems like this is missing from the VNC mouseclick.

For whatever reason, the lockup behavior seems much worse with this build. The od command still shows response to touches, but the phone doesn't respond.

Hope this helps!
 

knoxbrder

Senior Member
Jan 10, 2009
338
79
I forgot to tell you (it says in the -h) to use -n instead of -g for the Nexus.

I slowed the events down since they actually lag on my GS2 quite a bit.
I can turn that off it it makes the GN worse.

Maybe we can look at it this weekend if its still not working.
 

knoxbrder

Senior Member
Jan 10, 2009
338
79
At the moment there is no java gui to start/stop the program.

You need to start it from a shell prompt using adb or something like connectbot.

If you are not familiar with these methods of program control you might want to wait another week or two until I have time to put together a GUI or merge it back into another program that already has a GUI.
 

jdbower

Senior Member
Apr 24, 2011
55
10
Massachusetts
www.ebower.com
Sorry, I didn't see the -n option in the help. Here are the od outputs from my VNC client with -n enabled:

Click:
Code:
# od -x /dev/input/event1                                       
0000000     3b5f    0000    2942    0000    0003    0039    ffff    0000
0000020     3b5f    0000    2961    0000    0000    0000    0000    0000
0000040     3b5f    0000    f6e7    0004    0003    0039    000c    0000
0000060     3b5f    0000    f724    0004    0000    0000    0000    0000

Another click:
Code:
# od -x /dev/input/event1                                   
0000000     3bd3    0000    4a79    0007    0003    0039    ffff    0000
0000020     3bd3    0000    4a79    0007    0000    0000    0000    0000
0000040     3bd3    0000    5006    000c    0003    0039    000c    0000
0000060     3bd3    0000    5025    000c    0000    0000    0000    0000

Swipe, left to right (looks like a click to my untrained eye):
Code:
# od -x /dev/input/event1                                   
0000000     3bd3    0000    4a79    0007    0003    0039    ffff    0000
0000020     3bd3    0000    4a79    0007    0000    0000    0000    0000
0000040     3bd3    0000    5006    000c    0003    0039    000c    0000
0000060     3bd3    0000    5025    000c    0000    0000    0000    0000

Let me know if I can be of any more help.
 

frenccw

Senior Member
Jun 15, 2011
703
226
At the moment there is no java gui to start/stop the program.

You need to start it from a shell prompt using adb or something like connectbot.

If you are not familiar with these methods of program control you might want to wait another week or two until I have time to put together a GUI or merge it back into another program that already has a GUI.

Looking forward to it too. Missing this feature badly from Gingerbread :( Let me know if you need a noob beta tester for the apk version
 

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    ** You need to have root to run this app! **

    I have been hacking up a vnc server from old code I found on Google. I will try to get the changes merged into the original project; if that fails I will start a new project or just post the source.
    This one works with my rooted Transformer Prime, a rooted Galaxy S2 and a CyanogenMod Nexus One perfectly. On a non-rooted Galaxy S2 everything works except the mouse/touch.

    This uses the new Screenshot code for Android and either the "uinput" user space input device, the "input" command line tool to send keys, or direct access to the Linux keyboard device. It uses either the "uinput" user space input device if specified for the keyboard or the Linux touch device / mousepad device (like on my Prime).

    I have been pushing the NDK app to /data/local/vncs using adb.
    Open an "adb shell" or local connectbot session. cd /data/local. and then a command like below:

    Try this first:
    ./vncs

    galaxy s2 has no mouse pointer: (touch won't work without root)
    ./vncs -t /dev/input/event2 -s -g -x 480 -y 800

    galaxy nexus has no mouse pointer: (touch won't work without root)
    ./vncs -t /dev/input/event1 -s -n -x ? -y ? (I don't know the values for the nexus touch size or if it auto detects)

    prime with keyboard has visible mouse pointer: (rooted ICS)
    ./vncs -t /dev/input/event5

    prime without keyboard has no mouse pointer: (rooted ICS)
    ./vncs -t /dev/input/event3

    nexus one with cyanogenmod: (rooted Gingerbread)
    ./vncs -t /dev/input/event3

    local Escape key is "back" on remote Android device
    local Windows or Home key is "home" on remote Android device
    local F1 or Menu or Pg-Up key is "menu" on remote Android device
    local F6 key is "camera" on some devices (not all)
    local Pg-Dn key is "call" on some devices (not all)
    local End key is "end call" and/or power on/off
    local Alt-o / Alt-i is "power off/on" on some devices
    local Alt-u is "volume up" on some devices
    local Alt-d is "volume down" on some devices

    Press F2 or Alt-p to pause/resume screen refresh. This is great for watching videos on the TV. If you don't disable the remote refresh then the video will jerk because of the screenshots being taken.
    If you have a Prime with the keyboard then you can use the mouse pointer version and see what you are clicking on even with screen refresh off.

    Press F4 or Alt-r to rotate the screen 90 degrees. 0,90,180,270 then back to 0. The connection disconnects for now so you will need to reconnect again. To keep reconnecting, in a shell on my laptop I use "while :; do vncviewer 192.168.0.5:1; sleep 1; done".

    Press F3 or Alt-s to change the scaling, normal, half, quarter then back to normal. The connection disconnects for now so you will need to reconnect again. To keep reconnecting, in a shell on my laptop I use "while :; do vncviewer 192.168.0.5:1; sleep 1; done".

    Press Alt-q to close the connection from the server side. It can be opened again from the client.

    I haven't tested on many other devices yet. Let me know of failures or successes!

    Command line switches on the server:
    -h show help
    -s swap red/blue colors
    -g galaxy s2 touchscreen
    -n galaxy nexus touchscreen
    -x touchscreen maximim x
    -y touchscreen maximim y
    -r rotate mode 0,1,2,3 = 0,90,180,270 degrees, default is 0
    -T touchscreen pointer rotate offset, 0-3=0,90,180,270, default is 0 (same rotation as screen)
    -m magnification 1/m, 1=fullsize, 2=half size, 4=quarter size
    -t touch device
    -k keyboard device, default is uinput command
    -p : password, default is none
    -d : delay between events, default is 300000
    -P : port, default is 5901
    -32 32bpp; default is 32 for snapshot, 16 for framebuffer
    -16 16bpp; default is 32 for snapshot, 16 for framebuffer
    -o hack to send touch events on non-rooted device
    -c red offset, red length, green offset, green length, blue offset, blue length; defaults 16,8,8,8,8,0
    -R connect to remote host:remote port
    -a average when scaling (slower but better looking)
    -C reconnect to listener if connection dropped

    Version 1.86

    ---------------------------------------
    Version 1.86 includes many new features such as connect to remote vnc listener, deliver VNC Java client on port 5800+, average pixels when scaling, touchscreen pointer rotation offset and generic color sequence settings (needed for some devices).
    If all connected clients support it then size and rotation are updated without disconnecting the client; if any client doesn't support it, then all clients are disconnected as it worked previously. Normally not a problem since most people only connect to a device with one client at a time.

    Connect to your device from a java enabled web browser with something like http://192.168.0.8:5801 if your normal port is 5901. The downloaded jar supports most things the standalone vnc clients support.

    ---------------------------------------
    Version 1.86 includes a Java Control App as well.
    It has the NDK app included in it so you only need to download the standalone exe if you don't want the Java App. The Java App extracts the NDK App when it runs and keeps it in its own Android directory structure (not in /data/local anymore).

    The GUI is now compiled for Android 2.2+ and now includes two desktop widgets: 1x1 and 4x1 and an option to turn on a notification that shows the current server status and a start/stop button. Notification icon and widgets change icon to give visual indication when the server is running.

    Custom Launchers and other apps can call activities to start/stop the server.
    Tasker Action Intent setup:
    Action: com.mrk2012.android.preferences.START (or STOP)
    Cat: Launcher
    Target: Broadcast Receiver

    For instance, I have my phone setup to start the server when I place it in the dock or connect power.

    I found/fixed a small bug with the refresh code, hopefully that will a) keep the widgets/notifications updating unless you stopped them from the menu and b) fix the "VNCPrefs has Stopped" display.

    ** You need to have root to run this app! **

    You can configure everything from the Java GUI. Check out the About/Help menu option to see the list of special keys and their functions.
    Also look in the Help section for a quick guide on how to configure the options for different types of devices. Post if you find some more working or not working devices.

    ---------------------------------------
    Todo:
    + done: scale viewer
    + done: switch between portrait/landscape in viewer
    + done: launch/control from gui
    + create generic option for specifying pointer setup so anyone can add a new device (superseded by using uinput)
    + fix input on undocked Prime (fixed with uinput)
    + add a way to start/stop the server from an email, sms or google voice
    + http server/applet
    - upgrade to latest vnc server library/applet
    - ctrl key (for connectbot mainly)

    Prime specifc keys:
    - page up/down keys
    - home/end keys
    - insert/delete keys
    - media/volume keys
    - other prime hard keys: wireless/mouse/bluetooth/contrast/camera/etc
    2
    Useful program, working well in my s2.
    Anybody knows a way or apk to turn on screen without press any key?? From vncviewer for example..


    Thanks

    local End key is "end call" and/or power on/off
    local Alt-o / Alt-i is "power off/on" on some devices
    2
    If you JB guys want to try this one let me know.
    May need cleanup before general use; just tried removing the _client lib.

    Need to rename vncs.apk to just vncs if you want to run it from the Android command line.
    (I can't seem to upload it as just vncs anymore)

    Please let me know if it works on JB.

    I'm available anytime :good:
    2
    Great. Thanks for the info.

    I will build a GUI version that has the old and new version of vncs in it so everyone can use it.

    I'm also working on compiling for x86; maybe we can give that a go in the new year.


    Hi, i can confirm this works on 4.2.1

    My devics is asus tf101 running eos4 previewB94(20121221) android 4.2.1

    //this the first time I run this app, so just want to let you know it works

    Happy holidays and thank you.
    =========================
    u0_a36@android:/data/local # ./vncs-4.1
    --Initializing gingerbread access method--
    screenshot info: 32 1280 800 4096000
    27/12/2012 13:03:29 Listening for VNC connections on TCP port 5901
    27/12/2012 13:03:29 Listening for HTTP connections on TCP port 5801
    27/12/2012 13:03:29 URL http://localhost:5801
    27/12/2012 13:03:50 Got connection from client 192.168.1.118
    27/12/2012 13:03:50 other clients:
    27/12/2012 13:03:50 Client Protocol Version 3.7
    27/12/2012 13:03:50 Protocol version sent 3.7, using 3.7
    27/12/2012 13:03:50 rfbProcessClientSecurityType: executing handler for type 1
    27/12/2012 13:03:50 Pixel format for client 192.168.1.118:
    27/12/2012 13:03:50 16 bpp, depth 16, little endian
    27/12/2012 13:03:50 true colour: max r 31 g 63 b 31, shift r 11 g 5 b 0
    27/12/2012 13:03:50 Enabling NewFBSize protocol extension for client 192.168.1.118
    27/12/2012 13:03:50 Using ZRLE encoding for client 192.168.1.118
    key: 0x9e 0 0
    ========
    2
    Version 1.60 in this post

    Version 1.60 in this post.

    Lots of new features! If it seems stable I will move it to the first post.

    new vncs command line options:
    -a averages a 2x2 section of pixels in half and quarter zoom (maybe 4x4 in quarter mode later)
    -R host: port (no space between host , : and port) to connect to a host running vncviewer in listen mode (usually -listen on the vncviewer command line).

    new gui options:
    Use Average in zoom modes. (compare the original.png and averaged.png images)
    Connect to remote viewer in listen mode.
    Show Configure Notification.
    Show Start/Stop Notification. Includes status of server: not running or running and PID if running.
    Notification Refresh Time (5,10,15,30,60 seconds). This is polled for now so I am not sure how this will effect battery life.

    Averaging does slow it down (at least for now). And for now you have to restart the server for the option to take effect.

    On ICS devices (maybe Honeycomb?) the Notifications are shown together since individual buttons in a Notification can launch separate intents. On older devices they are shown as separate Notifications.

    You need to use the GUI if you want the notifications since it creates them, not the command line app.

    The remote host option should allow a cellular device to connect to your home computer since you normally have a non-NAT address at home. (at least you can route a port thru your home firewall). Even if you connect in remote/listen mode you can still connect the normal way if the remote connection closes or fails.

    Let me know how it works!