Using a C++ library with Android

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Using a C++ library with Android

Postby luca » Fri Sep 10, 2010 10:42 am

Hi to all,

my name is Luca and i am new :) to this forum. Yesterday i have installed the Android SDK and NDK because i would like to start developing software for the Android platform.

I have written a C++ library that would like to reuse with Android. I have read that Java is the main language in order to write applications for A. (but i am not sure about this), but the NDK allows a programmer to reuse or develop in C++.

What is not clear to me is:

1] Can i use only C++ to write apps or i am forced to use Java?
2] Can i write an application for A. that uses a C++ lib ?
3] If the answer to 2] is positive:
Where can i read more about the mechanism that allows Java code to call and exchange data
with C++ code?

I hope this questions are not asked too much (in that case please accept my apologies!) :P
Thank you,
Luca
luca
Freshman
Freshman
 
Posts: 2
Joined: Thu Sep 09, 2010 12:33 pm

Top

Re: Using a C++ library with Android

Postby Davide » Fri Sep 10, 2010 6:02 pm

1) No, you have to use c++ only for libs.
2) Yes.
3) You can read about that trhough samples that are included in the ndk.

:)
Davide
Experienced Developer
Experienced Developer
 
Posts: 69
Joined: Mon Oct 19, 2009 12:05 pm
Location: Italy

Re: Using a C++ library with Android

Postby luca » Sat Sep 11, 2010 12:26 pm

Ok, thank you. I have another question. Suppose that i have developed a library in C++ that i want to use in a project and some functions of the lib needs data stored in a file.
The question is:

can i use the standard C lib functions for opening/closing/reading/writing files (like : fopen, fread etc...)?
can i use the streams of the C++ std for opening/closing/reading/writing files?

Thank you,
Luca
luca
Freshman
Freshman
 
Posts: 2
Joined: Thu Sep 09, 2010 12:33 pm

Re: Using a C++ library with Android

Postby Davide » Sat Sep 11, 2010 6:52 pm

This time you have to await another one. :) I have only done a little test with ndk.
Davide
Experienced Developer
Experienced Developer
 
Posts: 69
Joined: Mon Oct 19, 2009 12:05 pm
Location: Italy

Top

Return to General

Who is online

Users browsing this forum: No registered users and 4 guests