From c5197eab01a28a5b1668f3ad906206636462ce61 Mon Sep 17 00:00:00 2001 From: Samuel Carlsson Date: Sat, 29 Oct 2016 07:07:37 +0200 Subject: [PATCH] Using java syntax highliter for code snippets. --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f8805fb..80b655c 100644 --- a/README.md +++ b/README.md @@ -12,20 +12,26 @@ This projects aims at providing an up to date implementation of the ADB protocol ## Example ## Usage cannot be simpler. Just create a `JadbConnection` and off you go. - JadbConnection jadb = new JadbConnection(); - List devices = jadb.getDevices(); +```java +JadbConnection jadb = new JadbConnection(); +List devices = jadb.getDevices(); +``` Make sure the adb server is running. You can start it by running `adb` once from the command line. It's very easy to send and receive files from your android device, for example as below. - JadbDevice device = ... - device.pull(new RemoteFile("/path/to/file.txt"), new File("file.txt")); +```java +JadbDevice device = ... +device.pull(new RemoteFile("/path/to/file.txt"), new File("file.txt")); +``` Some high level operations such as installing and uninstalling packages are also available. - JadbDevice device = ... - new PackageManager(device).install(new File("/path/to/my.apk")); +```java +JadbDevice device = ... +new PackageManager(device).install(new File("/path/to/my.apk")); +``` ## Protocol Description ##