Top Related Projects
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
Modern VNC Server and client, web based and secure
VNC client web application
👁️ UltraVNC Server, UltraVNC Viewer, UltraVNC Repeater and UltraVNC SC | Official repository: https://github.com/ultravnc/UltraVNC
FreeRDP is a free remote desktop protocol library and clients
Quick Overview
droidVNC-NG is an open-source VNC server for Android devices. It allows users to remotely control their Android devices from a computer or another device using VNC client software. This project is a fork of the original droidVNC, with improvements and updates for modern Android versions.
Pros
- Works on non-rooted devices (Android 5.0+)
- Supports both touch and keyboard input
- Offers various encoding options for better performance
- Actively maintained and updated
Cons
- May have performance issues on older devices
- Requires Android permission setup, which can be complex for some users
- Limited documentation for advanced features
- Potential security risks if not configured properly
Getting Started
To use droidVNC-NG on your Android device:
- Download the latest APK from the releases page.
- Install the APK on your Android device.
- Open the app and grant necessary permissions.
- Configure the server settings (port, password, etc.).
- Start the VNC server.
- Connect to your device using a VNC client on another device, using the IP address and port displayed in the app.
Note: For non-rooted devices, you'll need to set up ADB and enable USB debugging to grant additional permissions. Follow the instructions provided in the app for this process.
Competitor Comparisons
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
Pros of libvncserver
- More comprehensive VNC library with both server and client implementations
- Wider platform support, including Windows, macOS, and various Unix-like systems
- Actively maintained with regular updates and contributions from a larger community
Cons of libvncserver
- Larger codebase and potentially more complex to integrate into projects
- Not specifically optimized for Android devices, unlike droidVNC-NG
- May require more resources and have a larger footprint in mobile applications
Code Comparison
libvncserver:
rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
int width,int height,int bitsPerSample,int samplesPerPixel,
int bytesPerPixel)
droidVNC-NG:
public class VncServer {
public native int init(int width, int height, int port);
public native void close();
}
The code snippets show that libvncserver uses a C-based API for screen initialization, while droidVNC-NG provides a Java native interface specifically designed for Android integration. This reflects the different focus and target platforms of the two projects.
Modern VNC Server and client, web based and secure
Pros of KasmVNC
- Designed for web-based remote access, optimized for modern browsers
- Supports advanced features like audio streaming and file transfer
- Active development with regular updates and improvements
Cons of KasmVNC
- Larger codebase and potentially more complex setup
- May have higher resource requirements due to additional features
Code Comparison
KasmVNC (C++):
void VNCServerST::processClientMessages()
{
std::vector<rdr::U8> updateBuf;
std::vector<rdr::U8> clipboardBuf;
// ... (processing logic)
}
droidVNC-NG (Java):
public void processServerMessages() {
byte[] buffer = new byte[1024];
int bytesRead;
// ... (processing logic)
}
KasmVNC focuses on server-side processing with C++, while droidVNC-NG is client-oriented using Java. KasmVNC's code suggests more complex message handling, potentially supporting a wider range of features.
Summary
KasmVNC is a feature-rich VNC solution optimized for web-based access, offering advanced capabilities but potentially requiring more resources. droidVNC-NG is a simpler, Android-focused VNC client with a lighter codebase. The choice between them depends on specific use cases and platform requirements.
VNC client web application
Pros of noVNC
- Web-based VNC client, accessible from any modern browser without plugins
- Supports a wide range of VNC servers and protocols
- Active development with frequent updates and improvements
Cons of noVNC
- Potentially higher latency due to web-based nature
- May have limited performance on older or low-powered devices
- Requires a web server to host the client files
Code Comparison
noVNC (JavaScript):
var rfb = new RFB(document.getElementById('screen'), 'ws://example.com:5900');
rfb.scaleViewport = true;
rfb.resizeSession = true;
droidVNC-NG (Java):
VncCanvas vncCanvas = new VncCanvas(this);
vncCanvas.setScaleType(ImageView.ScaleType.MATRIX);
vncCanvas.init();
vncCanvas.setConnection(new VNCConn());
Both projects aim to provide VNC client functionality, but noVNC focuses on web-based implementation, while droidVNC-NG is specifically designed for Android devices. noVNC offers broader accessibility across platforms, whereas droidVNC-NG may provide better performance and integration on Android devices.
👁️ UltraVNC Server, UltraVNC Viewer, UltraVNC Repeater and UltraVNC SC | Official repository: https://github.com/ultravnc/UltraVNC
Pros of UltraVNC
- More comprehensive feature set, including file transfer and chat functionality
- Better suited for enterprise environments with advanced security options
- Supports multiple platforms including Windows, Linux, and macOS
Cons of UltraVNC
- Larger codebase, potentially more complex to maintain and contribute to
- May have higher resource requirements due to additional features
- Less focused on mobile platforms compared to droidVNC-NG
Code Comparison
UltraVNC (C++):
void ClientConnection::ReadExact(char *inbuf, int wanted)
{
int offset = 0;
while (wanted > 0) {
int bytes = recv(m_sock, inbuf + offset, wanted, 0);
// ... error handling and processing
}
}
droidVNC-NG (Java):
private void readFully(InputStream is, byte[] b, int off, int len) throws IOException {
while (len > 0) {
int count = is.read(b, off, len);
if (count < 0)
throw new EOFException();
off += count;
len -= count;
}
}
Both projects implement similar functionality for reading data from a socket or input stream, but use different languages and slightly different approaches due to their target platforms and design choices.
FreeRDP is a free remote desktop protocol library and clients
Pros of FreeRDP
- Supports multiple platforms (Windows, macOS, Linux, iOS, Android)
- Implements the Remote Desktop Protocol (RDP), which is widely used in enterprise environments
- Actively maintained with frequent updates and a large community
Cons of FreeRDP
- More complex setup and configuration compared to VNC-based solutions
- Requires more system resources due to its comprehensive feature set
- May have compatibility issues with some older systems or non-standard RDP implementations
Code Comparison
droidVNC-NG (VNC-based):
rfbBool rfbSendFramebufferUpdate(rfbClientPtr cl, sraRegionPtr updateRegion)
{
rfbFramebufferUpdateMsg fu;
// ... (VNC-specific frame buffer update logic)
}
FreeRDP (RDP-based):
BOOL update_begin_paint(rdpContext* context)
{
rdpUpdate* update = context->update;
// ... (RDP-specific update begin paint logic)
}
The code snippets highlight the different approaches to handling screen updates in VNC and RDP protocols. droidVNC-NG uses VNC-specific functions for frame buffer updates, while FreeRDP implements RDP-specific update mechanisms.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
droidVNC-NG
This is an Android VNC server using contemporary Android 7+ APIs. It therefore does not require root access. In reverence to the venerable droid-VNC-server is is called droidVNC-NG.
If you have a general question, it's best to ask in the community chat. If your concern is about a bug or feature request instead, please use the issue tracker.
Features
- Network export of device frame buffer with optional server-side scaling.
- Injection of remote pointer and basic keyboard events (Latin-1 charset plus some special keys, supporting any kind of UI widget on Android 14 and newer, on older devices into EditText widgets only).
- Handling of client-to-server text copy & paste. Note that server-to-client copy & paste only works automatically for text selected in editable text fields or manually by sharing text to droidVNC-NG via Android's Share-To functionality.
- Handling of special keys to trigger 'Recent Apps' overview, Home button, Back button and Power button.
- Android permission handling.
- Screen rotation handling.
- File transfer via the local network, assuming TightVNC viewer for Windows version 1.3.x is used.
- Password protection for secure-in-terms-of-VNC connection. Note that setting a password is mandatory in case you want to access the server using MacOS's built-in Screen Sharing app.
- Ability to specify the port used.
- Start of background service on device boot.
- Reverse VNC.
- Ability to connect to a UltraVNC-style Mode-2 repeater.
- Functionality to provide default configuration via a JSON file or Mobile Device Management.
- Zeroconf/Bonjour publishing for VNC server auto-discovery.
- Per-client mouse pointers on the controlled device.
- Ability to control a deviceâs shared screen directly from a web browser by shipping the fabulous noVNC client with the server app. This alleviates the need for a native VNC client.
How to use
Keyboard Shortcuts From a VNC Viewer
- Ctrl-Shift-Esc triggers 'Recent Apps' overview
- Home/Pos1 acts as Home button
- End acts as Power button
- Escape acts as Back button
Within a Local Area Network
- Install the app from either marketplace.
- Get it all the permissions required.
- Set a good password and consider turning the
Start on Boot
off. - Connect to your local Wi-Fi. For accepting a connection your device should be connected to some Local Area Network that you can control, normally it is a router.
- Click
Start
and connect to your device.
From The Internet
Disclaimer: Anything else than password exchange is currently not encrypted, so use at your own risk!
If you want to accept incoming connections from VNC viewers:
-
You should allow Port Forwarding in your router's Firewall settings. Either find a UPnP supported app to open ports dynamically or log in to your router's settings (usually open 192.168.1.1 in your browser, some routers have password written on them).
-
Find Port Forwarding, usually it's somewhere in Network - Firewall - Port Forwards.
-
Create a new rule, this is an example from OpenWRT firmware.
Name: VNC forwarding
Protocol: TCP
Source zone: wan may be "internet", "modem", something that suggests the external source.
External port: 5900 by default or whatever you specified in the app.
Destination zone: lan something that suggests local network.
Internal IP address: your device's local IP address, leaving any is less secure. The device's address may change over time! You can look it up in your routers' connected clients info.
Internal port: same as external port.
-
Apply the settings, sometimes it requires rebooting a router.
-
Figure out your public address i.e. https://www.hashemian.com/whoami/.
-
Use this address and port from above to connect to your device.
Reverse VNC
Here's how to connect to a listening VNC viewer or repeater without opening a server port:
- Leave the VNC port blank, which will get the Admin Panel to state the server isn't listening for incoming connections.
- Make outbound connections by choosing either "Connect to a listening viewer" or "Connect to a repeater".
How to Pre-seed Preferences
DroidVNC-NG can be supplied with defaults for preferences that apply if preferences were not changed by the user.
See the Preseed Preferences Docs for more details.
Remote Control via the Intent Interface
droidVNC-NG features a remote control interface by means of Intents. This allows starting the VNC server from other apps or on certain events. It is designed to be working with automation apps like MacroDroid, Automate or Tasker as well as to be called from code.
See the Intent Interface Docs for more details.
Building
- After cloning the repo, make sure you have the required git submodules set up via
git submodule update --init
. - Then simply build via Android Studio or
gradlew
.
Contributing
Contributions to the project are very welcome and encouraged! They can come in many forms. You can:
- Submit a feature request or bug report as an issue.
- Provide info for issues that require feedback.
- Add features or fix bugs via pull requests. Please note there's a list of issues where contributions are especially welcome. Also, please adhere to the contribution guidelines.
Notes
-
Requires at least Android 7.
-
Since Android 10, the permission to access the screen contents has to be given on each start and is not saved. You can, however, work around this by installing adb (or simply Android Studio) on a PC, connecting the device running droidVNC-NG to that PC and running
adb shell cmd appops set net.christianbeier.droidvnc_ng PROJECT_MEDIA allow
once. Alternatively, if using the intent interface, you can also start withnet.christianbeier.droidvnc_ng.EXTRA_FALLBACK_SCREEN_CAPTURE
set to true. -
You can also use adb to manually give input permission prior to app start via
adb shell settings put secure enabled_accessibility_services net.christianbeier.droidvnc_ng/.InputService:$(adb shell settings get secure enabled_accessibility_services)
. -
If you are getting a black screen in a connected VNC viewer despite having given all permissions, it might be that your device does not support Android's MediaProjection API correctly. To find out, you can try screen recording with another app, ScreenRecorder. If it fails as well, your device most likely does not support screen recording via MediaProjection. This is known to be the case for Android-x86.
-
In case you happen to have a board with an Ethernet interface and experience strange hangs during a VNC session, setting the interface to a slower speed might help. This workaround can be applied with mii-tool, for instance.
-
If you see a a floating button similar to this on your screen after enabling accessibility, make sure you have the "shortcut" option in accessibility settings turned to off.
-
Due to limitations in Android API, secondary displays are not supported.
Top Related Projects
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
Modern VNC Server and client, web based and secure
VNC client web application
👁️ UltraVNC Server, UltraVNC Viewer, UltraVNC Repeater and UltraVNC SC | Official repository: https://github.com/ultravnc/UltraVNC
FreeRDP is a free remote desktop protocol library and clients
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot