0

I have eclipse Kepler and I am having "Android-Sdk-Windows" files. But I cannot able to make an android project in eclipse.. Do i need NDK necessary.

I already have experience with opening project with just "sdk" and eclipse.. But this times How can i enter the "sdk" path instead of "ndk".

Or Teach me what is "sdk" and "ndk"

i tried eclipse->preference->android-> But i can only see NDK location.
Community
  • 1
  • 1
Prasanna Anbazhagan
  • 1,693
  • 1
  • 20
  • 37

3 Answers3

2

Native methods are platform-specific code. They are usually written in languages such as C or C++ and contained in libraries(dll's). It is possible to create a hybrid Java application that benefits from such libraries.

Reasons for Using Native Methods

  1. Gaining access to special capabilities of your device or or Android OS
  2. Gaining extra speed
  3. Gaining access to a large body of existing legacy code

Typically, good use cases for the NDK are CPU-intensive applications such as game engines, signal processing, and physics simulation

The major disadvantage of native methods is that you won't have cross-platform capability.

What is Android NDK

The Android NDK is a companion tool to the Android SDK that lets you build performance-critical portions of your apps in native code. It provides headers and libraries that allow you to build activities, handle user input, use hardware sensors, access application resources, and more, when programming in C or C++. If you write native code, your applications are still packaged into an .apk file and they still run inside of a virtual machine on the device. The fundamental Android application model does not change.

Now if you don't know what native code is, then probably you don't need to use native code. Android NDK documentation explains this well:

..., you should understand that the NDK will not benefit most apps. As a developer, you need to balance its benefits against its drawbacks. Notably, using native code on Android generally does not result in a noticable performance improvement, but it always increases your app complexity. In general, you should only use the NDK if it is essential to your app—never because you simply prefer to program in C/C++. When examining whether or not you should develop in native code, think about your requirements and see if the Android framework APIs provide the functionality that you need.

Caner
  • 57,267
  • 35
  • 174
  • 180
0

Yo do not need the ndk, in order to build an android project. If you are having difficulties with eclipse, I would suggest using Android Studio unless you are dead set on eclipse. I use both, and strongly prefer to use Android Studio whenever I can.

If you decide to stay with eclipse, it is as easy as downloading the ADT plugin by putting the url in the input box under Help->Install New Software, launching and downloading the sdk from the Android sdk manager, restarting eclipse, and then starting a new Android project. Hopefully you do not have to do anything to configure java or anything else.

The ndk is a way of accessing things from a lower level, in order to bypass certain things, or squeeze more performance out of a phone for highly intense operations, or finally to be able to port c/c++ code from different project. i.e. You can write a Opengl ES game in c and reuse most the code for web, ios, and android this way. But that goes beyond the scope of the question, and this answer.

WIllJBD
  • 6,144
  • 3
  • 34
  • 44
0

Firstly you should ensure you have installed ADT plugin .

JZH
  • 47
  • 2