Skip to content

Commit 03b3fd5

Browse files
committed
Update readme to reflect the new result delivery
1 parent 807abba commit 03b3fd5

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,19 @@ The `ProxerConnection` class provides static methods to retrieve Java representa
3030

3131
#### The `execute()` method
3232

33-
The request will automatically happen on a worker thread, thus not blocking the UI. You will mostly use this. To get the result, you pass a `ConnectionCallback`, whose methods will be called, when the request is done.
33+
The request will automatically happen on a worker thread, thus not blocking the UI. You will mostly use this. The result is delivered through the [EventBus library] (https://github.com/greenrobot/EventBus). Each type of a result has an event, either a normal `IEvent` or an `ErrorEvent`.
34+
A simple query for the news might look like this:
35+
36+
```java
37+
public void loadNews(int page){
38+
ProxerConnection.loadNews(page).execute();
39+
}
40+
41+
@Override
42+
public void onEventMainThread(NewsEvent result) {
43+
//Update UI
44+
}
45+
```
3446

3547
#### The `executeSynchronized()` method
3648

@@ -60,4 +72,4 @@ CookieHandler.setDefault(cookieManager);
6072
### Dependencies
6173

6274
This library highly relies on [Bridge](https://github.com/afollestad/bridge) by [Aidan Follestad](https://github.com/afollestad) for the network communication.
63-
Moreover it uses the [Android Support Annotations](http://tools.android.com/tech-docs/support-annotations) to improve the code style.
75+
Moreover it uses [EventBus] (https://github.com/greenrobot/EventBus) to deliver results and the [Android Support Annotations](http://tools.android.com/tech-docs/support-annotations) to improve the code style.

0 commit comments

Comments
 (0)