Affiliate links on Android Authority may earn us a commission.Learn more.

Poly API: Retrieving 3D assets for your VR and AR Android apps

July 02, 2025

Do you have a great idea for aVirtual Reality(VR) orAugmented Reality(AR) mobile app, but no idea how to bring your vision to life?

Unless you’re anAndroid developerwho also happens to be an experienced 3D artist, then creating all the assets required to deliver an immersive, 360 degree experience, can be a daunting process.

google poly on smartphone

Just because you don’t have the time, resources or experience necessary to create 3D models,doesn’tmean you’re able to’t build a great VR or AR mobile app! There’s a huge range of 3D resources freely available on the World Wide Web, plus all the APIs, frameworks and libraries you need to download and render these assets in your Android applications.

Read Next:you’re able to now visit any website using Daydream VR. Even that one.

google poly library

In this article, we’re going to be looking at Poly, an online repository and API that puts thousands of 3D assets at your fingertips. By the end of this article, you’ll have created an app that retrieves a 3D Poly asset at runtime, and then renders it using the popular Processing for Android library.

Displaying 3D assets with Poly

If you’ve ever dabbled in Unity development, then the Poly repository is similar to the Unity Asset Store – except that everything in Poly is free!

Many of Poly’s 3D models are published under theCreative Commons license, so you’re free to use, modify and remix these assets, as long as you give the creator appropriate credit.

google poly toogle tasks

All of Poly’s 3D models are designed to be compatible with Google’s VR and AR platforms, such as Daydream and ARCore, but you can use them wherever and however you want – potentially, you could even use them with Apple’s ARKit!

When it comes to retrieving and displaying Poly assets, you have two options. Firstly, you can download the assets to your computer and then import them into Android Studio, so they ship with your application and contribute towards its APK size, or you can retrieve these assets at runtime using the Poly API.

google poly credentials

The cross-platform, REST-based Poly API provides programmatic, read-only access to Poly’s huge collection of 3D models. This is more complicated than bundling assets with your APK, but there’s several benefits to retrieving Poly assets at runtime, most notably that it helps tokeep your APK size under control, which can affect how many people download your application.

You can also use the Poly API to give your users more choice, for example if you’re developing a mobile game then you could let your users choose from a range of character models.

google poly file url

Since you’re free to modify the Poly models, you could even let your users tweak their chosen character, for example by altering the hair or eye color, or by combining it with other Poly assets, such as different weapons and armour. In this way, the Poly API can help you deliver an impressive range of 3D assets, with lots of scope for personalizing the experience – and all for comparatively little work. Your users will be convinced that you’ve spent a tonne of time, meticulously crafting all of these 3D models!

Creating a 3D modelling project

We’re going to create an application that retrieves a particular Poly asset when the application is first launched, and then displays that asset in fullscreen mode, at the user’s request.

To help us retrieve this asset, I’ll be usingFuel, which is a HTTP networking library for Kotlin and Android. Start by creating a new project with the settings of your choice, but when prompted opt to “Include Kotlin support.”

All calls you make to the Poly API must include an API key, which is used to identify your app and enforce usage limits. During development and testing, you’ll often use an unrestricted API key, but if you have any plans to release this app, then you must use an Android-restricted API key.

To create a restricted key, you’ll need to know your project’s SHA-1 signing certificate, so let’s get this information now:

The “Run” panel will now update to display lots of information about your project, including its SHA-1 fingerprint.

Create a Google Cloud Platform account

To acquire the necessary API key, you’ll need a Google Cloud Platform (GPC) account.

Get your Poly API key

Once you’re all signed up, you may enable the Poly API and create your key:

You’ll now be taken to your project’s “Credentials” screen, which contains a list of all your API keys – including the Poly-enabled API key that you just created.

Project dependencies: Fuel, P3D and Kotlin extensions

to retrieve and display Poly assets, we’ll need a helping hand from some additional libraries:

Open your project’s build.gradle file, and add these two libraries as project dependencies:

