Skip to content
Vangos Pterneas edited this page May 22, 2018 · 4 revisions

Azure App Service SDK for Unity3D

The LightBuzz Azure App Service SDK for Unity3D is a framework that allows you to consume remote Azure services and even store data locally. It's secured using HTTPS. Supports Android, iOS, Windows Standalone, Mac OS, and UWP (including HoloLens).

It's across-platform SDK you can actually use in your apps and games without compatibility problems.

lightbuzz-azure-unity

To use the SDK, you can either clone the current repository or download the .unitypackage file from the Releases section.

Features

Azure App Services

The LightBuzz Azure SDK for Unity consumes Azure App Service APIs. Azure App Services are integrated services that enable you to create web and mobile apps for any platform or device.

HTTPS

The LightBuzz SDK is built with security in mind. The native Microsoft HttpClient modules do not support HTTPS in Unity. Our team has built the HTTP requests from scratch using the UnityWebRequest class. This way, your data are encrypted and transmitted securely.

HTTP(S) methods

The LightBuzz SDK supports all of the HTTP(S) method requests.

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE

Local Database

Unlike most of the available SDKs, the LightBuzz Azure SDK for Unity fully supports local database storage. This means you can use the Azure App Services to store data into a local SQLite database. You can sync your local data with the remote server, performing pull and push operations. As a result, your customers can use your app/game without an active Internet connection!

The local database is using the official version of SQLite. SQLite is the most popular and lightweight relational database system for desktop and mobile devices. For UWP, we are using SQLitePCL, which is Microsoft's recommendation for Windows Store apps.

Supported Platforms

The LightBuzz Azure SDK for Unity supports the following platforms:

  • Unity Editor
  • Android
  • iOS
  • Windows Desktop (Standalone)
  • MacOS (Standalone)
  • Universal Windows Platform (UWP) + HoloLens

lightbuzz-azure-hololens

Requirements

To use the SDK, Unity 2017 LTS or Unity 2018 is recommended.

Scripting Runtime

The SDK is built with the latest C# features, so you need to use the .NET 4.x Scripting Runtime version.

In Unity 2018, the scripting runtime is set to 4.x by default.

unity-2018-scripting-runtime

In Unity 2017, you need to explicitly select "Experimental (.NET 4.6 Equivalent)".

unity-2017-scripting-runtime

Scripting Backend

The SDK works with the following Scripting Backend options:

Platform Scripting Backend
Standalone Mono
Android Mono
iOS IL2CPP
UWP .NET

Apply Build Settings

Using the SDK, you can apply the proper Unity Build Settings automatically. On the Unity menu bar, select LightBuzzApply Build Settings for... and then select the target platform. The SDK will automatically apply the proper build settings for you.

lightbuzz-build-settings

How to use

In the included samples, we have created a simple demo that implements Microsoft's ToDo List example.

We have implemented a generic Data Access Object for you to use, called MobileAppsTableDAO. The MobileAppsTableDAO supports all of the common HTTP & HTTPS operations out-of-the-box. All you need to do is call the proper C# methods.

Using the code is fairly simple:

Initialization

private MobileServiceClient azureClient;
private MobileAppsTableDAO<TodoItem> todoTableDAO;

private async Task Init()
{
    azureClient = new MobileServiceClient(mobileAppUri, new LightBuzzMobileServiceClient());
    todoTableDAO = new MobileAppsTableDAO<TodoItem>(azureClient);

    if (todoTableDAO.SupportsLocalStore)
    {
        await LocalStore.Init(azureClient);
        await LocalStore.Sync();
    }
}

Get

private async Task Get()
{
    List<TodoItem> list = await todoTableDAO.FindAll();

    foreach (TodoItem item in list)
    {
        Debug.Log("Text: " + item.Text);
    }
}

Insert

private async Task Insert()
{
    TodoItem item = new TodoItem
    {
        Text = "Hello World!"
    };

    await todoTableDAO.Insert(item);
}

Delete

private async Task Delete()
{
    List<TodoItem> list = await todoTableDAO.FindAll();

    TodoItem item = list.LastOrDefault();

    if (item != null)
    {
        await todoTableDAO.Delete(item);
    }
}

Sync local and remote data

private async Task Sync()
{
    if (todoTableDAO.SupportsLocalStore)
    {
        await LocalStore.Sync();
    }
}

Contributors

The SDK is brought to you by LightBuzz Inc., a New York based company.

If you would like to contribute to the SDK, please make a pull request.

Comparison with other SDKs

The LightBuzz Azure App Service SDK for Unity3D is the only SDK that supports local database storage. Also, it supports every major platform, including iOS, Android, MacOS, Windows Desktop, and UWP. It's also supporting HTTPS. The LightBuzz SDK is the most feature-complete Unity SDK for Microsoft Azure.

Currently, the following alternatives exist:

LightBuzz SDK DeadlyFingers SDK Brian Peek SDK
App Services check check check
HTTPS check check close
Local database check close close
Unity Editor check check check
Windows Desktop check check check
Mac OS X check check close
Android check check check
iOS check check check
UWP check close check

Resources

LightBuzz has been developing Mobile and Cloud solutions for Fortune 500 and startup companies since 2012. Get in touch with us to start a project with a reliable and trusted partner.