To use NDK, do I need to first create a AndroidManifest file and create the project using Eclipse?How to create AndroidManifest?

634 views
Skip to first unread message

Jiabin Qin

unread,
Jun 1, 2011, 5:23:47 AM6/1/11
to android-ndk
Hi, All !
As stated in the title,To use NDK, do I need to first create a
AndroidManifest.xml file and create the project using Eclipse?

Because, when I try all these examples in the NDK installation folder,
I can create a Android project using Eclipse. But when I try to create
a new project with my own native code in c & c++, I put the c , c++
and make file in the folder :jni. And then go to Eclipse ,create
Android project from existing code. The feed back is: File
AndroidManifest.xml not found .

So, I think, when I am creating Android project from native code, I
have the code and the make file. I need to build a AndroidManifest.xml
file so that the Eclipse can create a Android project from existing
code.

If I really need to create the AndroidManifest file by myself, Is
there any step by step tutorial for me to follow?
My project is a video player which is write in C. Do I need to write
any other information in the AndroidManifest?

Thanks in advance!!

Jiabin
Singapore

Philippe Simons

unread,
Jun 1, 2011, 5:33:29 AM6/1/11
to andro...@googlegroups.com
Every android apps, needs an AndroidManifest.xml (using native code or not)
It defines the differents components of the apps (Activity, Services, Receivers...)

BTW: except if you are using NativeActivty (which still needs to be defined in the AndroidManifests)
how are you going to present the UI to the user, you need an Activity to achieve this...


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


Riasat Abir

unread,
Jun 1, 2011, 5:37:55 AM6/1/11
to andro...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.




--

HimHim

Jiabin Qin

unread,
Jun 1, 2011, 5:52:03 AM6/1/11
to android-ndk
Thanks for responding.
I know AndroidManifest is needed, my problem is ,in the tutorial
regarding how to build a program using NDK, I was taught to create an
Android project using existing code, which in the examples , the
AndriodManifest.xml is provided.

But as a user , when I only have the native code, how can I get the
AndroidManifest.xml?

Thanks!

Jiabin Qin

unread,
Jun 1, 2011, 5:56:20 AM6/1/11
to android-ndk
Thanks Riasat Abir :D

I had read this page before and found it useful. In the tutorial, I
was given the content of AndroidManifest.xml, I just need to copy and
paste. But my question is: If am doing my own project, how can I write
my AndroidManifest?

I guess, since my project is using the normal libraries and functions,
I don't need to modify the code given in your link. But I haven't
tried it out yet.

Cheers

On Jun 1, 5:37 pm, Riasat Abir <riasat.a...@gmail.com> wrote:
> Check this link :)http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-...
> HimHim

Philippe Simons

unread,
Jun 1, 2011, 6:06:02 AM6/1/11
to andro...@googlegroups.com
You need to write on yourself, or use Eclipse to create a project, or use the android sdk command line tool to create a project...

but my question remains... If you only have native code, how are you going to make the user interface?
You need an activity, (native or not).

so to summarize...
You need FIRST to create a standard android project (using eclipse, or cmd-line tools)
then, create the jni folder and drop in your code (you'll also need to create an Android.mk file to tell ndk how to build your shared library)

My feeling is that you are not ready to build a project using NDK (don't take it personnaly, it's just the feeling I have reading your questions)
My advice is: try first to create simple android apps, (without using NDK... NDK add alot of complexity to an android application, it's not just "compile and run", you need also to managed the Java -> C binding and C -> Java binding using JNI)
learn how to build the AndroidManifest.xml (it's not that difficult), eclipse can help you with a GUI, but usually I'm writing it with the Text Editor (refer to Android SDK)

Jiabin Qin

unread,
Jun 1, 2011, 9:03:29 PM6/1/11
to android-ndk
Dear Philippe,
Yeah, you are right on the point whether I am ready for the NDK. I
haven't created any Android project on my own yet, b/c I don't know
Java. What I have done is ,following the tutorial on "Hello World".
But in that tutorial. I only have to copy the code to be written in
the HelloAndroid.java.

So, what you suggest is to first create an app in android. Then I need
to learn how to write the java code. But , if possible, I would like
to save the time, because I am not a long term Android developer.

Thanks.
Jiabin
Reply all
Reply to author
Forward
0 new messages