To make our code more concise, I’ll also be using Kotlin Android extensions, so let’s add this plugin while we have the build.gradle file open:

Finally, since we’re retrieving the asset from the Internet, our app needs the Internet permission. Open your Manifest and add the following:

Adding your API key

Every time our app requests an asset from Poly, it needs to include a valid API key. I’m using placeholder text, but youmustreplace this placeholder with your own API key if the application is ever going to work.

I’m also adding a check, so that the application will display a warning if you forget to replace the “INSERT-YOUR-API-KEY” text:

Retrieving the asset

You can choose any asset on theGoogle Poly site, but I’ll be using this model ofplanet Earth.

You retrieve an asset using its ID, which appears at the end of the URL slug (highlighted in the previous screenshot). We combine this asset ID, with the Poly API host, which is “https://poly.googleapis.com/v1.”

Next, we need to make a GET request to the asset URL, using the httpGet() method. I’m also specifying that the response type must be JSON:

The asset might have several formats, such as OBJ, GLTF, and FBX. We need to determine that the asset is in the OBJ format.

In this step, I’m also retrieving the name and URL of all the files we need to download,including the asset’s primary file (“root”), plus any associated material and texture files (“resources”).

If our application is unable to retrieve the asset correctly, then it’ll display a toast informing the user.

At this point, if you install the project on your Android smartphone or tablet, or Android Virtual Device (AVD), then the asset will download successfully, but the app won’t actually display it. Let’s fix this now!

Creating a second screen: Adding navigation

We’re going to display the asset in fullscreen mode, so let’s update our main_activity.xml file to include a button that, when tapped, will launch the fullscreen Activity.

Now let’s add the onClickListener to the end of the MainActivity.kt file:

Building a 3D canvas

Now, let’s create the Activity where we’ll display our asset in fullscreen mode:

to draw a 3D object, we need a 3D canvas! I’m going to use the Processing for Android’s library’s P3D renderer, which means extending the PApplet class, overriding the settings() method and then passing P3D as an argument to the fullScreen() method. We also need to create a property that represents the Poly asset as a PShape object.

Next, we need to initialize the PShape object, by overriding the setup() method, calling the loadShape() method, and then passing the absolute path of the .obj file:

Drawing on P3D’s canvas

To draw on this 3D canvas, we need to override the draw() method:

By default, many of the assets retrieved from the Poly API are on the smaller side, so if you run this code now, then you may not even see the asset, depending on your screen configuration. When creating 3D scenes, you’ll typically create a custom camera so that the user can explore the scene and view your 3D assets from the full 360 degrees. However, this is beyond the scope of this article so I’ll be changing the asset’s size and position manually, to ensure it fits comfortably onscreen.

You can increase the asset’s size, by passing a negative value to the scale() method:

You can adjust the asset’s position in the virtual 3D space using the translate() method and the following coordinates:

Note that transformations are cumulative, so everything that happens after the function accumulates the effect.

I’m using the following:

Here’s the completed code:

Next, we need to create the corresponding layout file, where we’ll add the 3D canvas as a FrameLayout widget:

Now we have our “asset_view” FrameLayout, we need to let our SecondActivity know about it! Flip back to the SecondActivity.kt file, create a new PFragment instance, and point it in the direction of our “asset_view” widget:

The final step, is adding the SecondActivity to your Manifest:

Testing your project

We’re now ready to test the finished project! Install it on your Android device or AVD, and make sure you have an active Internet connection. As soon as the app launches, it’ll download the asset, and you’re able to then view it by giving the “Display Asset” button a tap.

You candownload this complete project from GitHub.

Wrapping up

In this article, we looked at how to use the Poly API to retrieve a 3D asset at runtime, and how to display that asset using the Processing for Android library. Do you think that the Poly API has the potential to make VR and AR development accessible to more people? Let us know in the comments below!

Thank you for being part of our community. Read ourComment Policybefore posting.