<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Developer's guide</title><link>https://sourceforge.net/p/lynxsightmobile/wiki/Developer%2527s%2520guide/</link><description>Recent changes to Developer's guide</description><atom:link href="https://sourceforge.net/p/lynxsightmobile/wiki/Developer's%20guide/feed" rel="self"/><language>en</language><lastBuildDate>Sat, 14 Sep 2013 09:25:54 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/lynxsightmobile/wiki/Developer's%20guide/feed" rel="self" type="application/rss+xml"/><item><title>Developer's guide modified by Tibor Fecko</title><link>https://sourceforge.net/p/lynxsightmobile/wiki/Developer%2527s%2520guide/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="setting-up-project"&gt;Setting up project&lt;/h1&gt;
&lt;p&gt;Sources and resources for project LynxSight are organized in Eclipse Android &lt;br /&gt;
projects. Eclipse is used because of availability and suitability of tools used in &lt;br /&gt;
developing of project. Setting up Eclipse IDE is section 1.2. Besides setting up the IDE &lt;br /&gt;
Android development tools ADT and NDK for native development are presented. In &lt;br /&gt;
this section are also presented used third-party libraries such Tesseract OCR tool and &lt;br /&gt;
OpenCV library to increase of officiency of manipulating with rastr-based images. &lt;br /&gt;
Finally, requirement of the majority of Android-based devices compatibility should be &lt;br /&gt;
met. Therefore Android support modul is integrated to the project to ensure smoothly &lt;br /&gt;
run of application on devices with older version of OS Android. Some of mentioned &lt;br /&gt;
development tools are integrated to Tegra Android development pack presented by &lt;br /&gt;
NVIDIA. Usage of this pack is highly recommended for unexperienced, but also &lt;br /&gt;
becouse of development efficiency experienced developers too. &lt;/p&gt;
&lt;h2 id="11-project-dependences"&gt;1.1 Project dependences&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;1.1.1 Operating system&lt;/b&gt;&lt;br /&gt;
• Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-bit) &lt;br /&gt;
• Mac OS X 10.5.8 or later (x86 only) &lt;br /&gt;
• Linux (tested on Ubuntu Linux, Lucid Lynx)  o GNU C Library (glibc) 2.7 or later is required. o On Ubuntu Linux, version 8.04 or later is required. o 64-bit distributions must be capable of running 32-bit applications. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;1.1.2 Eclipse IDE&lt;/b&gt;&lt;br /&gt;
• Eclipse 3.6.2 (Helios) or greater&lt;br /&gt;
Note: Eclipse 3.5 (Galileo) is no longer supported with the latest version of ADT. &lt;br /&gt;
• Eclipse JDT plugin (included in most Eclipse IDE packages)&lt;br /&gt;
• JDK 6 (JRE alone is not sufficient) &lt;br /&gt;
• Android Development Tools plugin (recommended) &lt;br /&gt;
• Not compatible with GNU Compiler for Java (gcj)&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1.1.3 Other development enviroments&lt;/b&gt;&lt;br /&gt;
• JDK 6 (JRE alone is not sufficient) &lt;br /&gt;
• NDK &lt;br /&gt;
• For all development platforms, GNU Make 3.81 or later is required. Earlier versions of GNU Make might work but have not been tested. &lt;br /&gt;
• A recent version of awk (either GNU Awk or Nawk) is also required. &lt;br /&gt;
• For Windows, Cygwin 1.7 or higher is required. The NDK will not work with Cygwin 1.5 installations. &lt;br /&gt;
• Apache Ant 1.8 or later &lt;br /&gt;
• Not compatible with Gnu Compiler for Java (gcj) &lt;/p&gt;
&lt;p&gt;Note: Some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which are not supported for Android development.&lt;br /&gt;
&lt;/p&gt;
&lt;h2 id="12-setting-up-ide"&gt;1.2  Setting up IDE&lt;/h2&gt;
&lt;p&gt;There are two approaches to properly set up development enviroment for running &lt;br /&gt;
project LynxSight. First is download and install all development tools separatelly and &lt;br /&gt;
avoid installing development tools which could be useless. Second approach expects &lt;br /&gt;
download and installation of Tegra android development pack. This option si &lt;br /&gt;
recommended for developers less experienced in android development and also every &lt;br /&gt;
developer which has not configured his enviroment yet. Consider properly which &lt;br /&gt;
approach would you choose before started developing. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;1.2.1 Tegra android development pack&lt;/b&gt;&lt;br /&gt;
Tegra android development pack includes all software tools required to develop &lt;br /&gt;
for Android platform. The pack is availiable to download at &lt;br /&gt;
&lt;a href="https://developer.nvidia.com/tegra-android-development-pack" rel="nofollow"&gt;https://developer.nvidia.com/tegra-android-development-pack&lt;/a&gt;. Before downloading &lt;br /&gt;
registering at NVIDIA developer zone and signing up is required. To be able to get the &lt;br /&gt;
pack you have to apply Tegra registered developer program. After application it is &lt;br /&gt;
necessary to wait until your request is approved. After installation file is run you are &lt;br /&gt;
forced to choose which tools you want to download and install. &lt;br /&gt;
 Select&lt;br /&gt;
