1

I am creating application through cross platform like phonegap.

I want to get all contacts information through android-ndk.

I know through cordova we are able to get the details. But I want to get it by default.without use of cordova library.

Is there any reference example to get contact & library for this.

Any URL,"Code example, appreciated.

Let me know if you have still any query to understand the question.

Waiting for your needfull help.

NovusMobile
  • 1,813
  • 2
  • 21
  • 48
  • So NDK offers way to execute C/C++ from Android code (Java), right? And you are using JavaScript to implement your app, or what does _platform like phonegap_ mean? – Roope Hakulinen Jan 07 '15 at 12:08
  • Yes. you are right.I am using javascript for this. & phoneGap you means perfectly the platform.I want to get contacts through phone without help of "cordova plugin". http://phonegap.com/ – NovusMobile Jan 07 '15 at 12:11

2 Answers2

-1

Fetching the contacts needs to be done in Java, for which reason you need the plugin in the first place to get those for JavaScript (the PhoneGap - which is by the way currently called Cordova - part). The NDK IMHO has nothing to do with this case, as it only allows you to execute the C/C++ code within the Java code for you to be able to use some libraries written in C/C++ already.

Also you should take a look at the links provided in this answer by user Katturaja.

Community
  • 1
  • 1
Roope Hakulinen
  • 7,326
  • 4
  • 43
  • 66
  • Yes,As a small part I want to write c code to get android contact.I don't want to use cordova for this. So, my question is same Do you have any idea How am I able to use android phonebook into C ? – NovusMobile Jan 07 '15 at 12:41
  • You are gonna need to write the contact fetching part in Java as I already told. You can though then deliver this fetched contacts to C and handle them there as you wish. I added link for you too, to help with doing that. – Roope Hakulinen Jan 07 '15 at 12:46
  • You are wrong . Actually for camera jni part is used is openMAX and it's JNI portion so, for camera it's true. But for contact it's different. – NovusMobile Jan 07 '15 at 12:48
  • 1
    Very well then, if you know it to be so, I believe you. My sources are only from [Android Developer](https://developer.android.com/tools/sdk/ndk/index.html) center and the other online resources such as the one I linked on my answer and [this](http://grokbase.com/t/gg/android-ndk/123fbggssb/accessing-contacts-in-native-code). Also, it doesn't sound like something that would be possible on Android by it's design. – Roope Hakulinen Jan 07 '15 at 12:57
  • 1
    Yes. May be you are true for this .but I didn't find any sound proof on net that it's not possible,if you have this type please share. Thanks for all your valuable time. – NovusMobile Jan 07 '15 at 13:25
-1

Look here for an example: https://github.com/phonegap/phonegap-plugin-fast-canvas/blob/master/plugin.xml

The last <source-file /> entry in the <platform> section:

<source-file src="Android/libs/armeabi/libFastCanvasJNI.so" target-dir="libs/armeabi/" />
brodybits
  • 541
  • 4
  • 21