File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
StudyplusAndroidSDK/src/main/java/jp/studyplus/android/sdk/service Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 11
11
*/
12
12
public class StudyplusApi {
13
13
14
- public static ApiClient getClient (Context context ) throws AccessTokenNotFound {
14
+ /**
15
+ * @param context Specifies application context.
16
+ * @return client for StudyplusAPI
17
+ * @throws AccessTokenNotFound
18
+ */
19
+ public static ApiClient getClient (Context context ) {
15
20
ApiCertification certification = CertificationStore .create (context ).getDefault ();
16
21
return new ApiClient (certification );
17
22
}
Original file line number Diff line number Diff line change @@ -25,8 +25,14 @@ public AuthTransit setRequestCode(int requestCode){
25
25
return new AuthTransit (activity , requestCode );
26
26
}
27
27
28
- public void startActivity (String consumerKey , String consumerSecret )
29
- throws ActivityNotFoundException {
28
+ /**
29
+ * Start the certification {@link Activity} for API.
30
+ *
31
+ * @param consumerKey for API
32
+ * @param consumerSecret for API
33
+ * @throws ActivityNotFoundException when not installed Studyplus application or un-supported version.
34
+ */
35
+ public void startActivity (String consumerKey , String consumerSecret ) {
30
36
Intent intent = new Intent ();
31
37
intent .setAction (Intent .ACTION_VIEW );
32
38
intent .putExtra ("consumer_key" , consumerKey );
Original file line number Diff line number Diff line change @@ -46,7 +46,13 @@ private Optional<String> findAccessToken(){
46
46
return Optional .fromNullable (preferences .getString (KEY_ACCESS_TOKEN , null ));
47
47
}
48
48
49
- public ApiCertification getDefault () throws AccessTokenNotFound {
49
+ /**
50
+ * Return the basic {@link ApiCertification} instance for API.
51
+ *
52
+ * @return certification instance for API.
53
+ * @throws AccessTokenNotFound
54
+ */
55
+ public ApiCertification getDefault () {
50
56
Optional <String > token = findAccessToken ();
51
57
if (!token .isPresent ()){
52
58
throw new AccessTokenNotFound ();
You can’t perform that action at this time.
0 commit comments