mirror of
https://github.com/opencv/opencv.git
synced 2024-12-02 07:39:57 +08:00
Fix formatting in Android tutorials
This commit is contained in:
parent
62f9c0e140
commit
dd3b09441f
@ -202,7 +202,7 @@ Open OpenCV library and samples in Eclipse
|
||||
|
||||
Sometimes more advanced manipulations are required:
|
||||
|
||||
* The provided projects are configured for ``API 11`` target (and ``API 9`` for the library) that can be missing platform in your Android SDK.
|
||||
The provided projects are configured for ``API 11`` target (and ``API 9`` for the library) that can be missing platform in your Android SDK.
|
||||
After right click on any project select :guilabel:`Properties` and then :guilabel:`Android` on the left pane.
|
||||
Click some target with `API Level` 11 or higher:
|
||||
|
||||
|
@ -75,7 +75,7 @@ You need the following software to be installed in order to develop for Android
|
||||
|
||||
sudo update-java-alternatives --set java-6-sun
|
||||
|
||||
**TODO:** add a note on Sun/Oracle Java installation on Ubuntu 12.
|
||||
.. **TODO:** add a note on Sun/Oracle Java installation on Ubuntu 12.
|
||||
|
||||
#. **Android SDK**
|
||||
|
||||
@ -241,6 +241,7 @@ where:
|
||||
The script :file:`Android.mk` usually has the following structure:
|
||||
|
||||
.. code-block:: make
|
||||
:linenos:
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
@ -258,6 +259,7 @@ This is the minimal file :file:`Android.mk`, which builds C++ source code of an
|
||||
Usually the file :file:`Application.mk` is optional, but in case of project using OpenCV, when STL and exceptions are used in C++, it also should be created. Example of the file :file:`Application.mk`:
|
||||
|
||||
.. code-block:: make
|
||||
:linenos:
|
||||
|
||||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -fexceptions
|
||||
@ -337,7 +339,7 @@ We recommend the approach based on Eclipse :abbr:`CDT(C/C++ Development Tooling)
|
||||
:alt: Configure CDT
|
||||
:align: center
|
||||
|
||||
` `
|
||||
And:
|
||||
|
||||
.. image:: images/eclipse_cdt_cfg2.png
|
||||
:alt: Configure CDT
|
||||
@ -350,6 +352,7 @@ We recommend the approach based on Eclipse :abbr:`CDT(C/C++ Development Tooling)
|
||||
:align: center
|
||||
|
||||
#. Open :guilabel:`Project Properties -> C/C++ Build`, unckeck ``Use default build command``, replace "Build command" text from ``"make"`` to
|
||||
|
||||
``"${NDKROOT}/ndk-build.cmd"`` on Windows,
|
||||
|
||||
``"${NDKROOT}/ndk-build"`` on Linux and MacOS.
|
||||
@ -393,7 +396,7 @@ We recommend the approach based on Eclipse :abbr:`CDT(C/C++ Development Tooling)
|
||||
:alt: Configure CDT
|
||||
:align: center
|
||||
|
||||
.. note:: The latest Android NDK **r8b** has a bit different STL headers path. So if you use this NDK version please use the following modified **Include** paths list:
|
||||
.. note:: The latest Android NDK **r8b** uses different STL headers path. So if you use this NDK release add the following **Include** paths list instead:
|
||||
|
||||
::
|
||||
|
||||
@ -412,12 +415,16 @@ AVD
|
||||
AVD (*Android Virtual Device*) is not probably the most convenient way to test an OpenCV-dependent application, but sure the most uncomplicated one to configure.
|
||||
|
||||
#. Assuming you already have *Android SDK* and *Eclipse IDE* installed, in Eclipse go :guilabel:`Window -> AVD Manager`.
|
||||
**TBD:** how to start AVD Manager without Eclipse...
|
||||
|
||||
.. **TBD:** how to start AVD Manager without Eclipse...
|
||||
|
||||
#. Press the :guilabel:`New` button in :guilabel:`AVD Manager` window.
|
||||
#. :guilabel:`Create new Android Virtual Device` window will let you select some properties for your new device, like target API level, size of SD-card and other.
|
||||
|
||||
.. image:: images/AVD_create.png
|
||||
:alt: Configure builders
|
||||
:align: center
|
||||
|
||||
#. When you click the :guilabel:`Create AVD` button, your new AVD will be availible in :guilabel:`AVD Manager`.
|
||||
#. Press :guilabel:`Start` to launch the device. Be aware that any AVD (a.k.a. Emulator) is usually much slower than a hardware Android device, so it may take up to several minutes to start.
|
||||
#. Go :guilabel:`Run -> Run/Debug` in Eclipse IDE to run your application in regular or debugging mode. :guilabel:`Device Chooser` will let you choose among the running devices or to start a new one.
|
||||
@ -435,22 +442,31 @@ Windows host computer
|
||||
#. Attach the Android device to your PC with a USB cable.
|
||||
#. Go to :guilabel:`Start Menu` and **right-click** on :guilabel:`Computer`. Select :guilabel:`Manage` in the context menu. You may be asked for Administrative permissions.
|
||||
#. Select :guilabel:`Device Manager` in the left pane and find an unknown device in the list. You may try unplugging it and then plugging back in order to check whether it's your exact equipment appears in the list.
|
||||
|
||||
.. image:: images/usb_device_connect_01.png
|
||||
:alt: Unknown device
|
||||
:align: center
|
||||
|
||||
#. Try your luck installing `Google USB drivers` without any modifications: **right-click** on the unknown device, select :guilabel:`Properties` menu item --> :guilabel:`Details` tab --> :guilabel:`Update Driver` button.
|
||||
|
||||
.. image:: images/usb_device_connect_05.png
|
||||
:alt: Device properties
|
||||
:align: center
|
||||
|
||||
#. Select :guilabel:`Browse computer for driver software`.
|
||||
|
||||
.. image:: images/usb_device_connect_06.png
|
||||
:alt: Browse for driver
|
||||
:align: center
|
||||
|
||||
#. Specify the path to :file:`<Android SDK folder>/extras/google/usb_driver/` folder.
|
||||
|
||||
.. image:: images/usb_device_connect_07.png
|
||||
:alt: Browse for driver
|
||||
:align: center
|
||||
|
||||
#. If you get the prompt to install unverified drivers and report about success - you've finished with USB driver installation.
|
||||
|
||||
.. image:: images/usb_device_connect_08.png
|
||||
:alt: Install prompt
|
||||
:align: center
|
||||
@ -460,23 +476,33 @@ Windows host computer
|
||||
.. image:: images/usb_device_connect_09.png
|
||||
:alt: Installed OK
|
||||
:align: center
|
||||
|
||||
#. Otherwise (getting the failure like shown below) follow the next steps.
|
||||
|
||||
.. image:: images/usb_device_connect_12.png
|
||||
:alt: No driver
|
||||
:align: center
|
||||
|
||||
#. Again **right-click** on the unknown device, select :guilabel:`Properties --> Details --> Hardware Ids` and copy the line like ``USB\VID_XXXX&PID_XXXX&MI_XX``.
|
||||
|
||||
.. image:: images/usb_device_connect_02.png
|
||||
:alt: Device properties details
|
||||
:align: center
|
||||
|
||||
#. Now open file :file:`<Android SDK folder>/extras/google/usb_driver/android_winusb.inf`. Select either ``Google.NTx86`` or ``Google.NTamd64`` section depending on your host system architecture.
|
||||
|
||||
.. image:: images/usb_device_connect_03.png
|
||||
:alt: "android_winusb.inf"
|
||||
:align: center
|
||||
|
||||
#. There should be a record like existing ones for your device and you need to add one manually.
|
||||
|
||||
.. image:: images/usb_device_connect_04.png
|
||||
:alt: "android_winusb.inf"
|
||||
:align: center
|
||||
|
||||
#. Save the :file:`android_winusb.inf` file and try to install the USB driver again.
|
||||
|
||||
.. image:: images/usb_device_connect_05.png
|
||||
:alt: Device properties
|
||||
:align: center
|
||||
@ -492,7 +518,9 @@ Windows host computer
|
||||
.. image:: images/usb_device_connect_07.png
|
||||
:alt: Browse for driver
|
||||
:align: center
|
||||
|
||||
#. This time installation should go successfully.
|
||||
|
||||
.. image:: images/usb_device_connect_08.png
|
||||
:alt: Install prompt
|
||||
:align: center
|
||||
@ -502,11 +530,15 @@ Windows host computer
|
||||
.. image:: images/usb_device_connect_09.png
|
||||
:alt: Installed OK
|
||||
:align: center
|
||||
|
||||
#. And an unknown device is now recognized as an Android phone.
|
||||
|
||||
.. image:: images/usb_device_connect_10.png
|
||||
:alt: "Known" device
|
||||
:align: center
|
||||
|
||||
#. Successful device USB connection can be verified in console via ``adb devices`` command.
|
||||
|
||||
.. image:: images/usb_device_connect_11.png
|
||||
:alt: "adb devices"
|
||||
:align: center
|
||||
@ -523,7 +555,7 @@ By default Linux doesn't recognize Android devices, but it's easy to fix this is
|
||||
|
||||
Then restart your adb server (even better to restart the system), plug in your Android device and execute :command:`adb devices` command. You will see the list of attached devices:
|
||||
|
||||
.. image:: images/usb_device_connect_ubuntu.png
|
||||
.. image:: images/usb_device_connect_ubuntu.png
|
||||
:alt: List of attached devices
|
||||
:align: center
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user