├── .gitignore
├── AndroidManifest.xml
├── README.md
├── doc
├── IMPLEMENTATIONNOTES.md
└── screenshot_login.png
├── ic_launcher-web.png
├── images
├── screenshot_chooser.png
├── screenshot_incoming_call.png
├── screenshot_incoming_conference.png
├── screenshot_incoming_text.png
├── screenshot_login.png
├── screenshot_main.png
└── screenshot_quiescent.png
├── libs
├── android-support-v4.jar
├── armeabi-v7a
│ └── libRtcc-5.4.730.so
├── javadoc
│ ├── html
│ │ ├── allclasses-frame.html
│ │ ├── allclasses-noframe.html
│ │ ├── com
│ │ │ └── weemo
│ │ │ │ └── sdk
│ │ │ │ ├── WL.html
│ │ │ │ ├── Weemo.html
│ │ │ │ ├── WeemoCall.AudioRoute.html
│ │ │ │ ├── WeemoCall.CallStatus.html
│ │ │ │ ├── WeemoCall.CallType.html
│ │ │ │ ├── WeemoCall.Size.html
│ │ │ │ ├── WeemoCall.StartingOptions.Builder.html
│ │ │ │ ├── WeemoCall.StartingOptions.html
│ │ │ │ ├── WeemoCall.VideoProfile.html
│ │ │ │ ├── WeemoCall.VideoSource.html
│ │ │ │ ├── WeemoCall.html
│ │ │ │ ├── WeemoContact.html
│ │ │ │ ├── WeemoEngine.Status.html
│ │ │ │ ├── WeemoEngine.UserType.html
│ │ │ │ ├── WeemoEngine.html
│ │ │ │ ├── WeemoError.Code.html
│ │ │ │ ├── WeemoError.Desc.html
│ │ │ │ ├── WeemoError.html
│ │ │ │ ├── WeemoMeetingPoint.Mode.html
│ │ │ │ ├── WeemoMeetingPoint.State.html
│ │ │ │ ├── WeemoMeetingPoint.Type.html
│ │ │ │ ├── WeemoMeetingPoint.html
│ │ │ │ ├── WeemoStats.html
│ │ │ │ ├── event
│ │ │ │ ├── WeemoEvent.html
│ │ │ │ ├── WeemoEventBus.html
│ │ │ │ ├── WeemoEventListener.html
│ │ │ │ ├── call
│ │ │ │ │ ├── CallAudioRouteChangedEvent.html
│ │ │ │ │ ├── CallConferenceFloorListEvent.html
│ │ │ │ │ ├── CallConferenceParticipantChangedEvent.html
│ │ │ │ │ ├── CallConferenceParticipantListEvent.html
│ │ │ │ │ ├── CallCreatedEvent.html
│ │ │ │ │ ├── CallPointerChangedEvent.html
│ │ │ │ │ ├── CallReceivingScreenShareChangedEvent.html
│ │ │ │ │ ├── CallReceivingVideoChangedEvent.html
│ │ │ │ │ ├── CallRecordingChangedEvent.html
│ │ │ │ │ ├── CallScreenShareSizeChangedEvent.html
│ │ │ │ │ ├── CallSendingScreenShareChangedEvent.html
│ │ │ │ │ ├── CallSendingVideoChangedEvent.html
│ │ │ │ │ ├── CallSipIdEvent.html
│ │ │ │ │ ├── CallStatusChangedEvent.html
│ │ │ │ │ ├── CallVideoOutSizeChangedEvent.html
│ │ │ │ │ ├── CallVideoSizeChangedEvent.html
│ │ │ │ │ ├── ReceivingScreenShareChangedEvent.html
│ │ │ │ │ ├── ReceivingVideoChangedEvent.html
│ │ │ │ │ ├── WeemoCallEvent.html
│ │ │ │ │ ├── package-frame.html
│ │ │ │ │ ├── package-summary.html
│ │ │ │ │ └── package-tree.html
│ │ │ │ ├── global
│ │ │ │ │ ├── AuthenticatedEvent.Error.html
│ │ │ │ │ ├── AuthenticatedEvent.html
│ │ │ │ │ ├── CanCreateCallChangedEvent.Error.html
│ │ │ │ │ ├── CanCreateCallChangedEvent.html
│ │ │ │ │ ├── ConnectedEvent.Error.html
│ │ │ │ │ ├── ConnectedEvent.html
│ │ │ │ │ ├── DataChannelEvent.html
│ │ │ │ │ ├── StatusEvent.html
│ │ │ │ │ ├── WeemoGlobalEvent.html
│ │ │ │ │ ├── WeemoGlobalResultEvent.html
│ │ │ │ │ ├── package-frame.html
│ │ │ │ │ ├── package-summary.html
│ │ │ │ │ └── package-tree.html
│ │ │ │ ├── meetingpoint
│ │ │ │ │ ├── MeetingPointErrorEvent.html
│ │ │ │ │ ├── MeetingPointFoundEvent.html
│ │ │ │ │ ├── MeetingPointRequestAcceptedEvent.html
│ │ │ │ │ ├── MeetingPointRequestDeniedEvent.html
│ │ │ │ │ ├── MeetingPointRequestEvent.html
│ │ │ │ │ ├── WeemoMeetingPointEvent.html
│ │ │ │ │ ├── package-frame.html
│ │ │ │ │ ├── package-summary.html
│ │ │ │ │ └── package-tree.html
│ │ │ │ ├── package-frame.html
│ │ │ │ ├── package-summary.html
│ │ │ │ └── package-tree.html
│ │ │ │ ├── exception
│ │ │ │ ├── WeemoIllegalArgumentException.html
│ │ │ │ ├── WeemoIllegalStateException.html
│ │ │ │ ├── WeemoPermissionRequiredException.html
│ │ │ │ ├── WeemoRuntimeException.html
│ │ │ │ ├── WeemoUnsupportedOperationException.html
│ │ │ │ ├── package-frame.html
│ │ │ │ ├── package-summary.html
│ │ │ │ └── package-tree.html
│ │ │ │ ├── package-frame.html
│ │ │ │ ├── package-summary.html
│ │ │ │ ├── package-tree.html
│ │ │ │ └── view
│ │ │ │ ├── WeemoScreenShareInFrame.OnWeemoScreenShareInFrameTouchListener.html
│ │ │ │ ├── WeemoScreenShareInFrame.html
│ │ │ │ ├── WeemoVideoInFrame.OnWeemoVideoInFrameTouchListener.html
│ │ │ │ ├── WeemoVideoInFrame.html
│ │ │ │ ├── WeemoVideoOutPreviewFrame.html
│ │ │ │ ├── package-frame.html
│ │ │ │ ├── package-summary.html
│ │ │ │ └── package-tree.html
│ │ ├── constant-values.html
│ │ ├── deprecated-list.html
│ │ ├── help-doc.html
│ │ ├── index-all.html
│ │ ├── index.html
│ │ ├── overview-frame.html
│ │ ├── overview-summary.html
│ │ ├── overview-tree.html
│ │ ├── package-list
│ │ ├── resources
│ │ │ ├── background.gif
│ │ │ ├── tab.gif
│ │ │ ├── titlebar.gif
│ │ │ └── titlebar_end.gif
│ │ ├── serialized-form.html
│ │ └── stylesheet.css
│ └── rtcc-5.4.730-javadoc.jar
├── rtcc-5.4.730-javadoc.jar.properties
├── rtcc-5.4.730.jar
└── volley.jar
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── drawable-xxhdpi
│ └── ic_launcher.png
├── drawable
│ ├── circle.xml
│ ├── greencircle.xml
│ ├── redcircle.xml
│ ├── selectable_bg_blue.xml
│ ├── selectable_bg_green.xml
│ └── selectable_bg_red.xml
├── layout
│ ├── activity_login.xml
│ ├── activity_main.xml
│ └── custom_spinner.xml
├── menu
│ └── main.xml
├── values-sw600dp
│ └── dimens.xml
├── values-sw720dp-land
│ └── dimens.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
└── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
└── src
└── com
└── sightcall
├── Communicator
├── AspectLockedFrameLayout.java
├── LoginActivity.java
├── MainActivity.java
├── SessionManager.java
└── UserCustomArrayAdapter.java
└── api
├── Api.java
├── JsonObjectRequestBasicAuth.java
└── User.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # built application files
2 | *.apk
3 | *.ap_
4 |
5 | # files for the dex VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # generated files
12 | bin/
13 | gen/
14 | .gradle/
15 | build/
16 |
17 | # Local configuration file (sdk path, etc)
18 | local.properties
19 | keystore.properties
20 |
21 | # Eclipse project files
22 | .classpath
23 | .project
24 | .cproject
25 | .settings
26 |
27 | # Others
28 | Thumbs.db
29 | lint.xml
30 | .DS_Store
31 | *~
32 | .metadata/
33 | proguard-dump.txt
34 |
35 | # Idea non-crucial project fileS
36 | *.iws
37 |
38 | # Project files
39 | *.iml
40 | .idea
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | SightCall Communicator-for-Android
2 | ==================================
3 |
4 | SightCall Communicator-for-Android is a **reference implementation**
5 | for a mobile application showcasing real-time communications for a
6 | small workgroup. It is implemented as a small Android application
7 | with a single Main activity. Communicator demonstrates real-time
8 | services and shows how to layer the SightCall platform into a host
9 | Android application. It shows the following features.
10 |
11 | - one-to-one video and voice
12 | - multiparty video-teleconference
13 | - text-chat
14 | - presence
15 | - recording (optional)
16 |
17 | Communicator-for-Android uses a ReST API to authenticate and to obtain
18 | its list of users. Thus, a prerequisite for running this App is an
19 | installed instance of "Communicator-for-Rails"
20 | (https://github.com/sightcall/Communicator). We recommend getting a
21 | free [Heroku](http://heroku.com) account to get started.
22 |
23 | Communicator-for-Android is easy to clone and compile. Read on!
24 |
25 |
26 |
27 |
28 | ## Build Instructions
29 |
30 | Clone this project to your local filesystem.
31 |
32 | ```sh
33 | % git clone git@github.com:sightcall/Communicator-for-Android.git
34 | ```
35 |
36 | These instructions are for Eclipse.
37 |
38 | - Create a new workspace.
39 |
40 | - Select "File >> Import"
41 |
42 | - Then select "Android >> Existing Android Code into Workspace"
43 | - click the "Next>" button
44 |
45 | - Navigate to the 'Root Directory' where you cloned the code.
46 |
47 | - Press the "Finish" button.
48 |
49 | This will import the project to your Eclipse workspace.
50 |
51 |
52 |
53 | Now, select the file `Communicator/src/com.sightcall.api/Api.java` for editing.
54 |
55 | Change the following line to match the URL of your Communicator-for-Rails instance.
56 |
57 | final String baseurl = "https://sightcall-communicator.herokuapp.com/api";
58 |
59 | You can Run the App on an Android device with an Arm7 processor. (Note:
60 | you cannot run this app on an emulator.)
61 |
62 |
63 |
64 | ## Short Feature Overview
65 |
66 | Communicator-for-Android implements the functionality required to be a
67 | good partner to Communicator-for-Rails. It can make and receive
68 | calls, and it displays the online presence of all the users in the
69 | group.
70 |
71 | Some features, like conferencing and texting have a reduced user
72 | interface that make it better-suited to be a subordinate of a
73 | Web-based user.
74 |
75 | ### Login
76 |
77 | The login page asks for the same Username and Password that you use to log into Communicator-for-Rails on the web.
78 |
79 |
80 |
81 | After you log in you will see the following blank page. Your Username
82 | and Presence status will be shown at the top. At the bottom is one of
83 | the friends in the list of your contacts. Each contact shows their
84 | online presence as a colored circle. The two buttons at the bottom
85 | make a call and hangup a call.
86 |
87 |
88 |
89 | To logout, use the menu item.
90 |
91 |
92 |
93 | ### Make an outgoing call
94 |
95 | Put your finger on the spinner to reveal your list of friends. Select
96 | the friend you want to call and press the "Call" button.
97 |
98 |
99 |
100 | If the other party accepts, you will be connected in a one-to-one
101 | video call, and the name of the party will be highlighted in the
102 | Friend selector.
103 |
104 |
105 |
106 |
107 | ### Receive an incoming call
108 |
109 | If someone tries to call you, you will be presented an Incoming Call
110 | dialog. You can choose to accept or reject the call.
111 |
112 |
113 |
114 |
115 | ### Receive a Text Message
116 |
117 | A web-based user can send you a text message. You can respond with
118 | one of three pre-defined answers.
119 |
120 |
121 |
122 |
123 |
124 | ### Join a conference call
125 |
126 | A web-based user can invite you to join a multi-way conference call.
127 | In that case, you will be presented the following dialog. In a
128 | conference, you will see one user at a time --- the user who is
129 | speaking. We call this the "active speaker."
130 |
131 |
132 |
133 | All SightCall conference calls can be **Recorded** to Amazon S3. A
134 | mobile call from Android is no different. The controls for recording
135 | are in the web interface, so the conference and its recording should be
136 | set there.
137 |
138 |
139 | ## The API provided by Communicator-for-Rails
140 |
141 | The API that Communicator-for-Android makes use of queries the
142 | following four endpoints. Implement similar endpoints in your own
143 | web-application if you would like to connect Communicator-for-Android
144 | to it.
145 |
146 | /api/me -- check my password and return
147 | /api/token -- obtain a SightCall authentication token
148 | /api/appid -- retrieve the SightCall App ID of this installation
149 | /api/friends -- get a list of my friends
150 |
151 |
152 | If you want to learn about the API consumed by
153 | Communicator-for-Android you can explore it using `curl`. Try these commands to learn about the JSON data returned.
154 |
155 |
156 | curl -u bob:bobpassword https://thawing-harbor-4536.herokuapp.com/api/me
157 |
158 | Using the username 'bob' with the password 'bobpassword' you should receive your username and UID in return.
159 |
160 | curl -u bob:bobpassword https://thawing-harbor-4536.herokuapp.com/api/friends
161 |
162 | This should return bob's list of friends.
163 |
164 | curl -u bob:bobpassword https://thawing-harbor-4536.herokuapp.com/api/token
165 |
166 | This should return an authentication token for user 'bob'.
167 |
168 | curl -u bob:bobpassword https://thawing-harbor-4536.herokuapp.com/api/token
169 |
170 | This should return the AppID of the instance of Communicator-for-Rails.
171 |
172 |
173 | ## Implementation Notes
174 |
175 | See the following document
176 | [Implementation Notes](doc/IMPLEMENTATIONNOTES.md) in the `doc/`
177 | directory of this repository. It talks about some of the design
178 | decisions made in the construction of this source code.
179 |
180 |
181 |
--------------------------------------------------------------------------------
/doc/screenshot_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/doc/screenshot_login.png
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/ic_launcher-web.png
--------------------------------------------------------------------------------
/images/screenshot_chooser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/images/screenshot_chooser.png
--------------------------------------------------------------------------------
/images/screenshot_incoming_call.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/images/screenshot_incoming_call.png
--------------------------------------------------------------------------------
/images/screenshot_incoming_conference.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/images/screenshot_incoming_conference.png
--------------------------------------------------------------------------------
/images/screenshot_incoming_text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/images/screenshot_incoming_text.png
--------------------------------------------------------------------------------
/images/screenshot_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/images/screenshot_login.png
--------------------------------------------------------------------------------
/images/screenshot_main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/images/screenshot_main.png
--------------------------------------------------------------------------------
/images/screenshot_quiescent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/images/screenshot_quiescent.png
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/libs/armeabi-v7a/libRtcc-5.4.730.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/libs/armeabi-v7a/libRtcc-5.4.730.so
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/WeemoEventListener.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | WeemoEventListener
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
37 |
41 |
45 |
48 |
49 |
59 |
60 |
61 |
62 | Summary:
63 | Required |
64 | Optional
65 |
66 |
67 | Detail:
68 | Element
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
80 |
105 |
106 |
107 |
122 |
123 |
127 |
131 |
134 |
135 |
145 |
146 |
147 |
148 | Summary:
149 | Required |
150 | Optional
151 |
152 |
153 | Detail:
154 | Element
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/call/package-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.event.call
7 |
8 |
9 |
10 |
11 |
12 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/call/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.event.call Class Hierarchy
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
71 |
72 |
Class Hierarchy
73 |
74 | java.lang.Object
75 |
76 | com.weemo.sdk.event.WeemoEvent
77 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
122 |
149 |
150 |
151 |
152 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/global/WeemoGlobalEvent.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | WeemoGlobalEvent
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
37 |
41 |
45 |
48 |
49 |
59 |
60 |
61 |
62 | Summary:
63 | Nested |
64 | Field |
65 | Constr |
66 | Method
67 |
68 |
69 | Detail:
70 | Field |
71 | Constr |
72 | Method
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
84 |
85 |
98 |
99 |
100 |
101 |
102 | Direct Known Subclasses:
103 | DataChannelEvent , StatusEvent , WeemoGlobalResultEvent
104 |
105 |
106 |
107 | public class WeemoGlobalEvent
108 | extends WeemoEvent
109 | Base class for all Weemo global events.
110 |
111 | A global event is an event that affects global connectivity or status, but no particular call.
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 | Method Summary
124 |
131 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
161 |
162 |
166 |
170 |
173 |
174 |
184 |
185 |
186 |
187 | Summary:
188 | Nested |
189 | Field |
190 | Constr |
191 | Method
192 |
193 |
194 | Detail:
195 | Field |
196 | Constr |
197 | Method
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/global/package-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.event.global
7 |
8 |
9 |
10 |
11 |
12 |
13 |
Classes
14 |
23 |
Enums
24 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/global/package-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.event.global
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
71 |
72 |
73 |
74 |
75 | Class Summary
76 |
77 | Class
78 | Description
79 |
80 |
81 |
82 | AuthenticatedEvent
83 |
84 | Event that is fired when the authentication has succeded or failed.
85 |
86 |
87 |
88 | CanCreateCallChangedEvent
89 | Deprecated
90 |
91 |
92 |
93 |
94 | ConnectedEvent
95 |
96 | Event that is fired when the connection / initialization has succeded or failed.
97 |
98 |
99 |
100 | DataChannelEvent
101 |
102 | This event is fired when you receive data through the DataChannel.
103 |
104 |
105 |
106 | StatusEvent
107 |
108 |
109 |
110 |
111 |
112 | WeemoGlobalEvent
113 |
114 | Base class for all Weemo global events.
115 |
116 |
117 |
118 | WeemoGlobalResultEvent <T extends WeemoError >
119 |
120 | Base class for events that can fail.
121 |
122 |
123 |
124 |
125 |
126 |
127 |
152 |
153 |
154 |
155 |
156 |
157 |
Package com.weemo.sdk.event.global Description
158 |
159 |
160 |
161 |
176 |
203 |
204 |
205 |
206 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/global/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.event.global Class Hierarchy
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
71 |
72 |
Class Hierarchy
73 |
74 | java.lang.Object
75 |
76 | com.weemo.sdk.event.WeemoEvent
77 |
92 |
93 |
94 |
95 |
96 |
Enum Hierarchy
97 |
98 | java.lang.Object
99 |
108 |
109 |
110 |
111 |
112 |
127 |
154 |
155 |
156 |
157 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/meetingpoint/package-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.event.meetingpoint
7 |
8 |
9 |
10 |
11 |
12 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/meetingpoint/package-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.event.meetingpoint
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
67 |
108 |
109 |
124 |
151 |
152 |
153 |
154 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/meetingpoint/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.event.meetingpoint Class Hierarchy
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
71 |
72 |
Class Hierarchy
73 |
74 | java.lang.Object
75 |
76 | com.weemo.sdk.event.WeemoEvent
77 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
109 |
136 |
137 |
138 |
139 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/package-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.event
7 |
8 |
9 |
10 |
11 |
12 |
13 |
Classes
14 |
18 |
Annotation Types
19 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/package-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.event
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
71 |
72 |
73 |
74 |
75 | Class Summary
76 |
77 | Class
78 | Description
79 |
80 |
81 |
82 | WeemoEvent
83 |
84 | Base class for all Weemo events.
85 |
86 |
87 |
88 | WeemoEventBus
89 |
90 | Event bus for Weemo Dispatches events to listeners, and provides ways for listeners to register themselves.
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 | Annotation Types Summary
99 |
100 | Annotation Type
101 | Description
102 |
103 |
104 |
105 | WeemoEventListener
106 |
107 | Marks a method as a WeemoEvent handler.
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
Package com.weemo.sdk.event Description
118 |
Package that defines global
WeemoEvent
manipulation
119 |
120 |
121 |
136 |
163 |
164 |
165 |
166 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/event/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.event Class Hierarchy
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
71 |
72 |
Class Hierarchy
73 |
74 | java.lang.Object
75 |
79 |
80 |
81 |
Annotation Type Hierarchy
82 |
85 |
86 |
87 |
102 |
129 |
130 |
131 |
132 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/exception/package-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.exception
7 |
8 |
9 |
10 |
11 |
12 |
13 |
Exceptions
14 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/exception/package-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.exception
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
67 |
112 |
113 |
128 |
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/exception/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.exception Class Hierarchy
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
71 |
72 |
Class Hierarchy
73 |
74 | java.lang.Object
75 |
97 |
98 |
99 |
100 |
101 |
116 |
143 |
144 |
145 |
146 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/package-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk
7 |
8 |
9 |
10 |
11 |
12 |
13 |
Interfaces
14 |
21 |
Classes
22 |
32 |
Enums
33 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk Class Hierarchy
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
71 |
72 |
Class Hierarchy
73 |
74 | java.lang.Object
75 |
85 |
86 |
87 |
Interface Hierarchy
88 |
95 |
Enum Hierarchy
96 |
97 | java.lang.Object
98 |
114 |
115 |
116 |
117 |
118 |
133 |
134 |
135 | Prev
136 | Next
137 |
138 |
142 |
145 |
146 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/view/WeemoScreenShareInFrame.OnWeemoScreenShareInFrameTouchListener.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | WeemoScreenShareInFrame.OnWeemoScreenShareInFrameTouchListener
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
37 |
41 |
45 |
48 |
49 |
59 |
60 |
61 |
62 | Summary:
63 | Nested |
64 | Field |
65 | Constr |
66 | Method
67 |
68 |
69 | Detail:
70 | Field |
71 | Constr |
72 | Method
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
84 |
85 |
86 |
87 |
88 |
89 | Enclosing class:
90 | WeemoScreenShareInFrame
91 |
92 |
93 |
94 | public static interface WeemoScreenShareInFrame.OnWeemoScreenShareInFrameTouchListener
95 | Interface definition for a callback to be invoked when a touch event is dispatched to this view. The callback will be invoked before the touch event is given to the view.
96 | Author:
97 | Simon Marquis
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | Method Summary
110 |
111 | Methods
112 |
113 | Modifier and Type
114 | Method and Description
115 |
116 |
117 | void
118 | onWeemoScreenShareInFrameTouch (MotionEvent event)
119 | Called when a touch event is dispatched to a view.
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
171 |
172 |
176 |
180 |
183 |
184 |
194 |
195 |
196 |
197 | Summary:
198 | Nested |
199 | Field |
200 | Constr |
201 | Method
202 |
203 |
204 | Detail:
205 | Field |
206 | Constr |
207 | Method
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/view/WeemoVideoInFrame.OnWeemoVideoInFrameTouchListener.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | WeemoVideoInFrame.OnWeemoVideoInFrameTouchListener
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
37 |
41 |
45 |
48 |
49 |
59 |
60 |
61 |
62 | Summary:
63 | Nested |
64 | Field |
65 | Constr |
66 | Method
67 |
68 |
69 | Detail:
70 | Field |
71 | Constr |
72 | Method
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
84 |
85 |
86 |
87 |
88 |
89 | Enclosing class:
90 | WeemoVideoInFrame
91 |
92 |
93 |
94 | public static interface WeemoVideoInFrame.OnWeemoVideoInFrameTouchListener
95 | Interface definition for a callback to be invoked when a touch event is dispatched to this view. The callback will be invoked before the touch event is given to the view.
96 | Author:
97 | Simon Marquis
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | Method Summary
110 |
111 | Methods
112 |
113 | Modifier and Type
114 | Method and Description
115 |
116 |
117 | void
118 | onWeemoVideoInFrameTouch (MotionEvent event)
119 | Called when a touch event is dispatched to a view.
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
171 |
172 |
176 |
180 |
183 |
184 |
194 |
195 |
196 |
197 | Summary:
198 | Nested |
199 | Field |
200 | Constr |
201 | Method
202 |
203 |
204 | Detail:
205 | Field |
206 | Constr |
207 | Method
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/view/package-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.view
7 |
8 |
9 |
10 |
11 |
12 |
13 |
Interfaces
14 |
18 |
Classes
19 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/view/package-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.view
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
71 |
72 |
73 |
74 |
95 |
96 |
97 |
124 |
125 |
126 |
127 |
128 |
129 |
Package com.weemo.sdk.view Description
130 |
Base package for Weemo SDK Views for Android
131 |
132 |
133 |
148 |
175 |
176 |
177 |
178 |
--------------------------------------------------------------------------------
/libs/javadoc/html/com/weemo/sdk/view/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.weemo.sdk.view Class Hierarchy
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
71 |
72 |
Class Hierarchy
73 |
74 | java.lang.Object
75 |
92 |
93 |
94 |
Interface Hierarchy
95 |
99 |
100 |
101 |
116 |
117 |
118 | Prev
119 | Next
120 |
121 |
125 |
128 |
129 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
--------------------------------------------------------------------------------
/libs/javadoc/html/help-doc.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | API Help
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
68 |
69 |
70 |
71 | Overview
72 | The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
73 |
74 |
75 | Package
76 | Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
77 |
78 | Interfaces (italic)
79 | Classes
80 | Enums
81 | Exceptions
82 | Errors
83 | Annotation Types
84 |
85 |
86 |
87 | Class/Interface
88 | Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
89 |
90 | Class inheritance diagram
91 | Direct Subclasses
92 | All Known Subinterfaces
93 | All Known Implementing Classes
94 | Class/interface declaration
95 | Class/interface description
96 |
97 |
98 | Nested Class Summary
99 | Field Summary
100 | Constructor Summary
101 | Method Summary
102 |
103 |
104 | Field Detail
105 | Constructor Detail
106 | Method Detail
107 |
108 | Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
109 |
110 |
111 | Annotation Type
112 | Each annotation type has its own separate page with the following sections:
113 |
114 | Annotation Type declaration
115 | Annotation Type description
116 | Required Element Summary
117 | Optional Element Summary
118 | Element Detail
119 |
120 |
121 |
122 | Enum
123 | Each enum has its own separate page with the following sections:
124 |
125 | Enum declaration
126 | Enum description
127 | Enum Constant Summary
128 | Enum Constant Detail
129 |
130 |
131 |
132 | Tree (Class Hierarchy)
133 | There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
134 |
135 | When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
136 | When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
137 |
138 |
139 |
140 | Deprecated API
141 | The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
142 |
143 |
144 | Index
145 | The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
146 |
147 |
148 | Prev/Next
149 | These links take you to the next or previous class, interface, package, or related page.
150 |
151 |
152 | Frames/No Frames
153 | These links show and hide the HTML frames. All pages are available with or without frames.
154 |
155 |
156 | All Classes
157 | The All Classes link shows all classes and interfaces except non-static nested types.
158 |
159 |
160 | Serialized Form
161 | Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
162 |
163 |
164 | Constant Field Values
165 | The Constant Field Values page lists the static final fields and their values.
166 |
167 |
168 |
This help file applies to API documentation generated using the standard doclet.
169 |
170 |
185 |
186 |
187 | Prev
188 | Next
189 |
190 |
194 |
197 |
198 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
--------------------------------------------------------------------------------
/libs/javadoc/html/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Generated Documentation (Untitled)
7 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | JavaScript is disabled on your browser.
62 |
63 | Frame Alert
64 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to Non-frame version .
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/libs/javadoc/html/overview-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Overview List
7 |
8 |
9 |
10 |
11 |
12 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/libs/javadoc/html/overview-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Overview
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
113 |
114 |
129 |
130 |
131 | Prev
132 | Next
133 |
134 |
138 |
141 |
142 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
--------------------------------------------------------------------------------
/libs/javadoc/html/package-list:
--------------------------------------------------------------------------------
1 | com.weemo.sdk
2 | com.weemo.sdk.event
3 | com.weemo.sdk.event.call
4 | com.weemo.sdk.event.global
5 | com.weemo.sdk.event.meetingpoint
6 | com.weemo.sdk.exception
7 | com.weemo.sdk.view
8 |
--------------------------------------------------------------------------------
/libs/javadoc/html/resources/background.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/libs/javadoc/html/resources/background.gif
--------------------------------------------------------------------------------
/libs/javadoc/html/resources/tab.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/libs/javadoc/html/resources/tab.gif
--------------------------------------------------------------------------------
/libs/javadoc/html/resources/titlebar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/libs/javadoc/html/resources/titlebar.gif
--------------------------------------------------------------------------------
/libs/javadoc/html/resources/titlebar_end.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/libs/javadoc/html/resources/titlebar_end.gif
--------------------------------------------------------------------------------
/libs/javadoc/html/serialized-form.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Serialized Form
7 |
8 |
9 |
10 |
11 |
17 |
18 | JavaScript is disabled on your browser.
19 |
20 |
21 |
36 |
63 |
64 |
67 |
121 |
122 |
137 |
138 |
139 | Prev
140 | Next
141 |
142 |
146 |
149 |
150 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
--------------------------------------------------------------------------------
/libs/javadoc/rtcc-5.4.730-javadoc.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/libs/javadoc/rtcc-5.4.730-javadoc.jar
--------------------------------------------------------------------------------
/libs/rtcc-5.4.730-javadoc.jar.properties:
--------------------------------------------------------------------------------
1 | doc=javadoc/html/
--------------------------------------------------------------------------------
/libs/rtcc-5.4.730.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/libs/rtcc-5.4.730.jar
--------------------------------------------------------------------------------
/libs/volley.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/libs/volley.jar
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xaccc/Communicator-for-Android/0a732cef527183d3f6cea1ca3577a0f5d6e757b3/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable/circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/greencircle.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/redcircle.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/selectable_bg_blue.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/drawable/selectable_bg_green.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/drawable/selectable_bg_red.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/layout/activity_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
15 |
16 |
17 |
21 |
22 |
23 |
28 |
29 |
30 |
36 |
37 |
38 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
14 |
15 |
17 |
18 |
19 |
21 |
22 |
24 |
25 |
28 |
29 |
33 |
34 |
35 |
36 |
39 |
40 |
41 |
42 |
44 |
45 |
46 |
47 |
48 |
49 |
53 |
54 |
57 |
58 |
64 |
65 |
73 |
74 |
75 |
76 |
77 |
78 |
82 |
83 |
87 |
88 |
89 |
90 |
96 |
97 |
105 |
106 |
107 |
108 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/res/layout/custom_spinner.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values-sw720dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | 128dp
8 |
9 |
10 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #33b5e5
5 | #99CC00
6 | #FF4444
7 | #88888888
8 | #9933B5E5
9 | #88FF4444
10 | #88888888
11 |
12 | #ddd
13 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Communicator
5 | Logout
6 |
7 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/com/sightcall/Communicator/AspectLockedFrameLayout.java:
--------------------------------------------------------------------------------
1 | package com.sightcall.Communicator;
2 |
3 | /***
4 | Copyright (c) 2013 CommonsWare, LLC
5 | Portions Copyright (C) 2009 The Android Open Source Project
6 |
7 | From: https://github.com/commonsguy/cwac-layouts
8 |
9 | Licensed under the Apache License, Version 2.0 (the "License"); you may
10 | not use this file except in compliance with the License. You may obtain
11 | a copy of the License at
12 | http://www.apache.org/licenses/LICENSE-2.0
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 | */
19 |
20 | import android.widget.FrameLayout;
21 |
22 | import android.content.Context;
23 | import android.util.AttributeSet;
24 | import android.view.View;
25 | import android.widget.FrameLayout;
26 |
27 |
28 | public class AspectLockedFrameLayout extends FrameLayout {
29 |
30 | private double aspectRatio=0.0;
31 | private AspectRatioSource aspectRatioSource=null;
32 |
33 | public AspectLockedFrameLayout(Context context) {
34 | super(context);
35 | }
36 |
37 | public AspectLockedFrameLayout(Context context, AttributeSet attrs) {
38 | super(context, attrs);
39 | }
40 |
41 | // from com.android.camera.PreviewFrameLayout, with slight
42 | // modifications
43 |
44 | @Override
45 | protected void onMeasure(int widthSpec, int heightSpec) {
46 | double localRatio=aspectRatio;
47 |
48 | if (localRatio == 0.0 && aspectRatioSource != null
49 | && aspectRatioSource.getHeight() > 0) {
50 | localRatio=
51 | (double)aspectRatioSource.getWidth()
52 | / (double)aspectRatioSource.getHeight();
53 | }
54 |
55 | if (localRatio == 0.0) {
56 | super.onMeasure(widthSpec, heightSpec);
57 | }
58 | else {
59 | int lockedWidth=MeasureSpec.getSize(widthSpec);
60 | int lockedHeight=MeasureSpec.getSize(heightSpec);
61 |
62 | if (lockedWidth == 0 && lockedHeight == 0) {
63 | throw new IllegalArgumentException(
64 | "Both width and height cannot be zero -- watch out for scrollable containers");
65 | }
66 |
67 | // Get the padding of the border background.
68 | int hPadding=getPaddingLeft() + getPaddingRight();
69 | int vPadding=getPaddingTop() + getPaddingBottom();
70 |
71 | // Resize the preview frame with correct aspect ratio.
72 | lockedWidth-=hPadding;
73 | lockedHeight-=vPadding;
74 |
75 | if (lockedHeight > 0 && (lockedWidth > lockedHeight * localRatio)) {
76 | lockedWidth=(int)(lockedHeight * localRatio + .5);
77 | }
78 | else {
79 | lockedHeight=(int)(lockedWidth / localRatio + .5);
80 | }
81 |
82 | // Add the padding of the border.
83 | lockedWidth+=hPadding;
84 | lockedHeight+=vPadding;
85 |
86 | // Ask children to follow the new preview dimension.
87 | super.onMeasure(MeasureSpec.makeMeasureSpec(lockedWidth,
88 | MeasureSpec.EXACTLY),
89 | MeasureSpec.makeMeasureSpec(lockedHeight,
90 | MeasureSpec.EXACTLY));
91 | }
92 | }
93 |
94 | public void setAspectRatioSource(View v) {
95 | this.aspectRatioSource=new ViewAspectRatioSource(v);
96 | }
97 |
98 | public void setAspectRatioSource(AspectRatioSource aspectRatioSource) {
99 | this.aspectRatioSource=aspectRatioSource;
100 | }
101 |
102 | // from com.android.camera.PreviewFrameLayout, with slight
103 | // modifications
104 |
105 | public void setAspectRatio(double aspectRatio) {
106 | if (aspectRatio <= 0.0) {
107 | throw new IllegalArgumentException("aspect ratio must be positive");
108 | }
109 |
110 | if (this.aspectRatio != aspectRatio) {
111 | this.aspectRatio=aspectRatio;
112 | requestLayout();
113 | }
114 | }
115 |
116 | public interface AspectRatioSource {
117 | int getWidth();
118 |
119 | int getHeight();
120 | }
121 |
122 | private static class ViewAspectRatioSource implements
123 | AspectRatioSource {
124 | private View v=null;
125 |
126 | ViewAspectRatioSource(View v) {
127 | this.v=v;
128 | }
129 |
130 | @Override
131 | public int getWidth() {
132 | return(v.getWidth());
133 | }
134 |
135 | @Override
136 | public int getHeight() {
137 | return(v.getHeight());
138 | }
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/src/com/sightcall/Communicator/LoginActivity.java:
--------------------------------------------------------------------------------
1 | package com.sightcall.Communicator;
2 |
3 | import org.json.JSONObject;
4 |
5 | import com.android.volley.RequestQueue;
6 | import com.android.volley.Response;
7 | import com.android.volley.VolleyError;
8 | import com.android.volley.VolleyLog;
9 | import com.android.volley.toolbox.Volley;
10 | import com.sightcall.api.Api;
11 | import com.sightcall.api.JsonObjectRequestBasicAuth;
12 | import android.app.Activity;
13 | import android.app.AlertDialog;
14 | import android.content.Context;
15 | import android.content.DialogInterface;
16 | import android.content.Intent;
17 | import android.os.Bundle;
18 | import android.util.Log;
19 | import android.view.View;
20 | import android.widget.Button;
21 | import android.widget.EditText;
22 | import android.widget.Toast;
23 |
24 | public class LoginActivity extends Activity {
25 |
26 | // Email, Password text fields
27 | EditText txtUsername, txtPassword;
28 |
29 | // login button
30 | Button btnLogin;
31 |
32 | // Request queue containing the token request
33 | RequestQueue mRequestQueue;
34 |
35 | // Session Manager Class
36 | SessionManager session;
37 |
38 | public static final String TAG = "LoginActivity";
39 |
40 | @Override
41 | public void onCreate(Bundle savedInstanceState) {
42 | super.onCreate(savedInstanceState);
43 | setContentView(R.layout.activity_login);
44 |
45 | Log.d(TAG, "onCreate");
46 |
47 | // Session Manager
48 | session = new SessionManager(getApplicationContext());
49 |
50 | // HTTP request manager for Volley
51 | mRequestQueue = Volley.newRequestQueue(this);
52 |
53 | // Email, Password input text
54 | txtUsername = (EditText) findViewById(R.id.txtUsername);
55 | txtPassword = (EditText) findViewById(R.id.txtPassword);
56 |
57 | // Prefill fields if previously set
58 | if (session.getUsername() != null) {
59 | txtUsername.setText(session.getUsername());
60 | }
61 |
62 | if (session.getPassword() != null) {
63 | txtPassword.setText(session.getPassword());
64 | }
65 |
66 | //Toast.makeText(getApplicationContext(), "User Login Status: " + session.isLoggedIn(), Toast.LENGTH_LONG).show();
67 | Toast.makeText(getApplicationContext(), "User Login Status: ", Toast.LENGTH_LONG).show();
68 |
69 | // Login button
70 | btnLogin = (Button) findViewById(R.id.btnLogin);
71 |
72 | // Login button click event
73 | btnLogin.setOnClickListener(new View.OnClickListener() {
74 |
75 | @Override
76 | public void onClick(View arg0) {
77 | // Get username, password from EditText
78 | final String username = txtUsername.getText().toString();
79 | final String password = txtPassword.getText().toString();
80 |
81 | // Check if username, password is filled
82 | if(username.trim().length() > 0 && password.trim().length() > 0){
83 |
84 | Api api = new Api(username, password);
85 |
86 | // retrieve my displayname and UID with the /me method
87 | JsonObjectRequestBasicAuth jsonObjReq = api.me(new Response.Listener() {
88 |
89 | @Override
90 | public void onResponse(JSONObject response) {
91 | Log.d(TAG, response.toString());
92 | JSONObject jme = response.optJSONObject("me");
93 | if (jme != null) {
94 | String displayname = jme.optString("name", null);
95 | String uid = jme.optString("rtcc_uid", null);
96 |
97 | session.createLoginSession(username, password, displayname, uid);
98 |
99 | // Staring MainActivity
100 | Intent i = new Intent(getApplicationContext(), MainActivity.class);
101 | startActivity(i);
102 | finish();
103 | }
104 | else {
105 | showAlertDialog(LoginActivity.this, "Login failed..", "Could not retrieve identity", false);
106 | }
107 | }
108 | }, new Response.ErrorListener() {
109 |
110 | @Override
111 | public void onErrorResponse(VolleyError error) {
112 | VolleyLog.d(TAG, "Error: " + error.getMessage());
113 | // username / password doesn't match
114 | showAlertDialog(LoginActivity.this, "Login failed..", "Username/Password is incorrect", false);
115 | }
116 | });
117 | jsonObjReq.setTag(Api.REQUEST_ME);
118 | mRequestQueue.add(jsonObjReq);
119 | }else{
120 | // user didn't entered username or password
121 | // Show alert asking him to enter the details
122 | showAlertDialog(LoginActivity.this, "Login failed..", "Please enter username and password", false);
123 | }
124 |
125 | }
126 | });
127 | }
128 |
129 | public void showAlertDialog(Context ctx, String title, String message, boolean cancelable)
130 | {
131 | new AlertDialog.Builder(ctx)
132 | .setTitle(title)
133 | .setMessage(message)
134 | .setCancelable(cancelable)
135 | .setNeutralButton("Ok", new DialogInterface.OnClickListener() {
136 | public void onClick(DialogInterface dialog, int id) {
137 | }
138 | })
139 | .show();
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/src/com/sightcall/Communicator/SessionManager.java:
--------------------------------------------------------------------------------
1 | package com.sightcall.Communicator;
2 |
3 | /**
4 | * The Session Manager handles the login and logout of the user. Because the App is
5 | * authenticated using an API, an HTTP method call is used to determine if the username/password
6 | * are accepted. We choose to use the api.me method - which returns the name and UID of the user,
7 | * if the username/password are correct.
8 | *
9 | * If login is accepted, the Session Manager caches the username, password, name and UID of the
10 | * user.
11 | *
12 | * The Session Manager also provides slots for storing and retrieving a presence and a list of friends.
13 | *
14 | */
15 |
16 | import java.util.HashMap;
17 |
18 | import android.content.Context;
19 | import android.content.Intent;
20 | import android.content.SharedPreferences;
21 | import android.content.SharedPreferences.Editor;
22 |
23 |
24 | public class SessionManager {
25 | // Shared Preferences
26 | SharedPreferences pref;
27 |
28 | // Editor for Shared preferences
29 | Editor editor;
30 |
31 | // Context
32 | Context _context;
33 |
34 | // Shared pref mode
35 | int PRIVATE_MODE = 0;
36 |
37 | // Sharedpref file name
38 | private static final String PREF_NAME = "TutorialPref";
39 |
40 | // All Shared Preferences Keys
41 | private static final String IS_LOGIN = "IsLoggedIn";
42 |
43 | // User name (make variable public to access from outside)
44 | public static final String KEY_USERNAME = "username";
45 |
46 | // Password
47 | public static final String KEY_PASSWORD = "password";
48 |
49 | // My displayname
50 | public static final String KEY_DISPLAYNAME = "displayname";
51 |
52 | // My UID
53 | public static final String KEY_UID = "uid";
54 |
55 | // My presence
56 | public static final String KEY_PRESENCE = "presence";
57 |
58 | // My friends, serialized JSON
59 | public static final String KEY_FRIENDS = "friends";
60 |
61 |
62 |
63 |
64 | // Constructor
65 | public SessionManager(Context context){
66 | this._context = context;
67 | pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
68 | editor = pref.edit();
69 | }
70 |
71 | /**
72 | * Create login session
73 | * */
74 | public void createLoginSession(String username, String password, String displayname, String uid){
75 | // Storing login value as TRUE
76 | editor.putBoolean(IS_LOGIN, true);
77 |
78 | // Store items in pref
79 | editor.putString(KEY_USERNAME, username);
80 | editor.putString(KEY_PASSWORD, password);
81 | editor.putString(KEY_DISPLAYNAME, displayname);
82 | editor.putString(KEY_UID, uid);
83 |
84 | // commit changes
85 | editor.commit();
86 | }
87 |
88 | /**
89 | * Check login method will check user login status
90 | * If false it will redirect user to login page
91 | * Else won't do anything
92 | * */
93 | public void checkLogin(){
94 | // Check login status
95 | if(!this.isLoggedIn()){
96 | // user is not logged in redirect him to Login Activity
97 | Intent i = new Intent(_context, LoginActivity.class);
98 | // Closing all the Activities
99 | i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
100 |
101 | // Add new Flag to start new Activity
102 | i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
103 |
104 | // Staring Login Activity
105 | _context.startActivity(i);
106 | }
107 |
108 | }
109 |
110 |
111 | /**
112 | * Get stored session data
113 | * */
114 | public HashMap getUserDetails(){
115 | HashMap user = new HashMap();
116 |
117 | user.put(KEY_USERNAME, pref.getString(KEY_USERNAME, null));
118 | user.put(KEY_PASSWORD, pref.getString(KEY_PASSWORD, null));
119 | user.put(KEY_DISPLAYNAME, pref.getString(KEY_DISPLAYNAME, null));
120 | user.put(KEY_UID, pref.getString(KEY_UID, null));
121 |
122 | // return user
123 | return user;
124 | }
125 |
126 | /**
127 | * Clear session details
128 | * */
129 | public void logoutUser(){
130 | // Clearing all data from Shared Preferences
131 | // editor.clear();
132 | editor.remove(KEY_DISPLAYNAME);
133 | editor.remove(KEY_UID);
134 | editor.remove(KEY_FRIENDS);
135 | editor.remove(IS_LOGIN);
136 | editor.commit();
137 |
138 | // After logout redirect user to Login Activity
139 | Intent i = new Intent(_context, LoginActivity.class);
140 | // Closing all the Activities
141 | i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
142 |
143 | // Add new Flag to start new Activity
144 | i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
145 |
146 | // Staring Login Activity
147 | _context.startActivity(i);
148 | }
149 |
150 | /**
151 | * Quick check for login
152 | * **/
153 | // Get Login State
154 | public boolean isLoggedIn(){
155 | return pref.getBoolean(IS_LOGIN, false);
156 | }
157 |
158 | public String getUsername() {
159 | return pref.getString(KEY_USERNAME, null);
160 | }
161 |
162 | public String getPassword() {
163 | return pref.getString(KEY_PASSWORD, null);
164 | }
165 |
166 | public String getUid() {
167 | return pref.getString(KEY_UID, null);
168 | }
169 |
170 | /**
171 | * for saving/restoring my presence
172 | */
173 | public void setPresence(Integer value) {
174 | editor.putInt(KEY_PRESENCE, value);
175 | editor.commit();
176 | }
177 |
178 | public Integer getPresence() {
179 | return pref.getInt(KEY_PRESENCE, 0);
180 | }
181 |
182 | /**
183 | * for saving/restoring friends and presences
184 | */
185 | public void setFriends(String f) {
186 | editor.putString(KEY_FRIENDS, f);
187 | editor.commit();
188 | }
189 |
190 | public String getFriends() {
191 | return pref.getString(KEY_FRIENDS, null);
192 | }
193 | }
--------------------------------------------------------------------------------
/src/com/sightcall/Communicator/UserCustomArrayAdapter.java:
--------------------------------------------------------------------------------
1 | package com.sightcall.Communicator;
2 |
3 | /***
4 | * This array adapter renders our custom view for each user in the spinner.
5 | * The view renders a user's presence as a colored circle and sets the name as the text of the view.
6 | * See layout/custom_spinner.xml for the layout.
7 | */
8 |
9 | import java.util.List;
10 |
11 | import android.content.Context;
12 | import android.graphics.Color;
13 | import android.view.LayoutInflater;
14 | import android.view.View;
15 | import android.view.ViewGroup;
16 | import android.view.LayoutInflater;
17 | import android.widget.ArrayAdapter;
18 | import android.widget.TextView;
19 |
20 | import com.sightcall.api.User;
21 | import com.sightcall.Communicator.R;
22 |
23 | public class UserCustomArrayAdapter extends ArrayAdapter {
24 |
25 | public UserCustomArrayAdapter(Context ctx, int txtViewResourceId, List mFriends) {
26 | super(ctx, txtViewResourceId, mFriends);
27 | }
28 |
29 | @Override
30 | public View getDropDownView(int position, View cnvtView, ViewGroup prnt) {
31 | return getCustomView(position, cnvtView, prnt);
32 | }
33 |
34 | @Override
35 | public View getView(int position, View cnvtView, ViewGroup prnt) {
36 | return getCustomView(position, cnvtView, prnt);
37 | }
38 |
39 | // Render the view for the selected item in the spinner
40 | public View getCustomView(int position, View convertView, ViewGroup parent) {
41 |
42 | LayoutInflater inflater = LayoutInflater.from(getContext());
43 | View mySpinner = inflater.inflate(R.layout.custom_spinner, parent, false);
44 |
45 | TextView main = (TextView) mySpinner.findViewById(R.id.spinner_item_name);
46 |
47 | View circle = (View) mySpinner.findViewById(R.id.spinner_item_circle);
48 |
49 | User user = (User) getItem(position);
50 | main.setText(user.name);
51 |
52 | if (user.presence == 0) {
53 | circle.setBackground( getContext().getResources().getDrawable(R.drawable.redcircle));
54 | }
55 | else if (user.presence == 1) {
56 | circle.setBackground( getContext().getResources().getDrawable(R.drawable.greencircle));
57 | }
58 | else {
59 | circle.setBackground( getContext().getResources().getDrawable(R.drawable.circle));
60 | }
61 |
62 | return mySpinner;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/com/sightcall/api/Api.java:
--------------------------------------------------------------------------------
1 | package com.sightcall.api;
2 |
3 | /**
4 | * The SightCall Communicator API is protected by HTTP Basic Authentication.
5 | * This package provides a thin wrapper around a Volley authenticated request manager.
6 | */
7 |
8 | import org.json.JSONObject;
9 |
10 | import android.util.Log;
11 |
12 | import com.android.volley.Request.Method;
13 | import com.android.volley.Response.ErrorListener;
14 | import com.android.volley.Response.Listener;
15 |
16 | public class Api {
17 |
18 | // The Base URL of the API
19 | // final String baseurl = "http://192.168.1.233:3000/api";
20 | final String baseurl = "https://sightcall-communicator.herokuapp.com/api";
21 | // final String baseurl = "https://thawing-harbor-4536.herokuapp.com/api";
22 |
23 | /**
24 | * Tags to identify the request to request queue
25 | */
26 | public static final String REQUEST_TOKEN = "token";
27 | public static final String REQUEST_APPID = "appid";
28 | public static final String REQUEST_ME = "me";
29 | public static final String REQUEST_FRIENDS = "friends";
30 |
31 | /**
32 | * This simple API is authenticated by username/password.
33 | */
34 | String username = null;
35 | String password = null;
36 |
37 | public Api(String username, String password) {
38 | this.username = username;
39 | this.password = password;
40 | Log.d("API", "new:" + username + ":" + password + ":");
41 | }
42 |
43 |
44 | public JsonObjectRequestBasicAuth token(Listener listener, ErrorListener errorListener) {
45 | String url = this.baseurl + "/token";
46 |
47 | JsonObjectRequestBasicAuth jsonObjReq = new JsonObjectRequestBasicAuth(username, password,
48 | Method.GET, url, null, listener, errorListener);
49 |
50 | return jsonObjReq;
51 | }
52 |
53 | public JsonObjectRequestBasicAuth appid(Listener listener, ErrorListener errorListener) {
54 | String url = this.baseurl + "/appid";
55 |
56 | JsonObjectRequestBasicAuth jsonObjReq = new JsonObjectRequestBasicAuth(username, password,
57 | Method.GET, url, null, listener, errorListener);
58 |
59 | return jsonObjReq;
60 | }
61 |
62 | public JsonObjectRequestBasicAuth friends(Listener listener, ErrorListener errorListener) {
63 | String url = this.baseurl + "/friends";
64 |
65 | JsonObjectRequestBasicAuth jsonObjReq = new JsonObjectRequestBasicAuth(username, password,
66 | Method.GET, url, null, listener, errorListener);
67 |
68 | return jsonObjReq;
69 | }
70 |
71 | public JsonObjectRequestBasicAuth me(Listener listener, ErrorListener errorListener) {
72 | String url = this.baseurl + "/me";
73 |
74 | JsonObjectRequestBasicAuth jsonObjReq = new JsonObjectRequestBasicAuth(username, password,
75 | Method.GET, url, null, listener, errorListener);
76 |
77 | return jsonObjReq;
78 |
79 | }
80 |
81 | }
--------------------------------------------------------------------------------
/src/com/sightcall/api/JsonObjectRequestBasicAuth.java:
--------------------------------------------------------------------------------
1 | package com.sightcall.api;
2 |
3 | /**
4 | * Simple extension to Volley's JsonObjectRequest to provide an HTTP Basic Authentication
5 | * header on a request.
6 | */
7 |
8 | import java.util.HashMap;
9 | import java.util.Map;
10 |
11 | import org.json.JSONObject;
12 |
13 | import android.util.Base64;
14 |
15 | import com.android.volley.AuthFailureError;
16 | import com.android.volley.Response.ErrorListener;
17 | import com.android.volley.Response.Listener;
18 | import com.android.volley.toolbox.JsonObjectRequest;
19 |
20 | public class JsonObjectRequestBasicAuth extends JsonObjectRequest {
21 |
22 | String username = null;
23 | String password = null;
24 |
25 | public JsonObjectRequestBasicAuth(String user, String pass,
26 | int method, String url, JSONObject jsonRequest,
27 | Listener listener, ErrorListener errorListener) {
28 |
29 | super(method, url, jsonRequest, listener, errorListener);
30 |
31 | // Simply store these values for use by getHeaders
32 | username = user;
33 | password = pass;
34 |
35 | }
36 |
37 | @Override
38 |
39 | public Map getHeaders() throws AuthFailureError {
40 |
41 | // Provide an authentication header
42 | HashMap headers = new HashMap();
43 | String creds = String.format("%s:%s", username, password);
44 | String auth = "Basic " + Base64.encodeToString(creds.getBytes(), Base64.DEFAULT);
45 | headers.put("Authorization", auth);
46 | return headers;
47 | }
48 | }
--------------------------------------------------------------------------------
/src/com/sightcall/api/User.java:
--------------------------------------------------------------------------------
1 | package com.sightcall.api;
2 |
3 | /**
4 | * A Very simple User model. The API returns a list of friends - including their name and UID.
5 | * Here, we also define a slot for the user's presence. When presence values are received from the
6 | * RTCC cloud, we search the mFriends list and update the appropriate friend.
7 | *
8 | * The list of friends (mFriends) is converted to JSON and serialized to save/restore the main
9 | * activity. Class methods are defined here to aid in the conversions.
10 | *
11 | */
12 |
13 |
14 | import java.util.ArrayList;
15 | import org.json.JSONArray;
16 | import org.json.JSONException;
17 | import org.json.JSONObject;
18 |
19 | import android.util.Log;
20 |
21 |
22 | public class User{
23 |
24 | public String name;
25 | public String uid;
26 | public int presence;
27 |
28 | public User(String name, String uid) {
29 | this.name = name;
30 | this.uid = uid;
31 | this.presence = 0;
32 | }
33 |
34 | // Create a User from a Json object. Fields 'name' and 'rtcc_uid' are required.
35 | // The 'presence' field is not returned by the Communicator HTTP API, but when a User
36 | // is serialized to JSON for save/restore, it is included.
37 | public User(JSONObject object){
38 | try {
39 | // objects from the API have these two fields
40 | this.name = object.getString("name");
41 | this.uid = object.getString("rtcc_uid");
42 |
43 | // objects serialized from Main activity also have this field
44 | if (object.has("presence")) {
45 | this.presence = object.getInt("presence");
46 | }
47 | } catch (JSONException e) {
48 | e.printStackTrace();
49 | }
50 | }
51 |
52 | // Create a JSON object from a User
53 | public JSONObject toJson() throws JSONException {
54 | JSONObject j = new JSONObject();
55 | j.put("name", this.name);
56 | j.put("rtcc_uid", this.uid);
57 | j.put("presence", this.presence);
58 | return j;
59 | }
60 |
61 | /**
62 | *
63 | * What follows are utilities for operating on Lists of User objects.
64 | *
65 | */
66 |
67 | // User.fromJson(jsonArray);
68 | public static ArrayList fromJson(JSONArray jsonObjects) {
69 | ArrayList users = new ArrayList();
70 | for (int i = 0; i < jsonObjects.length(); i++) {
71 | try {
72 | users.add(new User(jsonObjects.getJSONObject(i)));
73 | } catch (JSONException e) {
74 | e.printStackTrace();
75 | }
76 | }
77 | return users;
78 | }
79 |
80 | // User.toJson(ArrayList)
81 | public static JSONArray toJson(ArrayList users) throws JSONException {
82 | JSONArray jsonObjects = new JSONArray();
83 | if (users == null) {
84 | return jsonObjects;
85 | }
86 | for (User u: users) {
87 | JSONObject j = u.toJson();
88 | jsonObjects.put(j); // TOM: puts at end of list
89 | }
90 | return jsonObjects;
91 | }
92 |
93 | // User.findByUid(ArrayList users)
94 | public static User findByUid(ArrayList users, String uid) {
95 | if (users == null) {
96 | return null;
97 | }
98 | for (User u: users) {
99 | // Log.d("U", "LOOKING UID:" + u.uid);
100 | if (u.uid.equals(uid)) {
101 | // Log.d("U", "Found UID:" + uid);
102 | return u;
103 | }
104 | }
105 | // Log.d("U", "Not Found UID" + uid);
106 | return null;
107 | }
108 |
109 |
110 |
111 | }
112 |
113 |
114 |
--------------------------------------------------------------------------------