# Sceneform Quickstart for Android

## Set up your development environment

- Install [Android Studio](https://developer.android.com/studio/index.html)
  version 3.1 or higher with Android SDK Platform version 7.0 (API level 24)
  or higher.

- You will need a basic understanding of Android development. If you are new
  to Android, see
  [Building your first Android app for beginners](https://developer.android.com/training/basics/firstapp/index.html).

## Open the sample project

Get the sample projects. You can either:

- Download and extract the [Sceneform Samples](https://github.com/google-ar/sceneform-android-sdk/releases)

  -or-
- Clone the repository with the following command:

  <br />

  ```
  git clone https://github.com/google-ar/sceneform-android-sdk.git
  ```

  <br />

In Android Studio, open the **Hello Sceneform** sample project, located in the **app** subdirectory within the `sceneform-android-sdk` directory.

## Prepare your device or emulator

You can run AR apps on a [supported device](https://developers.google.com/ar/discover/supported-devices) or
in the Android Emulator:

- In the emulator, you must sign into the Google Play Store or [update Google Play Services for AR](https://developers.google.com/sceneform/develop/emulator#update-arcore) manually.

There are additional requirements to run
Sceneform apps in the emulator:

- You need **Android Emulator** version **27.2.9** or later.
- **OpenGL ES 3.0** or higher must be supported and enabled in the Android
  Emulator.

  - Make sure your emulator is configured to use the latest version. In the
    Extended controls panel
    (
    on the Toolbar), select **Settings \> Advanced \> OpenGL ES API level \>
    Renderer maximum (up to OpenGL ES 3.1)**, and then restart the emulator.

  - Run the emulator, briefly interact with the emulated deivce, then check
    whether OpenGL ES 3.0 or higher is being used:

        adb logcat | grep eglMakeCurrent

    If you see `ver 3 0` or higher version, then you can run Sceneform apps.
    If you see a lower version, then your desktop GPU does not support
    OpenGL ES 3.0 and you must use a
    [supported device](https://developers.google.com/ar/discover/supported-devices) to run Sceneform
    apps.

## Run the sample

Make sure your Android device is connected to the development machine and click
**Run** ![](https://developers.google.com/static/ar/develop/java/images/toolbar-run.png) in Android Studio. Then, choose your device
as the deployment target and click **OK**.

Android Studio builds your project into a debuggable APK, installs the APK, and
then runs the app on your device. For more information, see [Build and Run Your App](https://developer.android.com/studio/run/index.html).

You may be prompted to install or update [Google Play Services for AR](https://play.google.com/store/apps/details?id=com.google.ar.core)
if it is missing or out of date. Select **CONTINUE** to install it from
Google Play Store.

The **Hello Sceneform** app lets you place and manipulate Android figurines on
flat surfaces.
Your browser does not support the video tag.

## Add Sceneform to an existing project

To use Sceneform in an existing project:

1. Follow the steps to [Enable ARCore](https://developers.google.com/ar/develop/java/enable-arcore) in your app

2. Add the Sceneform library to your **app's** `build.gradle` file:

       android {
           // Sceneform libraries use language constructs from Java 8.
           // Add these compile options if targeting minSdkVersion < 26.
           compileOptions {
               sourceCompatibility 1.8
               targetCompatibility 1.8
           }
       }

       dependencies {
           ...

           // Provides ArFragment, and other UX resources.
           implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.15.0'

           // Alternatively, use ArSceneView without the UX dependency.
           implementation 'com.google.ar.sceneform:core:1.15.0'
       }

## Next steps

- Try building and running [other sample projects](https://developers.google.com/sceneform/develop/samples) in the ARCore SDK and Sceneform samples.
- Learn how to [Enable ARCore](https://developers.google.com/ar/develop/java/enable-arcore) in your app.
- Review [Runtime Considerations](https://developers.google.com/ar/develop/developer-guides/runtime-considerations).
- Review [Design Guidelines](https://developers.google.com/ar/develop/developer-guides/design-guidelines).