Android Quick Start

Create an app that allows you to paint real life surfaces with virtual paint.

Overview

Painting a real room with virtual paint is not a trivial task, there is a lot of complexity involved as well as a lot of domain specific knowledge that is required to do it correctly. With Remodel-AR, you don’t need to know anything about how it works, just what you want to do with it. Let Remodel-AR do all the heavy lifting for you.

Creating a new app is as simple as creating an Activity and extending it with PaintARActivity, it is quite same while using Java or Kotlin, whichever is your preferred language.

Quick start

(see Setting up Remodel-AR in Android for a step by step setup)

Using the Remodel-AR framework is quite simple. You only need to create an Activity that extends PaintARActivity, then initialize the sdk by calling configure() method with required parameters key and PassioSDKStatus, Once the SDK is ready, you will get callback in onPassioSDKReady(). In case of any error, it will trigger the other callback onPassioSDKError().

Kotlin:

class MainActivity : PaintARActivity() {

    val TAG = "SAMPLE"

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        val inflater: LayoutInflater =
            applicationContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
        mUnityPlayer.addView(inflater.inflate(R.layout.activity_main, null));
         
        configure("Your key", object : PassioSDKStatus {
                override fun onPassioSDKReady() { Log.d(TAG, "onPassioSDKReady")}
                override fun onPassioSDKError(error: String) { Log.d(TAG, "onPassioSDKError " + error) }
        })
    }
}

Java:

class MainActivity extends PaintARActivity{

    public static final String TAG = "SAMPLE";

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mUnityPlayer.addView(inflater.inflate(R.layout.activity_main, null));
         
        configure("Your key", new PassioSDKStatus() {
            public void onPassioSDKReady() { Log.d(TAG, "onPassioSDKReady");}
            public void onPassioSDKError(String error) { Log.d(TAG, "onPassioSDKError " + error); }
        });
    }
}

Saving a 3D Model

Saving a 3D model of the scene can be done using the following code. The file will be saved as a png file on given path.

Kotlin:

savePhoto(path, object : GetSavedImage {
    override fun receivedSavedImage(p0: String?) {
        sharePhoto("file://$path");
    }
    override fun failed() {
        Log.d(TAG, "GetSavedImage FAILED")
    }
})

Java:

savePhoto(path, new GetSavedImage() {
    public void receivedSavedImage(String p0) {
        sharePhoto("file://"+path);
    }
    public void failed() {
        Log.d(TAG, "GetSavedImage FAILED");
    }
});

Resetting the scene

Resetting the scene can be used to start over, removing all geometry from the view.

Kotlin:

resetScene()

Java:

resetScene();

If at any point you need help from the Passio team, please reach out to us at support@passiolife.com

Last updated