• Eclipse IDE &lt;br /&gt;
• Android Software development kit (SDK including ADT) &lt;br /&gt;
• Android Native development kit (NDK) &lt;br /&gt;
• Cygwin (when using Windows OS) &lt;br /&gt;
• Apache Ant &lt;br /&gt;
LynxSight  System reference&lt;br /&gt;
• Java development kit (JDK) &lt;br /&gt;
• OpenCV for Android platform &lt;/p&gt;
&lt;p&gt;Use of current version of development tools is highly recommended option. &lt;br /&gt;
Download and installation can take even several hours according to local internet &lt;br /&gt;
connection and variety of selected Android SDK versions. It is recommended to install &lt;br /&gt;
tools for every version since Android API 7.&lt;br /&gt;
Notice where are tools installed and properly set system enviroment variables to &lt;br /&gt;
Cygwin, Android SDK, JDK, NDK and Apache ant. To set system enviroment variables &lt;br /&gt;
go to Control panel – System – Advanced system settings – Enviroment variables. Edit &lt;br /&gt;
Path variable with addition of Path of mentioned tools above if they have not been set &lt;br /&gt;
yet. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;1.2.2 Integrating Eclipse IDE&lt;/b&gt; &lt;br /&gt;
Different status of developer means different configuration. If you are using Tegra &lt;br /&gt;
android development pack, your Eclipse IDE should be binded with Android SDK and&lt;br /&gt;
NDK. If it is not, or different approach is used, including building enviroment from &lt;br /&gt;
scratch or adding tools to existing Eclipse enviroment, several steps should be &lt;br /&gt;
performed. &lt;br /&gt;
To import LynxSight project to Eclipse IDE go to File – Import – Existing Projects &lt;br /&gt;
into Workspace, select Browse and find destination of Eclipse project LynxSight in file &lt;br /&gt;
system. Project appears in local Workspace. Probably it would contains errors and &lt;br /&gt;
additional configuration is required. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;1.2.3 Android Development Tools&lt;/b&gt; &lt;br /&gt;
In Tegra version check if Android SDK is properly set. Android SDK is core of &lt;br /&gt;
Android Development Tools. Android development tools provide tools to compile, &lt;br /&gt;
debug, run and test android applications. Also Android device emulator is included. At &lt;br /&gt;
Windows – Preferences – Android check SDK Location which should match the &lt;br /&gt;
location of Android SDK in file system.&lt;br /&gt;
In non Tegra version when Android SDK is not present, install perform the &lt;br /&gt;
following steps: &lt;br /&gt;
1. Start Eclipse, then select Help &amp;gt; Install New Software. &lt;br /&gt;
2. Click Add, in the top-right corner. &lt;br /&gt;
3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location:&lt;br /&gt;
&lt;a href="https://dl-ssl.google.com/android/eclipse/" rel="nofollow"&gt;https://dl-ssl.google.com/android/eclipse/&lt;/a&gt; &lt;br /&gt;
4. Click OK.&lt;br /&gt;
If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons). &lt;br /&gt;
5. In the Available Software dialog, select the checkbox next to Developer Tools and click Next. &lt;br /&gt;
6. In the next window, you'll see a list of the tools to be downloaded. Click Next.&lt;br /&gt;
7. Read and accept the license agreements, then click Finish.&lt;br /&gt;
If you get a security warning saying that the authenticity or validity of the software can't be established, click OK. &lt;br /&gt;
8. When the installation completes, restart Eclipse.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1.2.4 Android NDK&lt;/b&gt; &lt;br /&gt;
In Tegra version check if Android Native Developmen Kit (NDK) Path is properly &lt;br /&gt;
set. The NDK is a toolset that allows you to implement parts of your app using native-&lt;br /&gt;
code languages such as C and C++. At Windows – Preferences – Android - NDK check &lt;br /&gt;
the NDK Location which should match the location of Android NDK in file system. In &lt;br /&gt;
project LynxSight native modul Tesseract and OpenCV for Android are used. &lt;br /&gt;
In non Tegra version download Android NDK from &lt;br /&gt;
&lt;a href="http://developer.android.com/tools/sdk/ndk/index.html" rel="nofollow"&gt;http://developer.android.com/tools/sdk/ndk/index.html&lt;/a&gt; and unzip to the file system. &lt;br /&gt;
Then set the NDK path as was described above. &lt;br /&gt;
If project was imported incorrectly, or there is need for creating new project and &lt;br /&gt;
importing source and resource files manually, follow the following steps. Right click to &lt;br /&gt;
the project – Android tools – Add native support. Check if jni directory was generated. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;1.2.5 Tesseract for Android&lt;/b&gt; &lt;br /&gt;
Project LynxSight already contains tess-two.jar library in libs directory. It also &lt;br /&gt;
contains required .so files liblept and libtess in libs/armeabi and libs/armeabi-v7a &lt;br /&gt;
folders. If you build your project using Windows you may use this compilated libraries. &lt;br /&gt;
However, if you build your project in another operating system you should build &lt;br /&gt;
Tesseract engine by yourself. Download the source or clone this git repository at &lt;br /&gt;
&lt;a href="https://github.com/rmtheis/tess-two" rel="nofollow"&gt;https://github.com/rmtheis/tess-two&lt;/a&gt;. This project contains tools for compiling the &lt;br /&gt;
Tesseract, Leptonica, and JPEG libraries for use on Android. It contains an Eclipse &lt;br /&gt;
Android library project that provides a Java API for accessing natively-compiled &lt;br /&gt;
Tesseract and Leptonica APIs. Go to your Android.mk file and add the following lines &lt;br /&gt;
between include $(CLEAR_VARS) and include $(BUILD_SHARED_LIBRARY: &lt;br /&gt;
 APP_PLATFORM := android-7&lt;br /&gt;
Use command line to build Tesseract 3.02 toolset for Android. Set current &lt;br /&gt;
directory to directory where you downloaded tess-two project. Now you are going to &lt;br /&gt;
build tesseract for your OS enviroment. Make sure you have set enviroment variables to &lt;br /&gt;
android NDK, android SDK and Apache ant. Variable --path means path to your tess-&lt;br /&gt;
two project. &lt;br /&gt;
 cd /tess-two  ndk-build  android update project --path .  ant release After succesfull build of tesseract project import tesseract project to your &lt;br /&gt;
Workspace. Then right click to the project Tesseract – Properties – Android –Check Is &lt;br /&gt;
library radio button. After that copy tess-two.jar library from Tesseract project build &lt;br /&gt;
folder to libs folder of your project. Also copy content of Tesseract libs folder to your &lt;br /&gt;
libs folder. It contains required native .so libraries for tesseract and leptonica support. &lt;br /&gt;
Then right click to your project – Android tools – Fix Project properties to make sure &lt;br /&gt;
tesseract tools are ready to use. &lt;br /&gt;
After the initial import, on a non-Windows (Linux and Mac OS) operating system &lt;br /&gt;
Eclipse will still show build errors for applications with native C++ code. To resolce the &lt;br /&gt;
issues, please do the following:  Open Project Properties -&amp;gt; C/C++ Build, and replace &lt;br /&gt;
“Build command” text to "${NDKROOT}/ndk-build" (remove .cmd at the end). &lt;/p&gt;
&lt;p&gt;&lt;b&gt;1.2.6 OpenCV for Android&lt;/b&gt; &lt;br /&gt;
OpenCV is toolset for image processing. It is important element of LynxSight &lt;br /&gt;
project becouse of presence of Decomposition modul. OpenCV for Android toolset is &lt;br /&gt;
also integrated in Tegra android development pack.&lt;br /&gt;
Once using Tegra android development kit, OpenCV toolset project should be &lt;br /&gt;
installed. Find the project in NVIDIA pack and inport to the Workspace. Reference your &lt;br /&gt;
project to project of OpenCV or reference to it’s library. To reference to OpenCV &lt;br /&gt;
project right click to the project OpenCV – Properties – Android – Check Is library &lt;br /&gt;
radio button and then right click to your project – Properties – Android – Add and select &lt;br /&gt;
library project OpenCV for Android. Make also sure, that OpenCV is placed in the &lt;br /&gt;
same directory. &lt;br /&gt;
Another way, which is more common is to import OpenCV .jar library to your &lt;br /&gt;
project. Once the OpenCV project is labeled as Library project, opencv library – &lt;br /&gt;
2.4.5.jar is placed in its bin folder. Copy this library to the libs folder of your project. &lt;br /&gt;
The same way is Tesseract for Android imported. &lt;br /&gt;
If you are not using Tegra android development pack, download OpenCV for &lt;br /&gt;
android SDK at &lt;a href="http://sourceforge.net/projects/opencvlibrary/files/opencv-android/"&gt;http://sourceforge.net/projects/opencvlibrary/files/opencv-android/&lt;/a&gt; . &lt;br /&gt;
Unzip the pack into the particular folder and notice the path. Follow the instructions like &lt;br /&gt;
Tegra pack user described above. &lt;br /&gt;
Go to your Android.mk file and add the following lines between include &lt;br /&gt;
$(CLEAR_VARS) and include $(BUILD_SHARED_LIBRARY: &lt;br /&gt;
 OPENCV_CAMERA_MODULES:=on  OPENCV_INSTALL_MODULES:=on An example is shown on Pic. 1.&lt;br /&gt;
Pic 1 Example of Android.mk file used in project LynxSight &lt;br /&gt;
For more information abou setting up the OpenCV for Android toolset follow the &lt;br /&gt;
instructions at: &lt;br /&gt;
&lt;a href="http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_S
DK.html#get-the-opencv4android-sdk" rel="nofollow"&gt;http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_S
DK.html#get-the-opencv4android-sdk&lt;/a&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1.2.7 Android support v7&lt;/b&gt; &lt;br /&gt;
Although there is a presumption, that software developed with official android &lt;br /&gt;
development tools should be able to run at most android based devices, the whole &lt;br /&gt;
system involve and older version use not to respect new features. That is why Android &lt;br /&gt;
support v7 is used. In project LynxSight it brings compatible action bar to all Android &lt;br /&gt;
versions since Android SDK version 7. &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;To get Android support v7 library follow the following instructions: &lt;br /&gt;
1. Start the Android SDK Manager. &lt;br /&gt;
2. In the SDK Manager window, scroll to the end of the Packages list, find the Extras folder and, if necessary, expand to show its contents. &lt;br /&gt;
3. Select the Android Support Library item.&lt;br /&gt;
Note: If you're developing with Android Studio, select and install the Android Support Repository item instead.&lt;br /&gt;
4. Click the Install packages... button. &lt;/p&gt;
&lt;p&gt;Fill metadata in uses-sdk tab in your Android manifest file. MinSdkVersion field is &lt;br /&gt;
required. &lt;br /&gt;
&lt;br /&gt;
After installing the particular packages in your AVD manager notice their location &lt;br /&gt;
and import project Android support v7 appcompat to your Workspace. Then put a &lt;br /&gt;
reference from your project to the Android support project. It is important to use project &lt;br /&gt;
reference instead of library reference becouse resource files in Android support project. &lt;br /&gt;
Putting a project reference process is described in OpenCV and also Tesseract section. &lt;br /&gt;
For troubleshooting and more details about Android support v7 setup follow &lt;br /&gt;
&lt;a href="http://developer.android.com/tools/support-library/setup.html" rel="nofollow"&gt;http://developer.android.com/tools/support-library/setup.html&lt;/a&gt;&lt;br /&gt;
&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tibor Fecko</dc:creator><pubDate>Sat, 14 Sep 2013 09:25:54 -0000</pubDate><guid>https://sourceforge.net5702f98fc0db5ea465992fa7664fa426d0dd1fb0</guid></item></channel></rss>