|
1 | 1 | # AccelByte Java SDK
|
2 | 2 |
|
3 |
| -## Initializing |
| 3 | +## Setup |
4 | 4 |
|
5 |
| -First, you have to set environment variable : |
| 5 | +### 1. Adding SDK to gradle file |
6 | 6 |
|
7 |
| -`MY_BASE_URL` (Required) |
| 7 | +Add this code below to `build.gradle` file on your project, |
| 8 | +Replace `{VERSION}` with a specific release version tag. |
| 9 | +check available tag in this repo : <a href="https://github.com/AccelByte/accelbyte-java-sdk">accelbyte-java-sdk</a>: |
8 | 10 |
|
9 |
| -`MY_CLIENT_ID` (Required) |
| 11 | +```java |
| 12 | +repositories { |
| 13 | + mavenCentral() |
| 14 | + maven { |
| 15 | + url 'https://nexus.accelbyte.net/repository/maven-releases/' |
| 16 | + } |
| 17 | +} |
10 | 18 |
|
11 |
| -`MY_CLIENT_SECRET` (Required if using private OAuth client only) |
| 19 | +dependencies { |
| 20 | + implementation 'net.accelbyte.sdk:sdk:{VERSION}' |
| 21 | +} |
| 22 | +``` |
12 | 23 |
|
13 |
| -Then, you'll have to instantiate AccelByteConfig and AccelByteSDK the SDK. this is the example how to instantiate it: |
| 24 | +### 2. Set the environment variables : |
| 25 | +You have to declare these environment variables below: |
14 | 26 |
|
15 |
| -```java |
16 |
| -package example.java.co; |
17 |
| - |
18 |
| -import net.accelbyte.sdk.core.AccelByteConfig; |
19 |
| -import net.accelbyte.sdk.core.AccelByteSDK; |
20 |
| -import net.accelbyte.sdk.core.client.OkhttpClient; |
21 |
| -import net.accelbyte.sdk.core.repository.ConfigRepositoryImpl; |
22 |
| -import net.accelbyte.sdk.core.repository.TokenRepositoryImpl; |
| 27 | +`AB_BASE_URL` (Required) |
23 | 28 |
|
24 |
| -public class Main { |
25 |
| - public static void main(String[] args) { |
26 |
| - AccelByteConfig config = new AccelByteConfig( |
27 |
| - new OkhttpClient(), |
28 |
| - TokenRepositoryImpl.getInstance(), |
29 |
| - new ConfigRepositoryImpl()); |
30 |
| - AccelByteSDK sdk = new AccelByteSDK(config); |
31 |
| - } |
32 |
| -} |
| 29 | +`AB_CLIENT_ID` (Required) |
33 | 30 |
|
34 |
| -``` |
| 31 | +`AB_CLIENT_SECRET` (Required if you use private OAuth client only) |
| 32 | + |
| 33 | + |
| 34 | +## Initializing SDK |
| 35 | +You'll have to create AccelByteConfig and AccelByteSDK object. This is the example how to create them: |
| 36 | + |
| 37 | +```java |
| 38 | + package example.java.co; |
| 39 | + |
| 40 | + import net.accelbyte.sdk.core.AccelByteConfig; |
| 41 | + import net.accelbyte.sdk.core.AccelByteSDK; |
| 42 | + import net.accelbyte.sdk.core.client.OkhttpClient; |
| 43 | + import net.accelbyte.sdk.core.repository.ConfigRepositoryImpl; |
| 44 | + import net.accelbyte.sdk.core.repository.TokenRepositoryImpl; |
| 45 | + |
| 46 | + public class Main { |
| 47 | + public static void main(String[] args) { |
| 48 | + AccelByteConfig config = new AccelByteConfig( |
| 49 | + new OkhttpClient(), |
| 50 | + TokenRepositoryImpl.getInstance(), |
| 51 | + new ConfigRepositoryImpl()); |
| 52 | + AccelByteSDK sdk = new AccelByteSDK(config); |
| 53 | + } |
| 54 | + } |
| 55 | + ``` |
35 | 56 |
|
36 | 57 | ## Logging In
|
37 | 58 |
|
@@ -127,3 +148,29 @@ public class Main {
|
127 | 148 | }
|
128 | 149 | }
|
129 | 150 | }
|
| 151 | +``` |
| 152 | + |
| 153 | +## API Covered: |
| 154 | +All the REST-API from all AccelByte services are included (the websocket on lobby service is not covered yet). |
| 155 | + |
| 156 | +Below are the list of services covered on the SDK: |
| 157 | +1. achievement |
| 158 | +2. basic |
| 159 | +3. cloudsave |
| 160 | +4. DS Log Manager |
| 161 | +5. DSMC |
| 162 | +6. eventlog |
| 163 | +7. game telemetry |
| 164 | +8. GDPR |
| 165 | +9. group |
| 166 | +10. IAM |
| 167 | +11. leaderboard |
| 168 | +12. legal |
| 169 | +13. lobby |
| 170 | +14. matchmaking |
| 171 | +15. platform |
| 172 | +16. QoSM |
| 173 | +17. season pass |
| 174 | +18. session browser |
| 175 | +19. social |
| 176 | +20. UGC |
0 commit comments