Commit 6fb95971 authored by Alexander Smorkalov's avatar Alexander Smorkalov

Code review comments applied.

parent 7ef378b2
...@@ -260,34 +260,35 @@ To build your own Android application, which uses OpenCV from native part, the f ...@@ -260,34 +260,35 @@ To build your own Android application, which uses OpenCV from native part, the f
#. Either use :ref:`manual <NDK_build_cli>` ``ndk-build`` invocation or :ref:`setup Eclipse CDT Builder <CDT_Builder>` to build native JNI lib before Java part [re]build and APK creation. #. Either use :ref:`manual <NDK_build_cli>` ``ndk-build`` invocation or :ref:`setup Eclipse CDT Builder <CDT_Builder>` to build native JNI lib before Java part [re]build and APK creation.
Hello OpenCV Sample "Hello OpenCV" Sample
=================== =====================
Here are basic steps to guide you trough the process of creating a simple OpenCV-centric application. Here are basic steps to guide you trough the creation process of a simple OpenCV-centric application.
It will be capable of accessing camera output, processing it and displaying the result. It will be capable of accessing camera output, processing it and displaying the result.
#. Open Eclipse IDE, create a new clean workspace, create a new Android project (*File -> New -> Android Project*). #. Open Eclipse IDE, create a new clean workspace, create a new Android project (:guilabel:`File -> New -> Android Project`).
#. Set name, target, package and minSDKVersion accordingly. #. Set name, target, package and ``minSDKVersion`` accordingly.
#. Add the following permissions to the AndroidManifest.xml file: #. Add the following permissions to the ``AndroidManifest.xml`` file:
.. code-block:: xml .. code-block:: xml
:linenos: :linenos:
</application> <uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" /> <uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front.autofocus" android:required="false"/>
#. Reference OpenCV library within your project properties. #. Reference the OpenCV library within your project properties.
.. image:: images/dev_OCV_reference.png .. image:: images/dev_OCV_reference.png
:alt: Reference OpenCV library. :alt: Reference OpenCV library.
:align: center :align: center
#. Create new view layout for your application, lets name it hello_opencv.xml, and add the following to it: #. Create new view layout for your application, lets name it ``hello_opencv.xml``, and add the following to it:
.. code-block:: xml .. code-block:: xml
:linenos: :linenos:
...@@ -307,7 +308,8 @@ It will be capable of accessing camera output, processing it and displaying the ...@@ -307,7 +308,8 @@ It will be capable of accessing camera output, processing it and displaying the
#. Remove default auto generated layout, if exists. #. Remove default auto generated layout, if exists.
#. Create a new *Activity* (*New -> Other -> Android -> Android Activity*) and name it, for example: *HelloOpenCVActivity*. Add *CvCameraViewListener* interface to *implementes* section of *HelloOpenCVActivity* class. Add the following code to activity implementation: #. Create a new ``Activity`` (:guilabel:`New -> Other -> Android -> Android Activity`) and name it, for example: ``HelloOpenCVActivity``.
Add ``CvCameraViewListener`` interface to ``implements`` list of ``HelloOpenCVActivity`` class. Add the following code to activity implementation:
.. code-block:: java .. code-block:: java
:linenos: :linenos:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment