Log in or register to post comments

to C or not to C , plus plus

October 13, 2010 - 10:43pm #1

Ive yet to download the SDK because i've only begun to explore Android development and my question is if its possible to make a decent application with this SDK with out having to use much native code and doing any big changes , ex: like replace the sample 3d render with perhaps one of my own and do the rest from Eclipse in java? i mean what is the complexity of an app that i can make without having to get into lower level programming? or am i over simplifying the process?

Re: to C or not to C , plus plus

October 14, 2010 - 2:26pm #4

You speak the truth Kim , i can see how the constant crossing of calls between the language boundaries could hinder performance , so its time to hit the books for me , nonetheless i look forward to tinkering with this , another question regarding Trackables , it would be intereting perhaps in the future to lose predetermined trackables , for example I compile an application with no trackable and the user simply snaps a shot of any surface on his phone and then the app itself, or maybe a separate app, takes that image and compiles a file to be used for the tracking weather it involves uploading to Qualcomm and retreiving the file or just have it do the work on the phone , the latter however would require either an api or release of the algorithms used. just a thought.

Re: to C or not to C , plus plus

October 14, 2010 - 6:34am #3

It will be quite useful to have a working understanding of at least OpenGL for creating your own 3D augmented reality scenes. The SDK does not provide a robust loader/renderer for 3D content, so if you want to render anything more complicated than a static model you will need to either write your own or bring in a 3rd party library. All of that involves modifying the native code.

Is is possible to write the rest of your application in Java, if you would like. You will need a good understanding of the JNI (Java Native Interface) for this, as it requires a few calls back and forth between Java and native. Do note that this comes at a bit of a performance hit, and that you want to minimize the number of calls across this boundary.

Things get trickier when you want to share a lot of state data between Java and native. Let's say you are writing a game, and all the game logic is in Java, while rendering is done in native. How much information needs to be passed to native to render your scene? Again, in order to minimize function calls across the Java/native boundary, you would want to send all of the relevant information in the function call to native, rather than having native query Java for each piece of information. This can become cumbersome for complex scenes.

In short, the choice is up to you. Your application will probably perform better if you can write everything in native, but there are valid reasons for using Java as well, including ease-of-use and access to the Android SDK.

- Kim

Re: to C or not to C , plus plus

October 13, 2010 - 10:44pm #2

and this should probably not have been a thread on its own just a question else where sorry , feel free to delete if inconveniently placed .

Log in or register to post comments