


To run the project, select the Run ‘app’ option from the Run menu. To run an Android Studio project, you either need an emulator (virtual device) or a real device connected via a USB cable.

Without discussing the implementation of these files, let’s run the project to ensure everything is working correctly. There’s also an XML layout file named activity_main.xml, as illustrated in the next figure. java extension, but it isn’t just displayed in the Android project view. You can either check or uncheck the “Backwards Compatibility” checkbox.Īfter the project is created, you can select the Android project view and will find a Java file for the activity named MainActivity. Note that you can check the “ Generate Layout File” checkbox to create a layout for the activity. After specifying the proper name of your choice, click Finish to create the project. This name is regarded as the class name of the Java file associated with this activity. Note that this activity is not completely empty as it contains a TextView that covers the screen, as we’ll see later, after running the app.īy specifying that the app is to include an activity, another window appears asking for the Activity Name. As a result, I selected the “ Empty Activity” option. If no activity is to be created, you can select the top-left option “ Add No Activity”.īecause we’re going to build an Android app, then there must be an Activity, even if empty. You can lower the minimum SDK if you’d like to support more devices.īy clicking Next, another window appears asking for whether a default activity is to be created within the project or not. You can select one of the SDKs available in your environment. The app name we’ll used for this tutorial is OpenCVAndroid.īy clicking the Next button, another window appears asking for the target devices and the minimum SDK. The first is to create a new project from the File menu as illustrated in the next figure.īy selecting the “ New Project” menu item, a new window appears asking for a few details (e.g. Let’s go through the steps of building a new Android Studio project.

