Log in or register to post comments

Some clarification for on compiling samples?

March 28, 2011 - 7:31pm #1

Hey guys. I'm running through my first time setup of the SDK and am rather stuck on step 3, where I need to compile shared objects for the NDK. I have the SDK environment set up properly but I don't understand how to compile the shared objects.

Quote:

Compile the Shared Object with Application Code

Android NDK applications are deployed as shared objects with a Java bootloader. In this step we create the binary *.so file that is later packaged through Eclipse. For each sample app you will need to build the application *.so separately.
Build ImageTargets shared library

Change directory to ImageTargets in the \qcar-sdk-xx-yy-zz\samples directory and execute

Basically as I look at this, and the code compiled beneath I'm missing the link in terms of how to apply it. I've been trying to do this in cygwin and after having it fail several times I am convinced I am making a silly n00b error and need someone who's familiar with this process to provide clarification on this step of the process for me if you can.

I really hate asking with something that seems fairly straight forward on the tutorial but my brain just isn't processing this step right :\

Some clarification for on compiling samples?

November 24, 2013 - 8:58am #24

Check that you've set-up your development environment correctly - https://developer.vuforia.com/resources/dev-guide/step-1-setting-development-environment-android-sdk

Specifically confirm that your NDK path is defined correctly.

Some clarification for on compiling samples?

November 24, 2013 - 8:02am #23

sir why command not found? i type ndk-build after the directories .. nothing happen it says command not found..can you help me? :( ,, noob here

AttachmentSize
Image icon wtf.JPG56.78 KB

Re: Some clarification for on compiling samples?

April 14, 2011 - 5:34am #22

Thanks a bunch :)

Re: Some clarification for on compiling samples?

April 13, 2011 - 12:36pm #21

Virtual Buttons are currently supported, the only trick is that you have to edit their position in the config.xml file instead of through the Unity editor. Take a look at the VirtualButtons sample project that comes with the SDK. It should have an ImageTargetEventHandler script attached to the target. You can use that as a reference point for writing your own implementation.

- Kim

Re: Some clarification for on compiling samples?

April 13, 2011 - 6:33am #20

I got it working after tinkering with a new project again. I made sure the required packages were imported properly and I was able to then get a running app in my device. I've navigated around designing and implementing the splash page, icon, etc for the program launch so me and the people I'm working with can now start doing the modeling. We'll be tinkering with the virtual buttons to see about getting them to work with out interface in the mean time.

I think the only major issue left is determining whether or not the functionality of the buttons needs to be done in unity or eclipse. If it's possible to handle the events without leaving unity it would be ideal. One thing I did notice between my set up and that described on the SDK guide, is that when the example is set up to configure the buttons there's a section in the instance browser which shows image target event handlers: https://ar.qualcomm.com/resources/images/unity/VirtualButtons.png

