From ab9fadb6836737b0ec4f42fa1a0197ba9359d251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Fri, 2 Mar 2012 16:50:44 +0100 Subject: Syntax hilighting of code example. --- README.md | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 84ddec1..cd5ffe2 100644 --- a/README.md +++ b/README.md @@ -17,27 +17,29 @@ An incomplete list of implemented and planned features. ## Example With Same you can share variables easily, like so: - // First: Some setup to get all your devices connected to the same network. - // Then, in your Activity: - ClientInterfaceBridge client = new ClientInterfaceBridge(this); - client.connect(); - try { - // A VariableFactory is used to create distributed objects. - VariableFactory variableFactory = client.createVariableFactory(); - Variable myVariable = variableFactory.createString("MyVariable"); - - // Set the variable. - myVariable.set("Hello, Same!"); - - // Run update() to get the most recent version. - myVariable.update(); - - // Get the current value. - Log.i("The current value is: " + myVariable.get()); - } finally { - // Always remember to disconnect. - client.disconnect(); - } +```Java +// First: Some setup to get all your devices connected to the same network. +// Then, in your Activity: +ClientInterfaceBridge client = new ClientInterfaceBridge(this); +client.connect(); +try { + // A VariableFactory is used to create distributed objects. + VariableFactory variableFactory = client.createVariableFactory(); + Variable myVariable = variableFactory.createString("MyVariable"); + + // Set the variable. + myVariable.set("Hello, Same!"); + + // Run update() to get the most recent version. + myVariable.update(); + + // Get the current value. + Log.i("The current value is: " + myVariable.get()); +} finally { + // Always remember to disconnect. + client.disconnect(); +} +``` ## Release log Pre-1.0: A release is a milestone in the project. Whenever the system seems to -- cgit v1.2.3