Creating our application
Let's create a very basic Android application that will read images from your phone's gallery and display them on the screen using the ImageView control. The application will also have a menu option to open the gallery to choose an image.
We will start off by creating a new Eclipse (or an Android Studio) project with a blank activity, and let's call our application Features App.
Note
Before doing anything to the application, initialize OpenCV in your application (refer to Chapter 1, Applying Effects to Images, on how to initialize OpenCV in an Android project).
To the blank activity, add an ImageView
control (used to display the image), as shown in the following code snippet:
<ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/image_view" android:visibility="visible"/>
In the application menu, add an OpenGallery
menu option to open...