Skip to content

Commit f230b26

Browse files
committed
Update README.md
1 parent 64cae9e commit f230b26

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

README.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Studyplus SDK for Android
1212

1313
Graddle Project
1414

15-
```
15+
```groovy
1616
repositories {
1717
maven { url 'http://raw.github.com/studyplus/Studyplus-Android-SDK/master/repository' }
1818
}
@@ -21,10 +21,47 @@ dependencies {
2121
}
2222
```
2323

24-
##Usage
24+
## Usage
25+
26+
### Authenticate
27+
28+
Open an Activity to connect with Studyplus.
29+
30+
```java
31+
AuthTransit.from(activity).startActivity(
32+
context.getString("app_consumer_key"),
33+
context.getString("app_consumer_key_secret")
34+
);
35+
```
36+
37+
Then save its result.
38+
39+
```java
40+
@Override
41+
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
42+
CertificationStore.create(context).update(data);
43+
}
44+
```
45+
46+
### Post a record to Studyplus
47+
48+
Create ApiRequest and send it with ApiClient.
49+
50+
```java
51+
ApiRequest request = StudyRecordPostRequest.of(
52+
new StudyRecordBuilder()
53+
.setComment("perfect!")
54+
.setAmountTotal(30)
55+
.setDurationSeconds(2 * 60)
56+
.build()
57+
);
58+
StudyplusApi.getClient(context).send(request);
59+
```
60+
61+
### More
2562

26-
Coming Soon
63+
* See also [actual examples](https://github.com/studyplus/Studyplus-Android-SDK/blob/master/SDKExample/src/main/java/jp/studyplus/android/sdk/example/ExampleActivity.java).
2764

28-
##License
65+
## License
2966

3067
* [MIT License](http://opensource.org/licenses/MIT)

0 commit comments

Comments
 (0)