Discussion:
How to include C++ support through Android NDK in android studio?
(too old to reply)
HMpzz
2018-12-03 19:59:47 UTC
Permalink
I am very new to android studio. The documentation I am reading is ndk
guides <https://developer.android.com/ndk/guides/concepts>. Here in the
section 'Using the native_activity.h interface' there it says *Create a
jni/ directory in your project's root directory. This directory stores all
of your native code. *So I guess all native codes will be inside jni/. But
when right click on the app/ directory there is no option to create a
directory. I tried creating the folder through file manager but it doesn't
show up in the project view.

I have ndk,cmake installed as per documentation and When creating project
I check include c++ support. There is a folder named cpp/ inside app/ which
have a c++ file native-lib.cpp. Which I think is a sample code. So tried
creating a c++ code there. But when I include native_activity header it
can't find the header file. I included the new cpp file in cmake. As I said
I am very new to studio and the ndk guide is very confusing . Am I missing
some steps? Is creating jni/ directory is necessary or i can include my c++
code in app/cpp/? Why it can't find native_activity.h?
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/5215444d-95f6-4776-bc14-314527151234%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Dan Albert' via android-ndk
2018-12-04 18:26:06 UTC
Permalink
+adarshf: Looks like these docs could use some improvements.
Post by HMpzz
I am very new to android studio. The documentation I am reading is ndk
guides <https://developer.android.com/ndk/guides/concepts>. Here in the
section 'Using the native_activity.h interface' there it says *Create a
jni/ directory in your project's root directory. This directory stores all
of your native code. *So I guess all native codes will be inside jni/.
But when right click on the app/ directory there is no option to create a
directory. I tried creating the folder through file manager but it doesn't
show up in the project view.
I have ndk,cmake installed as per documentation and When creating project
I check include c++ support. There is a folder named cpp/ inside app/ which
have a c++ file native-lib.cpp. Which I think is a sample code. So tried
creating a c++ code there. But when I include native_activity header it
can't find the header file. I included the new cpp file in cmake. As I said
I am very new to studio and the ndk guide is very confusing . Am I missing
some steps? Is creating jni/ directory is necessary or i can include my c++
code in app/cpp/? Why it can't find native_activity.h?
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/5215444d-95f6-4776-bc14-314527151234%40googlegroups.com
<https://groups.google.com/d/msgid/android-ndk/5215444d-95f6-4776-bc14-314527151234%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhvxaTAFHXqR%3DJFWgP3JACfHYj3nB%2BiJ7BUXGS%3D1ku1rrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Alex Cohn
2018-12-07 14:36:27 UTC
Permalink
This would be <android/native_activity.h>. And *jni *folder is not relevant
anymore

BR,
Alex
Post by HMpzz
I am very new to android studio. The documentation I am reading is ndk
guides <https://developer.android.com/ndk/guides/concepts>. Here in the
section 'Using the native_activity.h interface' there it says *Create a
jni/ directory in your project's root directory. This directory stores all
of your native code. *So I guess all native codes will be inside jni/.
But when right click on the app/ directory there is no option to create a
directory. I tried creating the folder through file manager but it doesn't
show up in the project view.
I have ndk,cmake installed as per documentation and When creating project
I check include c++ support. There is a folder named cpp/ inside app/ which
have a c++ file native-lib.cpp. Which I think is a sample code. So tried
creating a c++ code there. But when I include native_activity header it
can't find the header file. I included the new cpp file in cmake. As I said
I am very new to studio and the ndk guide is very confusing . Am I missing
some steps? Is creating jni/ directory is necessary or i can include my c++
code in app/cpp/? Why it can't find native_activity.h?
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/d247e2f8-e517-4e7b-97e4-1b99312106ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...