Upon configuring the code in the config.xml I see the buttons panel, but not the event handlers. I was hoping to find maybe a source file that I can reference in order to see the code structure there (correct me if I'm mistaken but I assume one of the files is missing leading to this). With our deadline and my team being new with it I'd like to keep the app development relatively simple, and so far the options in Unity for one-step app building has been a major help since I've learned to use it some through trial and error + your assistance.

EDIT: I did review some threads made a while back and from what I read, up until recently at least the VB's were not supported within unity and they were slated for support in a future release. Has this circumstance changed?

Re: Some clarification for on compiling samples?

April 11, 2011 - 8:25pm #19

Try checking the log file for an error (use the ddms tool that comes with the Android SDK distribution).

Make sure that the device is connected to the internet when running the app. You may also want to try a simple cube object on the target before trying your models.

- Kim

Re: Some clarification for on compiling samples?

April 11, 2011 - 7:53pm #18

If it helps any, I'm using Unity 3.3 having made sure that the qualcomm 3.2 patch is installed and imported.

This is the model I have right now inside unity:
http://img716.imageshack.us/img716/3073/unityshot.jpg

And this is the error I got. I had actually tried exporting the apk directly earlier on, but wasn't sure about the error

I'm also wondering in this being a complex model may be causing it. I know that these devices aren't exactly powerful with major 3d models.

EDIT: tried a simpler model and got the same error. Seems it's something else. I guess I'll go ahead and redo the tutorial on the development page and see what I get. I followed it for my modeling stuff but it seems that I'm doing something wrong when I'm starting the model.

Re: Some clarification for on compiling samples?

April 11, 2011 - 7:32pm #17

Typically you don't need to use ndk-build when using our Unity Extension. You should just be able to create your scene in Unity and run it directly (Build & Run). Are you trying to do something different here?

- Kim

Re: Some clarification for on compiling samples?

April 11, 2011 - 7:20pm #16

And I can confirm it. I bought the device this afternoon and tried the sample tea-cup app. I'm now trying to export from unity and build. After some tinkering I found that one of the folders isn't exporting when I try to build the library. Each of the sample folders has a JNI folder with an android.mk file that cygwin needs to access. It seems mine isn't exporting it when I take it from Unity to prepare for eclipse. This is the warning i get:


Unfortunately yet again I'm not exactly clear on how this gets done between unity and eclipse, whether I need to assemble it manually, or whether unity is supposed to generate it.

EDIT: after reading a couple of recent threads, it seems I do need to generate the files for the jni folder. Guess I'll look around and see if another thread has already covered this just in case.

Re: Some clarification for on compiling samples?

April 11, 2011 - 10:52am #15

Yep, this device should work! It's on the supported devices list.

- Kim

Re: Some clarification for on compiling samples?

April 11, 2011 - 10:44am #14

This is one of the ones I've looked at:
http://www.overstock.com/Electronics/Huawei-S7-Ideos-Unlocked-Wi-Fi-3G-Android-Tablet/5734902/product.html?cid=123620

Operating system: Google Android 2.1
Display: 7-inch touchscreen TFT LCD 800x480
Webcam: 2-megapixels
Processor: 768MHz Qualcomm Snapdragon
Memory: 256MB
Networking: HSDPA: up to 7.2 Mbit/s, HSUPA: up to 5.76 Mbit/s, WiFi 802.11b/g/n
Ports: USIM card socket, SD card slot, Micro USB, 3.5mm stereo audio jack,
Battery: Li-Ion 2200mAh
Model: Ideos S7

Re: Some clarification for on compiling samples?

April 11, 2011 - 10:02am #13

So QCAR should work with all 2.1 and 2.2 Snapdragon devices. Which tablets are you looking at in particular?

- Kim

Re: Some clarification for on compiling samples?

April 11, 2011 - 9:57am #12

That's fine, we were looking at the ones with either 2.1 or 2.2 as their OS version with a Qualcomm Snapdragon processor. Found one with those specs just didn't want to commit to getting one with out first confirming whether the SDK specs could also be applied to tablets

Re: Some clarification for on compiling samples?

April 11, 2011 - 8:29am #11

The SDK does not currently support any Android OS 3.0 (honeycomb) devices, which includes all tablets. Support for these devices will be added in the future, but not soon enough for me to recommend purchasing one for current development efforts.

- Kim

Re: Some clarification for on compiling samples?

April 11, 2011 - 7:27am #10
ksiva wrote:

What device are you using? Make sure it is supported, there is a list of Supported Devices on the SDK main page: http://ar.qualcomm.com

- Kim

Hi sorry about the late response, and sorry yet again for having you answer something that I should've already read. x.x

The device I tried out was not supported and that was the iussue. I had asked partly because I'm doing my app as part of a class and my instructor's phone was originally intended to be the test device. The group I'm working with doesn't have and android device, though I've asked a colleague in my architecture studio if we could use his, which based on the list is supported.

I guess I'd like to ask one more thing, because while our group can get a phone if absolutely needed, and we have someone who's willing to help in any event, a couple of us were looking into using and android tablet, since they're easier to get without needing to get a contract. The development SDK mostly focus on phone devices, but I've seen a few recent tablet models using qualcomm's hardware. Would any of these possibly work instead of a phone or are tablets too significantly different from the hardware specs listed on the development page to be viable options?

Re: Some clarification for on compiling samples?

April 4, 2011 - 4:57am #9

What device are you using? Make sure it is supported, there is a list of Supported Devices on the SDK main page: http://ar.qualcomm.com

- Kim

Re: Some clarification for on compiling samples?

April 3, 2011 - 6:39pm #8

Sorry for the double post, but I figured it'd be better to address this question her than to make an entirely new thread. When I tested this on the android, the app installed ocrrectly but gives me the following when I initialize it:

network connection required to initialize camera settings

I know that the message says if the error continues it could also be program incompatibility or something else, but i wanted to know if there was an additional cause with the network connection or a setting in the phone that has to be mark to let it work. The internet was connecting just fine on the phone from what I could tell but not for the compiled app.

Re: Some clarification for on compiling samples?

March 30, 2011 - 4:26am #7

Wanted to say this last night but couldn't log in for some reason :\
I spent a fair amount of time double checking things and finally got it working. I had the system path variables entered in the wrong field (corrected)
Kept making typos while applying the command
and I misread the original instructions, which your clarification helped with immensely.

I will try setting this up on my other computer. But tentatively I have the process done right. :)

