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

Commit

Permalink
Merge branch 'master' of https://github.com/markrjr/Salut
Browse files Browse the repository at this point in the history
  • Loading branch information
neatorobito committed Nov 20, 2015
2 parents e6d22b4 + 46a4070 commit d42b63e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ Next, start by implementing the `SalutDataCallback` in the class that you would
Then, we need to create a `SalutDataReceiver` and a `SalutServiceData` object.
```
SalutDataReceiver dataReceiver = new SalutDataReceiver(myActivity, myActivity);
SalutServiceData serviceData = new SalutServiceData("superawesomeservice", 50489, superAwesomeUser.name);
SalutServiceData serviceData = new SalutServiceData("sas", 50489, superAwesomeUser.name);
```
`SalutDataReceiver` takes two arguments,`(Activity activity, SalutDataCallback dataCallback)`. In the example above, our activity implements `SalutDataCallback`, so we pass it in twice. Passing in an activity in general allows Salut to automatically register and unregister the neccessary broadcast receivers for you app.

`SalutServiceData` takes in a service name (which should be lowercase and start with an underscore), a port, and an instance name. The instance name is basically a readable name that will be shown to users. So it's a good idea to make this something not cryptic.
`SalutServiceData` takes in a service name (which should be lowercase), a port, and an instance name. The instance name is basically a readable name that will be shown to users. So it's a good idea to make this something not cryptic. **Use relatively small strings for both the service name and readable names if you plan to support lower than Android 5.0, as there is a limitation on the size that those values can be. This is imposed by the system itself.**

Finally, create a `Salut` instance.

Expand Down

0 comments on commit d42b63e

Please sign in to comment.