diff --git a/README.md b/README.md index 26aac0d..8fd878b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Salut is a wrapper around the WiFi Direct API in Android. Before using Salut, you should at least skim over some of the documentation and recommended reading below. The library supports API 16 (Android 4.1 Jelly Bean) and up. Technically, WiFi Direct is supported on Android 4.0, but it is more reliable on 4.1 and up. -###Table of Contents +### Table of Contents * [Dependencies](#dependencies) * [Installation](#installation) @@ -14,22 +14,22 @@ Salut is a wrapper around the WiFi Direct API in Android. Before using Salut, yo * [Cleaning up](#cleaning-up) * [More](#contributing) -###Recommended Reading +### Recommended Reading [General Overview](http://developer.android.com/guide/topics/connectivity/wifip2p.html) [Service Discovery](http://developer.android.com/training/connect-devices-wirelessly/nsd-wifi-direct.html) [Power Consumption](http://www.drjukka.com/blog/wordpress/?p=95) [More Recommended Reading](http://www.drjukka.com/blog/wordpress/?p=81) -###WARNING +### WARNING This library is currently in beta so functionality or APIs are subject to change. -###Why the name? What does it mean? +### Why the name? What does it mean? Salut is a French greeting. It's another way to say hello or goodbye. Apple's technology used in iOS to do something similar is called Bonjour. -##Dependencies +## Dependencies This library depends on: @@ -55,7 +55,7 @@ dependencies { } ``` -##Installation +## Installation To install the library simply grab the newest version and it to your project's build.gradle file using [JitPack](https://jitpack.io/#markrjr/Salut). @@ -63,7 +63,7 @@ To install the library simply grab the newest version and it to your project's b ### [Sample Activity](https://gist.github.com/markrjr/0519268f69a5823da17b) -###Getting started +### Getting started First, add the following permissions to your AndroidManifest.xml. @@ -111,7 +111,7 @@ Finally, create a `Salut` instance. Once you have your instance, you can create or discover WiFi direct services. -####HOST +#### HOST ```java network.startNetworkService(new SalutDeviceCallback() { @@ -124,7 +124,7 @@ Once you have your instance, you can create or discover WiFi direct services. When a device connects and is successfully registered, this callback will be fired. **You can access the entire list of registered clients using the field `registeredClients`.** -####CLIENT +#### CLIENT There are several methods to discover services. **Salut will only connect to found services of the same type.** @@ -181,7 +181,7 @@ Finally, when a device finds a prospective host, you must then call the `registe ``` This method will actually make the devices connect using WiFi Direct. The framework then uses regular old sockets to pass data between devices. The devices will stay connected until `unregisterClient` is called client side or `stopNetworkService` is called host side. -###Crafting your data +### Crafting your data LoganSquare is responsible for data serialization within the library. LoganSquare will not actually allow the sending of simple strings between clients. So, you'll have to create a class to wrap the data that you want to send. @@ -204,7 +204,7 @@ public class Message{ } ``` -###Sending data +### Sending data After clients have registered with the host, you can then invoke methods to send data to a client. On success, the data will obviously be sent and received on the other side, as of yet, onSuccess callbacks have not yet been implemented for this. So, sending data methods only provide failure callbacks. @@ -246,7 +246,7 @@ To send data to a specific device: ``` -###Receiving data +### Receiving data When your class implements the SalutDataCallback interface, it must override the `onDataReceived(Object data)` method. @@ -277,7 +277,7 @@ Regardless of the whatever method you choose to define serialized data, parsing } ``` -###Cleaning up +### Cleaning up ```java @Override @@ -293,12 +293,12 @@ Regardless of the whatever method you choose to define serialized data, parsing **Notice that we use our app's specific boolean.** -####HOST +#### HOST **When cleaning up host side, you must call `stopNetworkService`.** You must also pass in a boolean indicating whether or not you want to disable WiFi. -####CLIENT +#### CLIENT **When cleaning up client side, you must call `unregisterClient`.** You can optionally pass in a callback to be fired on failure to unregister.