Questions about NDK

Asked

Viewed 119 times

-1

I am studying Android programming in Java, and what worries me is that I will only be able to get a portion of the job market, because there are IOS and Windows Phone phones and that does not use the Java Language, I learned of a Java tool called NDK (Native Development Kit) it is a set of tools that allows you to develop native codes in C or C++

i wonder if through NDK is possible to make apps for Windows Phone?

  • 2

    If your concern is to develop a cross-platform application, I think you will have to go to the area of hybrid applications (Html5 + native layer) using Phonegap, Appcelerator or or others for example. Using NDK will only help to make code that does not depend on the API’s of the target platform, otherwise if possible, you will need to handle the API’s (UI, GPS, Storage, etc...) of each platform, which are different, in their C++ code (using Design Patterns help reduce coupling and create an abstraction between your code and the target API).

2 answers

1

i wonder if through NDK is possible to make apps for Windows Phone?

No. NDK is a tool to develop in C/C++, but still on Android. What is possible is to abstract much of the code to a lib in C or C++ that could also be used on other platforms and just connect the UI. I’ve seen apps with a lot of C logic and a thin shell of Java for Android interface and Objective-C for iOS. You could also add Windows Phone support in that case, but you’d still need those specific layers for each platform.

1


NDK allows portability in the opposite direction: compile a C code on Android. If you have a large body of C code, you will be able to make use of it on Android through NDK.

Since the C language is supported on most mobile platforms, it is an alternative (which I don’t really like, but it is) to write cross-platform code.

On iOS, you can compile C-code along with the rest, because Objective-C is a supercon of C.

On Windows Phone, which is . NET, it’s also possible to compile C code but it has to reside in its own DLL as it’s unmanaged code.

It should be clear that NDK is not a tool that will make your C code work on all these platforms. NDK allows you to use C code on an Android project, only.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.