The LightBuzz Azure SDK for Unity3D is a framework that allows you to consume remote Azure App services and even store data locally. It's secured using HTTPS. Supports Android, iOS, Windows Standalone, Mac OS, and UWP (including HoloLens).
It's a cross-platform SDK you can actually use in your apps and games without compatibility problems.
To use the SDK, you can either clone the current repository or download the .unitypackage file from the Releases section.
You can read the documentation online on lightbuzz.com/tools/azure-unity/documentation.
The LightBuzz Azure SDK for Unity consumes Azure App Service APIs. Azure App Services is a service for hosting web applications, REST APIs, and mobile back ends for any platform or device.
The LightBuzz SDK is built with security in mind. The native Microsoft MobileServiceClient
does 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.
The LightBuzz SDK supports all of the HTTP(S) method requests.
- GET
- POST
- PUT
- PATCH
- DELETE
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.
The LightBuzz Azure SDK for Unity supports the following platforms:
- Unity Editor
- Android
- iOS
- Windows Desktop (Standalone)
- MacOS (Standalone)
- Universal Windows Platform (UWP) + HoloLens
To use the SDK, Unity 2017 LTS or Unity 2018 is recommended.
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.
In Unity 2017, you need to explicitly select "Experimental (.NET 4.6 Equivalent)".
The SDK works with the following Scripting Backend options:
Standalone | Android | iOS | UWP |
---|---|---|---|
Mono | Mono | IL2CPP | .NET |
Using the SDK, you can apply the proper Unity Build Settings automatically. On the Unity menu bar, select LightBuzz → Apply Build Settings for... and then select the target platform. The SDK will automatically apply the proper build settings for you.
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 CRUD operations out-of-the-box. All you need to do is call the proper C# methods.
Using the code is fairly simple:
private string mobileAppUri = "https://testtodolightbuzz.azurewebsites.net";
private bool supportLocalDatabase = true;
private MobileServiceClient azureClient;
private AppServiceTableDAO<TodoItem> todoTableDAO;
private async Task Init()
{
azureClient = new SampleMobileClient(mobileAppUri, supportLocalDatabase);
await azureClient.InitializeLocalStore();
todoTableDAO = new AppServiceTableDAO<TodoItem>(azureClient);
}
private async Task Get()
{
List<TodoItem> list = await todoTableDAO.FindAll();
foreach (TodoItem item in list)
{
Debug.Log("Text: " + item.Text);
}
}
private async Task Insert()
{
TodoItem item = new TodoItem
{
Text = "Hello World!"
};
await todoTableDAO.Insert(item);
}
private async Task Delete()
{
List<TodoItem> list = await todoTableDAO.FindAll();
TodoItem item = list.LastOrDefault();
if (item != null)
{
await todoTableDAO.Delete(item);
}
}
In case you are using the local database for offline functionality, here is how to perform the pull and push requests:
private async Task Sync()
{
await azureClient.Sync();
}
The SDK is brought to you by LightBuzz Inc., a New York based company.
- Georgia Makoudi, Azure Specialist
- Vangos Pterneas, Microsoft MVP
- George Karakatsiotis, Lead Software Engineer
If you would like to contribute to the SDK, please make a pull request.
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.