Skip to content
This repository has been archived by the owner on Dec 29, 2019. It is now read-only.

Commit

Permalink
clean up headers
Browse files Browse the repository at this point in the history
  • Loading branch information
drewvolz authored Apr 12, 2017
1 parent a6af1ff commit 0f1cd80
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:

Expand All @@ -55,15 +55,15 @@ 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).

## Usage

### [Sample Activity](https://gist.github.com/markrjr/0519268f69a5823da17b)

###Getting started
### Getting started

First, add the following permissions to your AndroidManifest.xml.

Expand Down Expand Up @@ -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() {
Expand All @@ -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.**

Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -277,7 +277,7 @@ Regardless of the whatever method you choose to define serialized data, parsing
}
```

###Cleaning up
### Cleaning up

```java
@Override
Expand All @@ -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.

Expand Down

0 comments on commit 0f1cd80

Please sign in to comment.