Building an NDK project without Eclipse

373 views
Skip to first unread message

Grant

unread,
Jul 30, 2010, 3:10:06 AM7/30/10
to android-ndk
I'm currently trying to setup our build process and one of the goals
of the system is to be able to do it all through the command line (we
don't want everyone to have to install and learn how to use a
multitude of IDEs to work on a single project). So far I've installed
the Android SDK (8) & NDK (r4b), Cygwin (I'm on Windows XP) and the
JDK and have successfully (AFAIK) compiled the "hello-jni" sample in
the NDK. It seems I now need to be able to build an "apk" file to be
installed, but the only references I can find to building this file is
to either use Eclipse or call the "ant" script. I've done a search of
my entire hard disk and been unable to find any "ant" files.

What programs/files do I need and what steps do I have to take to
build an "apk" file for the "hello-jni" sample (without involving
Eclipse)?


Thanks,
Grant

Onur Cinar

unread,
Jul 30, 2010, 1:32:59 PM7/30/10
to andro...@googlegroups.com

Hi Grant,

You will need to download and install ANT from:
http://ant.apache.org/

Then you can use SDK's android command line application to either create or update a project, which will generate the ANT's build file (build.xml) for you.

Regards,

-onur


--
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.


charles

unread,
Aug 2, 2010, 2:09:09 AM8/2/10
to android-ndk
Hi,

This link should clear it up for you: http://developer.android.com/guide/developing/other-ide.html

Download and install ant from the the ant.apache.org website, and then
simply run "ant debug" any time you want to build your app (in debug
mode, do "ant release" before putting in the market) and "ant clean"
when you need to clean up your .class files, native object files,
libs, etc...

- Charles

mike @ gmail

unread,
Aug 2, 2010, 4:10:56 PM8/2/10
to andro...@googlegroups.com
I have done similar work recently.
And also without Cygwin and Ant.

I won't give you complete instructions, just hints:
- I use Gcc from www.codesourcery.com (free lite edition for Arm+Linux), and it compiles/links fine without need of Ant or Cygwin
- I can compile Android's Java front-end using javac.exe into .class files, then using Android's dx tool generate .dex file which is put into .apk file
- aapt is Android's tool to build proper .apk file
- finally jarsigner.exe signs the file with your certificates

You have to dig out proper parameters for all the tools, but I assure you that this all works for me on command-line (well actually in various bat files called from MS Visual Studio).



- Charles


On Jul 30, 2:10 am, Grant <gpeters...@gmail.com> wrote:
> I'm currently trying to setup our build process and one of the goals
> of the system is to be able to do it all through the command line (we
> don't want everyone to have to install and learn how to use a
> multitude of IDEs to work on a single project). So far I've installed
> the Android SDK (8) & NDK (r4b), Cygwin (I'm on Windows XP) and the
> JDK and have successfully (AFAIK) compiled the "hello-jni" sample in
> the NDK. It seems I now need to be able to build an "apk" file to be
> installed, but the only references I can find to building this file is
> to either use Eclipse or call the "ant" script. I've done a search of
> my entire hard disk and been unable to find any "ant" files.
>
> What programs/files do I need and what steps do I have to take to
> build an "apk" file for the "hello-jni" sample (without involving
> Eclipse)?
>
> Thanks,
> Grant

Doug Schaefer

unread,
Aug 2, 2010, 4:50:50 PM8/2/10
to andro...@googlegroups.com

BTW, I too have switched to CodeSourcery's tool chain. It's quite the Frankenstein setup to get it too work and to avoid getting yelled at I won't describe it here. But just to let you know that it works great and cygwin free.

>> android-ndk...@googlegroups.com<android-ndk%2Bunsu...@googlegroups.com>

Grant

unread,
Aug 4, 2010, 8:45:34 AM8/4/10
to android-ndk
Thanks everyone for the help, I've got it up and running using cygwin/
ant and fully integrated with VS2005 (including transforming warnings/
errors into something VS can interpret as file paths and line
numbers). I just missed the part where I needed ant, the rest was just
makefile/bash hackery (god help anyone who needs to maintain it, need
to add comments).

On Aug 3, 6:50 am, Doug Schaefer <cdtd...@gmail.com> wrote:
> BTW, I too have switched to CodeSourcery's tool chain. It's quite the
> Frankenstein setup to get it too work and to avoid getting yelled at I won't
> describe it here. But just to let you know that it works great and cygwin
> free.
>
> On Aug 2, 2010 4:11 PM, "mike @ gmail" <mice...@gmail.com> wrote:
>
>
>
> > I have done similar work recently.
> > And also without Cygwin and Ant.
>
> > I won't give you complete instructions, just hints:
> > - I use Gcc fromwww.codesourcery.com(free lite edition for Arm+Linux),
> >> android-ndk...@googlegroups.com<android-ndk%2Bunsubscribe@googlegr oups.com>
>
> <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Bunsubscribe@goo glegroups.com>
>
> >> .
> >> 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 andro...@googlegroups.com.
> > To unsubscribe from this group, send email to
>
> android-ndk...@googlegroups.com<android-ndk%2Bunsubscribe@googlegr oups.com>
Reply all
Reply to author
Forward
0 new messages