Learning C, Is the NDK a good place to practice and learn C???

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Learning C, Is the NDK a good place to practice and learn C???

Bcastillo
I am brand new to development and want to start with C, just so I have a solid foundation to move onto JAVA, and over time objective C.
Am I on the right track downloading the Android SDK and NDK?

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/NAi67ruKL4IJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Learning C, Is the NDK a good place to practice and learn C???

foo64
I would say the Android NDK is not for the faint of heart. Debugging is iffy, documentation is poor, and the build setup is done manually (makefiles) which makes it easy to make mistakes. It's also still under active development, which means it has bugs. I would not recommend it for beginners!

You'd be better off learning C in a more mature and controlled environment like Visual Studio. I'm sure there are free versions available.

On Saturday, January 5, 2013 9:32:43 AM UTC-8, Bcastillo wrote:
I am brand new to development and want to start with C, just so I have a solid foundation to move onto JAVA, and over time objective C.
Am I on the right track downloading the Android SDK and NDK?

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/KTLZh2tsHyoJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Learning C, Is the NDK a good place to practice and learn C???

David Turner
In reply to this post by Bcastillo


On Sat, Jan 5, 2013 at 6:32 PM, Bcastillo <[hidden email]> wrote:
I am brand new to development and want to start with C, just so I have a solid foundation to move onto JAVA, and over time objective C.
Am I on the right track downloading the Android SDK and NDK?

I would recommend starting with a native compiler instead, e.g. compile on Linux programs that run on the same machine, this will make you much more productive to learn C, and more importantly debug your programs when something bad happens.

The Android NDK comes with a cross-compiler, i.e. you build the binaries on your main machine, then install them on a device before running them. When something bad happens, your debugging options are much more limited than if you ran it directly on your main machine. That can be very intimidating if you're just trying to learn the language.
 
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/NAi67ruKL4IJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Learning C, Is the NDK a good place to practice and learn C???

Eric Wing
In reply to this post by foo64
I agree with the others about the NDK not being for the faint of heart
and you should pick a more native and mature environment to start
learning in. I agree with foo64's sentiments that an IDE like Visual
Studio might be a better place to start, but I'm going to slam Visual
Studio and their pathetic C compiler which is now 2 standards behind
the C spec (i.e. over 20 years out of date) with Microsoft clearly
demonstrating they don't care.

A more Unix-y system like Linux, BSD, or Mac are better places to
learn and develop with C. Mac will also give you a good IDE (Xcode)
which has very good support for C (because it has to because
Objective-C is a pure superset of C). Xcode's C compiler (clang)
already seems to be a further along on C11 features too. And since you
said you eventually want to learn Obj-C, starting on a Mac also makes
a lot of sense.

-Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

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

Reply | Threaded
Open this post in threaded view
|

Re: Learning C, Is the NDK a good place to practice and learn C???

jeff shanab
Bear with me here.....

I am working on an android project that uses the NDK thru the JNI interface.
It started as a c++ browser plugin and was then ported to iPhone as an app.
Mostly all libraries like libavcodec, curl, etc were built for ARM and my c++ was wrapped by objective C.
Having never done Objective C, it was a bit painful at first. Xcode is different than Visual Studio but on par with it.
The debugging and profiling tools in xcode for iOS are unparalleled in mobile development, better than Visual Studio on the desktop!
Now, In an attempt to reuse as much code as possible, I do the UI in java and use the JNI to connect to my C++ code.

  PS. I get really annoyed with the attitude out there that recommends I re-write everything in java.
     When dealing with large amounts of memory allocations and bandwidth, aka Streaming Video, Java sucks.
     When You have a year plus in a code base, you don't arbitrarily re-write it.

After using linux, windows and mac desktop and mobile development environments, I was really disappointing with the eclipse Android development.
It is hard to imagine they can stay in the market if they continue to be so substandard on tools.

The problems are the eclipse environment is from one group then 2 plugins are from another group, the sdk a third.
Compounding the issue is the @#$@ cell phone providers that won't update phones so 47% of the market is still on Gingerbread.

So what Have I learned.
    Depending on what your app does, Start with C++ and wrap it in objective-C working in Xcode if you can with an iphone
    Then port to java wrapped android.
    Either way, A good seperation of the UI toolkit language and the core code works well to re-use code.
    Android debugging will take you 5 times as long as iOS. I am using log statements for most of the c++, eclipse ndk debugging crashes more times than runs and ignores breakpoints.
    Really learn the Android life cycle. Things like rotating a device by default restart the application basically. (whos bright idea was that one?)

I wish I could comment on cocos2d-x It looks very very promising, I have just haven't had the time to try it.

http://www.cocos2d-x.org/ 

My design is such that
   HTML + javascript is the UI in a browser and calls my video player
   Objective-C and cocoa is the UI in iPhone
   Java is the UI in android

   Th c++ core is 90% the same on all 3!



On Mon, Jan 14, 2013 at 11:11 AM, Eric Wing <[hidden email]> wrote:
I agree with the others about the NDK not being for the faint of heart
and you should pick a more native and mature environment to start
learning in. I agree with foo64's sentiments that an IDE like Visual
Studio might be a better place to start, but I'm going to slam Visual
Studio and their pathetic C compiler which is now 2 standards behind
the C spec (i.e. over 20 years out of date) with Microsoft clearly
demonstrating they don't care.

A more Unix-y system like Linux, BSD, or Mac are better places to
learn and develop with C. Mac will also give you a good IDE (Xcode)
which has very good support for C (because it has to because
Objective-C is a pure superset of C). Xcode's C compiler (clang)
already seems to be a further along on C11 features too. And since you
said you eventually want to learn Obj-C, starting on a Mac also makes
a lot of sense.

-Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

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


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