Thanks a whole bunch for your patience with me, lol

EDIT: Works on my windows 7 64 bit system too :)

Re: Some clarification for on compiling samples?

March 29, 2011 - 11:51am #6

Just in case it helps, the instructions for adding the Android NDK to your system PATH are in the Android NDK section of the guide. One thing to watch out for is the version of the Android NDK you have. The guide uses this as an example path:

;C:\Development\Android\android-ndk-r5\

But if you just got the NDK you probably have version r5b:

;C:\Development\Android\android-ndk-r5b\

Just double check the paths, and be sure to restart Cygwin after changing them!

- Kim

Re: Some clarification for on compiling samples?

March 29, 2011 - 11:33am #5
ksiva wrote:

Looks like you just forget the space between "cd" and the path. Again, it should be something like this:

cd /cygdrive/c/Development/Android/qcar-sdk-0-10-0/samples/ImageTargets
  ^ note the space

Look carefully at that path and make sure it makes sense for your computer. For instance, the "c" after cygdrive refers to the C drive, have you installed the sdk on C or on another drive?

Our SDK comes with a number of sample projects, they are all in the "samples" directory. ImageTargets is the name of one sample, and that's the one the command above with take you to.

- Kim

Yeah I saw that and was editing my post. I'm terribly sorry for that one. The big question for me was on the samples. And as said in my edit, I got the command not found error. I'll check the directories in my android folder and see if it's there first. I know I searched for it and found it in one of the other sample directories. I'll keep you updated

Re: Some clarification for on compiling samples?

March 29, 2011 - 11:20am #4

Looks like you just forget the space between "cd" and the path. Again, it should be something like this:

cd /cygdrive/c/Development/Android/qcar-sdk-0-10-0/samples/ImageTargets
  ^ note the space

Look carefully at that path and make sure it makes sense for your computer. For instance, the "c" after cygdrive refers to the C drive, have you installed the sdk on C or on another drive?

Our SDK comes with a number of sample projects, they are all in the "samples" directory. ImageTargets is the name of one sample, and that's the one the command above will take you to.

- Kim

Re: Some clarification for on compiling samples?

March 29, 2011 - 11:06am #3

Hi ksiva, thanks for the response. At the moment I am using the default set up detailed on the main sdk page so I should have the same set up as you providing I've done it correctly. This is the error message I got when using cygwin to input the command you provided:

As I recall from reading the setup, I do know I need to add paths to "my Computer's" variable environments. I did this, but I know it's one of the less familiar tasks I've performed in windows so I'm open to mistakes leading to this error. I'm just not sure if it specifically would lead to the error shown above.

Also you mentioned that my directory deals with the sample I'm trying to edit, would this be a project that exists in the ndk samples folder that I can use? Did you have a new project already set up in yours? If so, that may be one of the other possibilities, that I completely skipped something. As you can probably tell I'm extremely new to the android programming so, even sticking with the samples I'm finding it difficult to understand this easily.

EDIT: Looking at my own setup, it seems the sample files associated with the tea pot example are present:

Hopefully this helps, with explaining my issue.

EDIT 2: Wait, Got the first to work, ndk-build command however results in a "command not found"
First issue was a typo. I'll double check some things while I wait for your input. It'll bug me if I don't at least try to learn it myself :)

Thanks for your help so far

Re: Some clarification for on compiling samples?

March 29, 2011 - 7:19am #2

Start by opening Cygwin. You first need to change directories to the sample you wish to compile. This you do using the "cd" command. Here's the command I use for my setup:

cd /cygdrive/c/Development/Android/qcar-sdk-0-10-0/samples/ImageTargets

Then you build the shared library using the "ndk-build" command. Just type "ndk-build" (without quotes) and hit enter.

Let me know if you're still having trouble.

- Kim

Log in or register to post comments