Changes for page Android

Last modified by editor on 2017/02/08 21:50

From version < 3.2 >
edited by editor
on 2017/02/06 07:45
To version < 4.1
edited by editor
on 2017/02/08 21:50
<
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -Android2
1 +Android
Content
... ... @@ -1,14 +1,29 @@
1 1  (% dir="ltr" %)
2 -**~1. Copy keys**
3 -Copy //**Phone Number, Service name, Service Id **//and//** Service Secret Key**// to fields of **CaretApiConfiguration**
2 += About =
4 4  
4 +(% dir="ltr" %)
5 +This page shows how to use the Caret Service Client API in Android application.
5 5  
6 6  (% dir="ltr" %)
7 -**2. Init service**
8 +The example application can be downloaded from [[https:~~/~~/github.com/pomus/Caret-SampleService>>url:https://github.com/pomus/Caret-SampleService]].
8 8  
9 9  (% dir="ltr" %)
10 -Enable Caret integration for your service
11 += Android Service Client API usage =
11 11  
13 +(% dir="ltr" %)
14 +In order to develop your own Caret Service using the API, import the CaretApi and CaretApiConfiguration classes from the com.wallrust.service.sample.util package. Afterwards, perform the following steps:
15 +
16 +== **1. Copy keys** ==
17 +
18 +(% dir="ltr" %)
19 +Copy //**Phone Number, Service name, Service Id **//and//** Service Secret Key**// to fields of **CaretApiConfiguration.**
20 +
21 +(% dir="ltr" %)
22 +== **2. Init service** ==
23 +
24 +(% dir="ltr" %)
25 +Enable Caret integration for your service:
26 +
12 12  {{code language="java"}}
13 13  CaretApi.appInit(new CaretApi.Callback() {
14 14   @Override
... ... @@ -22,13 +22,11 @@
22 22  });
23 23  {{/code}}
24 24  
40 +== **3. Consent** ==
25 25  
26 26  (% dir="ltr" %)
27 -**3. Consent**
43 +Ask Caret users for approving your service:
28 28  
29 -(% dir="ltr" %)
30 -Ask Caret users for approving your service
31 -
32 32  {{code language="java"}}
33 33  CaretApi.consent(thisActivity, uuid);
34 34  
... ... @@ -45,34 +45,34 @@
45 45  }
46 46  {{/code}}
47 47  
61 +== **4. Publish user’s status update** ==
48 48  
49 -(% dir="ltr" %)
50 -**4. Publish user’s status update**
51 -
52 52  {{code language="java"}}
53 53  CaretApi.publishStatus(UUID, CaretApi.GAMING);
65 +{{/code}}
54 54  
55 55  or
56 56  
69 +{{code language="java"}}
57 57  CaretApi.publishStatusWithText(UUID, CaretApi.GAMING, "Hello word");
71 +{{/code}}
58 58  
59 59  or
60 60  
75 +{{code language="java"}}
61 61  CaretApi.publishStatusWithContextJSON(UUID, CaretApi.GAMING, json);
62 62  {{/code}}
63 63  
79 +== **5. Publish service-off** ==
64 64  
65 -(% dir="ltr" %)
66 -**5. Publish service-off**
67 -Publish service-off, if the user leaves the app.
81 +Publish service-off, if the user leaves the application.
68 68  
69 69  {{code language="java"}}
70 70  CaretApi.serviceOff(UUID);
71 71  {{/code}}
72 72  
87 +== **6. Delete service** ==
73 73  
74 -(% dir="ltr" %)
75 -**6. Delete service**
76 76  Delete service consent, if user wants to switch off Caret service.
77 77  
78 78  {{code language="java"}}