how you can build a vm in android platform?<br>Because I know android is running on linux but again it<br>depends on the device. If they start building cellphone based<br>on atom processor you must follow the same instruction as a 386 processor.<br>
<br>--Nikos Hatzopoulos<br><br><div class="gmail_quote">On Thu, Aug 11, 2011 at 5:08 PM, Jim Pendleton <span dir="ltr"><<a href="mailto:jimp@ittvis.com">jimp@ittvis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div link="blue" vlink="blue" lang="EN-US">
<div>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">Nikos,<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">Building for Java in a standard Linux
environment is a little different from building in the<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">Android environment. We’ve used as
a starting point these instructions:<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy"><a href="http://trac.osgeo.org/gdal/wiki/BuildingForAndroid" target="_blank">http://trac.osgeo.org/gdal/wiki/BuildingForAndroid</a><u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">Though in theory they could be buillt, the
individual stand-alone apps such as gdalinfo<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">must be run from a command line (I
believe) which is lacking in the Android environment, without<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">rooting. Rooting is not presently an
option for me for various administrative reasons.<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">I’m actually commenting out the
builds for the stand-alone applications.<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">What I’m really building in this
case is the libgdaljni.so file (along with libjdalconst.so) that can<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">be loaded and executed from an Android activity.
Our libgdaljni.so contains the link results of<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">from libgdal.a, gdal_wrap.o and some
kakadu library routines.<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">If there’s an entry point within the
libgdaljni.so that will perform the equivalent functionality as<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">the stand-alone gdalinfo executable, I
could try that.<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy">Jim P.<u></u><u></u></span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<div>
<div class="MsoNormal" style="text-align:center" align="center"><font face="Times New Roman" size="3"><span style="font-size:12.0pt">
<hr align="center" size="2" width="100%">
</span></font></div>
<p class="MsoNormal"><b><font face="Tahoma" size="2"><span style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size:10.0pt;font-family:Tahoma"> Nikolaos
Hatzopoulos [mailto:<a href="mailto:nhatzop@gmail.com" target="_blank">nhatzop@gmail.com</a>] <br>
<b><span style="font-weight:bold">Sent:</span></b> Thursday, August 11, 2011
5:56 PM<br>
<b><span style="font-weight:bold">To:</span></b> Jim Pendleton<br>
<b><span style="font-weight:bold">Cc:</span></b> Even Rouault;
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<b><span style="font-weight:bold">Subject:</span></b> Re: [gdal-dev] SWIG JNI
binding question with GetMetadataItem function</span></font><u></u><u></u></p>
</div><div><div></div><div class="h5">
<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size:12.0pt"><u></u> <u></u></span></font></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><font face="Times New Roman" size="3"><span style="font-size:12.0pt">Did you follow these
instructions?<br>
<br>
<a href="http://trac.osgeo.org/gdal/wiki/GdalOgrInJavaBuildInstructionsUnix" target="_blank">http://trac.osgeo.org/gdal/wiki/GdalOgrInJavaBuildInstructionsUnix</a><br>
<br>
this command must work:<u></u><u></u></span></font></p>
<pre><font face="Courier New" size="2"><span style="font-size:10.0pt">java -classpath `pwd`/gdal.jar:`pwd`:`pwd`/build/apps gdalinfo<u></u><u></u></span></font></pre>
<p class="MsoNormal" style="margin-bottom:12.0pt"><font face="Times New Roman" size="3"><span style="font-size:12.0pt">as the instruction are
saying:<br>
<i><span style="font-style:italic">With luck you will see the gdalinfo usage
message. </span></i><br>
<br>
and try to see a gdalinfo of a file<br>
<br>
--Nikos Hatzopoulos<u></u><u></u></span></font></p>
<div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size:12.0pt">On Thu, Aug 11, 2011 at 3:21 PM, Jim Pendleton <<a href="mailto:jimp@ittvis.com" target="_blank">jimp@ittvis.com</a>> wrote:<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size:12.0pt"><br>
Even,<br>
<br>
Thanks for the suggestion, but if I've implemented your<br>
suggestion properly, it has not solved the underlying problem.<u></u><u></u></span></font></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><font face="Times New Roman" size="3"><span style="font-size:12.0pt"><br>
>I'm not sure how you've compiled the gdal_warp.cpp, but if you didn't<br>
>use the provided swig/java/GNUmakefile, there's one point you must be<br>
>very careful that is mentionned at the bottom of that makefile :<u></u><u></u></span></font></p>
</div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size:12.0pt">To create a .so file from source in Android, you generally use the<br>
ndk-build utility along with one or more Android.mk and Application.mk<br>
files. I execute the standard make/make install from<br>
within the swig/java directory, then I compile and link gdal_wrap.cpp<br>
within the context of a separate ndk-build process.<br>
<br>
Android NDK Release 6 uses GNU Make 3.81 as its build utility.<br>
<br>
The compiler in my case is arm-linux-androideabi-g++ (GCC) 4.4.3.<br>
<br>
The loader is GNU ld (GNU Binutils) 2.19.<u></u><u></u></span></font></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><font face="Times New Roman" size="3"><span style="font-size:12.0pt"><br>
># Do not remove -fno-strict-aliasing while SWIG generates weird code<br>
>in upcast methods<br>
># See <a href="http://trac.osgeo.org/gdal/changeset/16006" target="_blank">http://trac.osgeo.org/gdal/changeset/16006</a><br>
<br>
>That would be a plausible cause for the crash, since in your<br>
>particular case the GetMetadataItem() method is in the MajorObject<br>
>class, so the Dataset object needs to call the SWIGDatasetUpcast()<br>
>method...<u></u><u></u></span></font></p>
</div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size:12.0pt">Indeed I was lacking the -fno-strict-aliasing switch in the C++ flags
in<br>
my<br>
Android.mk file.<br>
<br>
However, I've added this switch to both LOCAL_CFLAGS and LOCAL_CPPFLAGS<br>
for the libgdaljni.so build and I continue to get the error during<br>
execution.<br>
<br>
To add some more info to my original message, the actual error comes<br>
from<br>
within Java_org_gdal_gdal_gdalJNI_MajorObject_1GetMetadataItem_1_1SWIG10<br>
in<br>
gdal_wrap.cpp on the call to jenv->GetStringUTFChars(jarg2, 0). First
a<br>
JNI<br>
warning is issued, then the access violation appears to occur before<br>
that<br>
function can return, or at least before a debug statement I've added<br>
after<br>
the call can send its output to the Android LogCat output.<br>
<br>
The error that's issued is related to jarg2 which is supposed to be a<br>
jstring, versus the jarg1 argument you mentioned which requires the<br>
upcast to GDALMajorObjectShadow.<br>
<br>
I think I'll need to further debug the pointers that are being passed<br>
down to the *GetMetadataItem*1SWIG10* function. None of them look<br>
outrageous at first glance.<br>
<br>
Again, there's every reason to believe I'm missing something that's<br>
otherwise obvious to the experts so please feel free to continue<br>
sending ideas my way!<u></u><u></u></span></font></p>
<div>
<div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size:12.0pt"><br>
Jim P.<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><u></u><u></u></span></font></p>
</div>
</div>
</div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size:12.0pt"><u></u> <u></u></span></font></p>
</div></div></div>
</div>
</blockquote></div><br>