Teigha Cloud: Implementing Clients on Mobile Platforms
May 23, 2017
When CAD developers create a mobile client for Teigha Cloud, they can face peculiarities on different mobile platforms. This article describes suggestions for developers who want to design their own client on iOS and Android platforms.
On different platforms, the API of an HTTP client is variable. The main requirement for clients is supporting long-poll requests. The Teigha Cloud server uses a long-poll mechanism for sending graphical data to clients.
iOS has NSURLSession and NSURLConnection for http/https requests. Android has UrlConnection and NetworkFragment for these purposes. But, it is recommended to use wrappers on a default client (see below).
First, it supports Open GL ES 2.0. Your app must have support for GL ES2, and the SDK of the mobile OS must have tools for working with it.
iOS has GLKViewController and GLKView for working with GL ES2 which are located in GLKit. GLKViewController contains GLKView embedded (see here).
Android has GLSurfaceView and GLSurfaceView.Renderer. GLSurfaceView contains methods for configuring the screen, such as configuring depth color and updating screen policy, and GLSurfaceView.Renderer contains the rendering configuration (see here and here).
The following libraries are recommended for your mobile app:
• Alamofire (iOS): REST client that supports async work and works with long-polling.
• Haneke (iOS): Tool that helps download a preview of uploaded files.
• JASON: Fast json parser.
• AsyncHttpClient (Android): Async rest client that supports background work and works with long-polling.
• Picasso (Android): Tool to download previews of uploaded files.
• Moshi (Android): A json parser.