<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VANGOGH Lab</title>
	<atom:link href="http://vangogh.umbc.edu/feed/" rel="self" type="application/rss+xml" />
	<link>http://vangogh.umbc.edu</link>
	<description>Visualization and Computer Graphics Research</description>
	<lastBuildDate>Mon, 29 Apr 2013 01:28:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Building OpenSceneGraph on Android Tablet</title>
		<link>http://vangogh.umbc.edu/2012/06/27/building-openscenegraph-on-android-tablet/</link>
		<comments>http://vangogh.umbc.edu/2012/06/27/building-openscenegraph-on-android-tablet/#comments</comments>
		<pubDate>Wed, 27 Jun 2012 18:30:23 +0000</pubDate>
		<dc:creator>Yu Wang</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[OpenSceneGraph]]></category>
		<category><![CDATA[OSG]]></category>

		<guid isPermaLink="false">http://vangogh.umbc.edu/?p=50</guid>
		<description><![CDATA[To properly setup an environment for Android development using OpenSceneGraph, we need the following hardware and software: Android Tablet &#8211; Acer Iconia Tab A510 (Tegra 3 Processor) OpenSceneGraph &#8211; 3.0.1 cmake: 2.8+ g++ Eclipse Indigo Ubuntu 11.04 or Ubuntu 11.10 Android SDK Android NDK Setup a working Android development environment in Ubuntu: Open Synaptic Package [...]]]></description>
				<content:encoded><![CDATA[<p>To properly setup an environment for Android development using OpenSceneGraph, we need the following hardware and software:</p>
<ul>
<li>Android Tablet &#8211; Acer Iconia Tab A510 (Tegra 3 Processor)</li>
<li>OpenSceneGraph &#8211; 3.0.1</li>
<li>cmake: 2.8+</li>
<li>g++</li>
<li>Eclipse Indigo</li>
<li>Ubuntu 11.04 or Ubuntu 11.10</li>
<li>Android SDK</li>
<li>Android NDK</li>
</ul>
<p><strong>Setup a working Android development environment in Ubuntu:</strong></p>
<p>Open Synaptic Package Manager.</p>
<p>Install package <em>openjdk-6-jdk</em>.</p>
<p>Install the following two packages using either Synaptic or apt-get:</p>
<p><em>cmake (sudo apt-get install cmake)</em></p>
<p><em>g++</em></p>
<p>Download Eclipse and extract it.<br />
<em>$HOME/Android/eclipse/</em></p>
<p>Download Android SDK and extract it into</p>
<p><em>$HOME/Android/android-sdk-linux/</em></p>
<p>Install ADT-Plugin into Eclipse.</p>
<p><em>Start Eclipse -&gt; Help -&gt; Install New Software -&gt; in the field &#8216;Work with:&#8217;, fill in &#8220;https://dl-ssl.google.com/android/eclipse/&#8221;, then press Enter -&gt; check &#8220;Developer Tools&#8221; -&gt; press Next till everything is installed.</em></p>
<p>After restarting Eclipse: <em>Window -&gt; Android SDK Manager. </em>Install AT Least Android 2.2 (API 8).(I installed ALL the Android API versions from API 8 to API 15). I installed these APIs to</p>
<p><em>$HOME/android-sdks/</em></p>
<p>Extract Android NDK to</p>
<p><em>$HOME/Android/android-ndk-r8b/</em></p>
<p>(ndk-r7b and ndk-r7b have been proven to work with OSG)</p>
<p>After everything has been copied to the appropriate directories, we now have a working environment for Android development.</p>
<p><strong>Installing OpenSceneGraph 3.0.1 for Android with OpenGE ES 1.x</strong></p>
<p><strong></strong>Download OpenSceneGraph-3.0.1 (<a title="link to OpenSceneGraph.org download page" href="http://www.openscenegraph.org/projects/osg/wiki/Downloads" target="_blank">link</a>) and extract it to</p>
<p><em>$HOME/Android/OpenSceneGraph-3.0.1/</em></p>
<p>Download the 3rd party dependencies (<a title="link to 3rd party dependencies at Alpha Pixel" href="http://openscenegraph.alphapixel.com/osg/downloads/openscenegraph-third-party-library-downloads" target="_blank">link</a>) and extract it to</p>
<p><em>$HOME/Android/OpenSceneGraph-3.0.1/3rdparty/</em></p>
<p>Add environment variables so that cmake will find the right dependencies, open ~/.bashrc and add the following lines at the end of the file and save it:</p>
<p><em>export ANDROID_NDK=$HOME/Android/android-ndk-r7b </em><br />
<em>export ANDROID_SDK=$HOME/android-sdks</em></p>
<p>Create two folders:</p>
<p><em>$HOME/Android/OpenSceneGraph-3.0.1/build</em></p>
<p><em>$HOME/Android/OpenSceneGraph-3.0.1/osginstall</em></p>
<p>Open a terminal and change directory to</p>
<p><em>$HOME/Android/OpenSceneGraph-3.0.1/build</em></p>
<p>Type in or copy the following command in the terminal and press Enter (the flag -DJ=4 is to specify we have a quad-core processor):</p>
<p><em>cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DOSG_GL_MATRICES_AVAILABLE=ON -DOSG_GL_VERTEX_FUNCS_AVAILABLE=ON -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=ON -DOSG_GL_FIXED_FUNCTION_AVAILABLE=ON -DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF -DOSG_GL1_AVAILABLE=OFF -DOSG_GL2_AVAILABLE=OFF -DOSG_GL3_AVAILABLE=OFF -DOSG_GLES1_AVAILABLE=ON -DOSG_GLES2_AVAILABLE=OFF -DJ=4 -DCMAKE_INSTALL_PREFIX=$HOME/Android/OpenSceneGraph-3.0.1/osginstall</em></p>
<p>After that, we build it (this step usually takes quite a while):</p>
<p><em>make</em></p>
<p>Install libraries and headers into $HOME/Android/OpenSceneGraph-3.0.1/osginstall into the folder obj, lib, and include, by typing:</p>
<p><em>make install</em></p>
<p>After this, we have a working environment for developing Android application using OpenSceneGraph.</p>
<p><strong>An Example: creating and build a project</strong></p>
<p>Copy the folder osgAndroidExampleGLES1 from</p>
<p><em>$HOME/Android/OpenSceneGraph-3.0.1/examples</em></p>
<p>to your Eclipse workspace</p>
<p><em>$HOME/workspace/osgAndroidExampleGLES1</em></p>
<p>Copy the three folders under $HOME/Android/OpenSceneGraph-3.0.1/osginstall, obj, lib, and include to your project folder:</p>
<p><em>$HOME/workspace/osgAndroidExampleGLES1</em></p>
<p>Start Eclipse -&gt; New -&gt; Project -&gt; Android Project, choose &#8220;Create project from existing source&#8221; and set the location to <em>$HOME/workspace/osgAndroidExampleGLES1 -&gt; Project Name is &#8220;osgAndroidExampleGLES1&#8243;, then Next -&gt; build target should be Android 2.2 (API 8) or higher.</em></p>
<p><em></em>In Eclipse project browser, expand the folder <em>jni</em> and open Android.mk in text editor, make the following two changes and save it:</p>
<div>
<div>Change line 7 to:</div>
<div><em>OSG_ANDROID_DIR := /home/USER/workspace/osgAndroidExampleGLES1</em></div>
<div>Change line 21 to:</div>
<div><em>LOCAL_DLIBS := -llog -lGLESv1_CM -ldl -lz -lgnustl_static</em></div>
<div></div>
<div>Open a terminal, and change directory to</div>
<div><em>$HOME/workspace/osgAndroidExampleGLES1</em></div>
<div>Type</div>
<div><em>$ANDROID_SDK/tools/android list targets</em></div>
<div>look for &#8220;android-8&#8243;, it&#8217;s the device with id: 7 under my setup, and you should change it according to your output.</div>
</div>
<p>Type</p>
<p><em>$ANDROID_NDK/ndk-build</em></p>
<p>Now the native code has been built for the Android OSG Viewer, we can go back to Eclipse and build the project from there.</p>
<p>A <a title="osgViewer running on Acer tablet" href="http://www.youtube.com/watch?feature=player_detailpage&amp;v=_b1B8uOBwdo" target="_blank">video</a> demonstrating the osgViewer application on the Acer tablet.</p>
<p>* this tutorial was adapted from <a title="Setup OSG on Android" href="http://forum.openscenegraph.org/viewtopic.php?p=46357#46357">this</a> link.</p>
]]></content:encoded>
			<wfw:commentRss>http://vangogh.umbc.edu/2012/06/27/building-openscenegraph-on-android-tablet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
