Skip to content

Commit 0815cad

Browse files
committed
README更新
1 parent bb50af8 commit 0815cad

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

README.md

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,57 @@
11
# Studyplus-Android-SDK-V2
22

3-
[![CircleCI](https://circleci.com/gh/studyplus/Studyplus-Android-SDK-V2/tree/master.svg?style=svg)](https://circleci.com/gh/studyplus/Studyplus-Android-SDK-V2/tree/master) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/jp.studyplus.android.sdk/studyplus-android-sdk2/badge.svg)](https://maven-badges.herokuapp.com/maven-central/jp.studyplus.android.sdk/studyplus-android-sdk2)
3+
[![CircleCI](https://circleci.com/gh/studyplus/Studyplus-Android-SDK-V2/tree/master.svg?style=svg)](https://circleci.com/gh/studyplus/Studyplus-Android-SDK-V2/tree/master) [![](https://jitpack.io/v/studyplus/Studyplus-Android-SDK-V2.svg)](https://jitpack.io/#studyplus/Studyplus-Android-SDK-V2)
44

55
## Requirements
6-
- Android 4.1+
7-
- [Studyplus App 2.14+](https://play.google.com/store/apps/details?id=jp.studyplus.android.app)
86

7+
- Android 5+
8+
- [Studyplus App 5.0.+](https://play.google.com/store/apps/details?id=jp.studyplus.android.app)
99

1010
## Import in your Project
1111

1212
### Gradle file (app)
1313

14-
```
15-
repositories {
16-
mavenCentral()
17-
}
18-
dependencies {
19-
implementation 'jp.studyplus.android.sdk:studyplus-android-sdk2:2.2.1'
14+
Add it in your root build.gradle at the end of repositories:
15+
16+
```groovy
17+
allprojects {
18+
repositories {
19+
...
20+
maven { url 'https://jitpack.io' }
21+
}
2022
}
2123
```
2224

23-
### Maven
24-
25-
```
26-
<dependency>
27-
<groupId>jp.studyplus.android.sdk</groupId>
28-
<artifactId>studyplus-android-sdk2</artifactId>
29-
<version>2.2.1</version>
30-
</dependency>
25+
```groovy
26+
dependencies {
27+
implementation 'com.github.studyplus:Studyplus-Android-SDK-V2:2.5.0'
28+
}
3129
```
3230

33-
or download the latest JAR [via Central Repository](http://search.maven.org/#search%7Cga%7C1%7Cstudyplus)
34-
3531
## Usage
3632

3733
### Setup
3834

39-
```
35+
```kotlin
4036
Studyplus.instance.setup("consumer_key", "consumer_secret")
4137
```
4238

4339
### Authenticate
4440

4541
Open an Activity to connect with Studyplus.
4642

47-
```
43+
```kotlin
4844
try {
4945
Studyplus.instance.startAuth(this@MainActivity, REQUEST_CODE_AUTH)
5046
} catch (e: ActivityNotFoundException) {
5147
e.printStackTrace()
52-
Toast.makeText(context, "Need for Studyplus 2.14.0+", Toast.LENGTH_LONG).show()
48+
Toast.makeText(context, "Need for Studyplus 5.0.0+", Toast.LENGTH_LONG).show()
5349
}
5450
```
5551

5652
Then save its result.
5753

58-
```
54+
```kotlin
5955
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
6056
when (requestCode) {
6157
REQUEST_CODE_AUTH -> {
@@ -72,7 +68,7 @@ override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?)
7268

7369
Create a record and post.
7470

75-
```
71+
```kotlin
7672
val record = StudyRecord(
7773
duration = 2 * 60,
7874
amount = StudyRecordAmountTotal(30),
@@ -94,6 +90,7 @@ Studyplus.instance.postRecord(this@MainActivity, record,
9490
```
9591

9692
### More
93+
9794
- See also [actual examples with Kotlin](https://github.com/studyplus/Studyplus-Android-SDK-V2/blob/master/sdk-example-kt/src/main/java/jp/studyplus/android/sdk_example_kt/MainActivity.kt).
9895
- See also [actual examples with Java](https://github.com/studyplus/Studyplus-Android-SDK-V2/blob/master/sdk-example-java/src/main/java/jp/studyplus/android/sdk_example_java/MainActivity.java).
9996

@@ -121,4 +118,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
121118
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
122119
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
123120
SOFTWARE.
124-
```
121+
```

0 commit comments

Comments
 (0)