Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
How to integrate ARCore for Android?
Go to Azure Portal: portal.azure.com.
In the left navigation pane in the Azure portal, select Create a resource.
Use the search box to search for Spatial Anchors.
Select Spatial Anchors. In the dialog box, select Create.
In the Spatial Anchors Account dialog box:
Enter a unique resource name, using regular alphanumeric characters.
Select the subscription that you want to attach the resource to.
Create a resource group by selecting Create new. Name it myResourceGroup and select OK. A resource group is a logical container into which Azure resources like web apps, databases, and storage accounts are deployed and managed. For example, you can choose to delete the entire resource group in one simple step later.
Select a location (region) in which to place the resource.
Select New to begin creating the resource.
After the resource is created, Azure Portal will show that your deployment is complete. Click Go to resource.
Then, you can view the resource properties. Copy the resource's Account ID value into a text editor because you'll need it later.
Under Settings, select Key. Copy the Primary key value into a text editor. This value is the Account Key
. You'll need it later.
Scroll down to assets section and click on AzureSpatialAnchors.unitypackage to download.
In your Unity project select Assets > Import package > custom package and find the downloaded AzureSpatialAnchors.unitypackage and import all.
Start your project from .
Work on main scene or and .
Create a new script called AzureSpatialAnchorsScript.
Add imports:
Add the following members variables into your AzureSpatialAnchorsScript class:
When working with Unity, all Unity APIs, for example APIs you use to do UI updates, need to happen on the main thread. In the code we'll write however, we get callbacks on other threads. We want to update UI in these callbacks, so we need a way to go from a side thread onto the main thread. To execute code on the main thread from a side thread, we'll use the dispatcher pattern.
Let's add a member variable, dispatchQueue, which is a Queue of Actions. We will push Actions onto the queue, and then dequeue and run the Actions on the main thread.
Next, let's add method to add an Action to the Queue. Add QueueOnUpdate()
right after Update()
:
Let's now use the Update() loop to check if there is an Action queued. If so, we will dequeue the action and run it.
Import AzureSpacialAnchors asset into your script.
Add the CloudSpatialAnchorSession and CloudSpatialAnchor member variables into your AzureSpatialAnchorsScript
class:
Initialize Session:
Add methods to handle delegate calls.
Call the InitializeSession() method inside the Start() function:
Attach a local Azure Spatial Anchor to the sphere that we're placing in the real world.
Add task.run function on line 26 to your CreateAndSaveAnchor function. We will change the color of the sphere to indicate that it is saved or failed to save.
At this point, your AzureSpatialAnchorsScript.cs should look like below code snippet:
After you run your application, you can check to see the recently created anchors by navigating to the Azure Portal > Spatial Anchor resource you have created for this tutorial.
Now you can follow the and start creating anchors in your environment.
Sign in to your Azure Portal
Create a resource by selecting Databases > Azure CosmosDB
Select the subscription and resource group you are using for this project.
Enter a unique name to identify Azure Cosmos DB account.
Select "Azure Table" as the API.
Select a geographic location to host your Azure Cosmos DB account. Use the location that's closest to your users to give them the fastest access to data.
You can leave the Geo-Redundancy and Multi-region Writes options at their default values (Disable) to avoid additional RU charges. You can skip the Network and Tags sections.
Select Review+Create. After the validation is complete, select Create to create the account.
It takes a few minutes to create the account. You'll see a message that states Your deployment is underway. Wait for the deployment to finish and then select Go to resource.
Copy the Connection String
for later use.
Open SharingService\Startup.cs.
Locate #define INMEMORY_DEMO
at the top of the file and comment that line out. Save the file.
Open SharingService\appsettings.json
.
Locate the StorageConnectionString
property, and set the value to be the same as the Connection String
value.
Go to Azure For Students page: bit.ly/AzureStudentCredit or scan the below QR code.
Follow the Activate Now link to sign up.