The objective of this project is to write a simple Apple WatchOS6 application (for Apple Watch all series) that connects to a binary websocket server, receives strings and images, and deals with those received elements in the UI.
There are two main aspects in the technical development of this application:
- the application needs to use URLSessionWebSocketTask, now available in watchOS 6, to connect to a websocket.
- the application needs to create, handle, merge and draw bitmaps.
A demo of the application is available at [login to view URL]
The application has a welcome screen with a connect button. When this button is pressed, the websocket is opened against the server (IP addresss: [login to view URL], port:7684, protocol: inout). If the connection is successful, the user accesses the main UI.
In the main UI, the websocket can receive strings with ball bounces. The format is:
inout x y timestamp
The two buttons "previous" and "next" can be used to navigate the history of bounces.
If the user press the court, a request to the websocket server is made in order to receive the jpeg 240x240 image of that specific bounce. The received jpeg image is shown in fullscreen on the UI.
The first byte of the websocket message is either 1 for a string or 46 for a jpeg image.
Requirement environment and tool: watchOS 6, Xcode 11.
Additional requirement: The application should be native and should *NOT* use a framework such as native react. No external library or third-party block should be used. It's a requirement to use the watchOS 6 websocket (read this link: [login to view URL]). Also, the elements ([login to view URL], ball*.png for each bounce) must be prepared, merged and drawn in a single 'offline' bitmap which then should be rendered in the UI.
I estimate one day of work to complete the project if you have the right experience of Apple Mobile app development.