Android NDK on Mac OSX - quick install w/o Developer Tools - android

I was just suggested to port some signal processing code to use the Android NDK to speed up the process, but I'm wondering 1. where to install it to and 2. what tool-chain to use
I'd prefer not downloading the 3.5GB Mac Developer Tools if possible. I don't have access to an install cd that has it. Want to try and get this done asap. Does anyone know a way to get NDK development running quickly on OSX(snow leopard)?

A version of make is included with the Android NDK. Simply add {NDK install dir}/prebuilt/darwin-x86/bin to your PATH and you'll be able to build with the NDK.

Unzip the NDK package for Mac OS X anywhere, then add it to your path. That's all you need to build code with the NDK. The NDK includes its own GCC-based toolchain, so you don't even need to have Xcode installed.
Go to the samples in the NDK and type ndk-build in the console to build them.

If you install Xcode, that will install Make.

Related

Unable to build Library for AWS C++ SDK for Android Platform

I am doing a sample application to download a file from Amazon S3 using aws-sdk-cpp. I am able to build Libraries and run for iOS and Mac without any hassle. But with target architecture set to ANDROID, i am facing lot of cmake errors.
cmake /Users/darshan/Desktop/AWS-Git/aws-sdk-cpp -DTARGET_ARCH=ANDROID
I am trying to build library for this sdk for Android on Mac OS Sierra. Terminal output is shown in below link.
Terminal Output
I have the environment variables properly set. Here is the value of $PATH
/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home/bin:/Users/darshan/Library/Android/sdk/platform-tools:/Users/darshan/Library/Android/sdk/ndk-bundle:/Users/darshan/Library/Android/sdk/cmake/3.6.4111459/bin
Can someone please try building this AWS C++ SDK on MAC system for ANDROID and check the issue.
Any help is really appreciated.
Thanks in advance.
Try this:
cd aws-sdk-cpp
export ANDROID_NDK="/opt/android-ndk-r12b" // change to your own NDK path
python scripts/build_3rdparty.py --configs="ReleaseDynamic" --parallel=8 --installdir="../Install" --generateClients="0" --architecture=AndroidArm

Build webRTC for android on windows

I am working with webRTC. I want to build it for android to do peer to peer streaming. I think i can do that using that webRTC-android-app, right? So my question how can i build it on windows because if you go to the link the first line says "Android development is only supported on Linux."
So it's possible to build that on windows or i have to switch to Linux for that project?
I would recommend you to try use Cygwin (https://www.cygwin.com/). Please be sure that you are using x64 version. I would also recommend you to setup "devel" package during installation process. apt-cyg (https://code.google.com/p/apt-cyg/) will be also helpful for you.
The build steps will be similar with build steps for Linux, but all operations will be done under cygwin console.
The main advantage of this way is that you can easily integrate Cygwin bash with your IDE on windows (e.g. eclipse) and build WebRTC library as a part of your project build process.

Do I need ADT and NDK for android if I already have it as plugins for Eclipse?

I'm trying to make and compile a software called linphone which I hope to push to my phone. The README file says that before i can run the make command, I must have ADT and NDK installed.
I know I have the ADT and NDK plugin installed for Eclipse, because i was able to make some basic android apps and push to my phone.
So when I went to my linphone directory and typed "make" in terminal, it said I did not have android SDK installed.
Do I really need to re-download android adt and ndk and install it in such a way that it is accessible via bash? Or is there a short cut to make my bash recognize that Eclipse already has all these tools installed, and just re-use it to make and compile linphone?
Do I really need to re-download android adt and ndk and install it in such a way that it is accessible via bash? Or is there a short cut to make my bash recognize that Eclipse already has all these tools installed, and just re-use it to make and compile linphone?
No, you should be able to simply add the locations where you have the Android SDK and NDK installed to your bash PATH. In Eclipse you can find this by looking at Window > Preferences > Android > SDK Location and Window > Preferences > Android > NDK > NDK Location.
As to how to add the these locations to your PATH, please refer to this question on Ask Ubuntu.
UPDATE: Just noticed in the README for linphone that you need to add some of the subfolders for the SDK:
add both 'tools' and 'platform-tools' folders in your path
So you will need to adjust accordingly.

Cygwin for Android-NDK programming

I read about the requirements of NDK programming on Windows which said we require Cygwin.Read about Cygwin which said we require it coz it is a way to make Windows support some linux functionality.But my question is in which stage of programming(Where Exactly) Cygwin will be required and why? Addidtional info about this topic is most welcomed
Android NDK starting with revision 7 doesn't require Cygwin. See here: http://developer.android.com/sdk/ndk/index.html
You can now build your NDK source files on Windows without Cygwin by calling the ndk-build.cmd script from the command line from your project path. The script takes exactly the same arguments as the original ndk-build script. The Windows NDK package comes with its own prebuilt binaries for GNU Make, Awk and other tools required by the build. You should not need to install anything else to get a working build system.
It mentions you can not use ndk-gdb script without Cygwin. While that is true, you can actually use gdb executable directly without Cygwin, only then you'll need to set it up properly manually.
At least NDK-r8b, if you want to build your .so, you don't need Cygwin.
However, if you want to use ndk-gdb to debug your native code,you have to use Cygwin.
And, in my experiment, if you ndk-gdb your native under Cygwin to debug native code which is built from windows cmd, ndk-gdb seems cannot recognize the debug info. So, for debug purpose, I build native Cygwin.
Make command to execute Android.mk file.
Android.mk file consists of list of c/c++ files to be compiled and also the library name(.so).
(from NDK-r8e NDK-GDB document) At the moment 'ndk-gdb' requires a Unix shell to run. This means that Cygwin is required to run it on Windows. We hope to get rid of this limitation in a future NDK release.

Eclipse error: invalid path for ndk?

I want to integrate some c code with Android so as first step I has to specify NDK path in Native Development node. But when I specify NDK path it gives error Invalid path for NDK
I googled but could not find some solution. Am I missing some step.
SDK and NDK are in the same folder and SDK path working fine.
Please help
I have installed
make-3.81
nawk-2007.10.23-setup
Cygwin
ADT-17.0.0
Sequoyah
android-ndk-r7b-windows.zip (Extracted)
EDIt:
I just check the link and came to know that it could be GCC absent problem .How do I check that if its GCC problem or not , or How can I check if GCC is installed or not?
Mmm... weird error. Keep in mind that in order to use the NDK, the SDK should be working in perfect way before you start with the NDK, said that, I suggest you to try the following:
1- Be sure you have the pre-requisites:
For all development platforms, GNU Make 3.81 or later is required.
Earlier versions of GNU Make might work but have not been tested.
A recent version of awk (either GNU Awk or Nawk) is also required.
For Windows, Cygwin 1.7 or higher is required. The NDK will not work
with Cygwin 1.5 installations.
2- Start from scratch again by deleting any NDK references such as the settings on eclipse, paths, folders, zips, etc.
3- Be sure you have updated to the latest Android SDK and ADT Tools. Using the Help->Check for Updates Menu in ECLIPSE and then be sure you have all the things are up to date on the Android SDK Manager.
4- I see a "D:/" on your question, so you're using a Windows PC... it must be a Windows XP (32-bit) or Vista (32- or 64-bit). Be sure to get the Windows version (http://dl.google.com/android/ndk/android-ndk-r7b-windows.zip), and when you have unzipped that ndk, rename the folder to "ndk". You can put it next to where your SDK's folder is, it should not matter.
5- Open Eclipse, and give it the path to the NDK, and see what happens.
Good luck!
I exhuasted to solve this problem "Invalid path for android SDK" but it got solved at last.
Here is how it got solved.
My system specs: P4 3.2 GHz, Windows 7 32-bit, Eclipse Standard Edition 4.3 (Kepler).
Other supporting softwares: MinGW with GNU make 3.81.
Problem (first the problem I faced and then the solution):
I downloaded Android NDK latest version from "developer.android.com/sdk/ndk/index.html" which was "android-ndk-r9-windows-x86.zip". Then I extracted it in C:\ directory then I added a ";C:\android-ndk-r9" in my PATH variable. Then I installed "Sequoyah Android Native Code Support" using eclipse "install new software" option (Help ➤ Install New Software➤type "Indigo - http://download.eclipse.org/releases/indigo" in the work with field ➤ go to Mobile and Device Development category and select Sequoyah Android Native Code Support).
Then I went to eclipse menu "Window ➤ Preferences ➤ Android ➤ Native Development" and entered "C:\android-ndk-r9" in the NDK location and got error " Invalid path for NDK".
Solution: I search exhaustively on internet and tried different solution but the solution worked for me was:
I downloaded the older version of NDK ( download link: "dl.google.com/android/ndk/android-ndk-r7c-windows.zip" ) and extracted in C:\ directory using winrar and updated the PATH in environment variable to point to the new NDK version 7c. When now I entered the path it accepted. No error appeared.
the problem is Sequoyah doesn't accept new version because it has not updated since 2011 ( I'm not sure)
Note1: for Linux users download link: "dl.google.com/android/ndk/android-ndk-r7b-darwin-x86.tar.bz2"
Note2: you can change the version in the link according to your requirement for example "dl.google.com/android/ndk/android-ndk-r4bc-windows.zip" to download version 4b.
Thanks.
Try to create a new systems variable called "NDK" and set its value to the NDK path.
Check your path to the NDK-- this has, on more than one occasion been the issue for me, at least with the SDK. (Not NDK in my instance) I know that, for instance, at the moment my NDK path is ~/android-ndk-r6/android-ndk-r6/
Also, to install gcc in windows, you must install Cygwin or such compatible gcc setup for windows. (The docs here say that it is required, but I think I may have heard of people using some slightly different implementation.) Cygwin works well for me, but you may need to specify gcc, make, and so on, in the installer as packages to be downloaded and set up on your machine, so read your installation options carefully. If you find that you have more packages that need to be installed, you can run the setup.exe program again and install them in-place.
In addition, here (at the bottom of the page) you can find an installation guide for the NDK in case you run into further issues.
Hope some file is missing in your ndk folder, so that it is unable to identify the ndk folder. Download ndk again and load it, otherwise update the native development plugin...
You said SDK and NDK are in same folder. It could be a conflict with the route. Try this:
Uninstall NDK
Reinstall NDK at D:\ecpspace\NDK\android-ndk-r7b
Create new PATH on enviroment var
Restart computer
On linux work for me, i had 2 ndks installed in different routes, and when i used eclipse, was compiling using the other one, and don't worked as i wanted.
This might sound dumb, but did you download the correct package? I had the same problem on linux until I realized I was trying to use the Windows version (I had downloaded it earlier while I was trying to install it on a different computer with cygwin). I downloaded the linux package and everything worked.
I've only been at this for a couple of days, but in my brief experience, the NDK and eclipse do not play well together. I would suggest moving to the command line for the NDK portion of the project for the time being. Some good tutorials can be found at:
http://www.cmumobileapps.com/2011/08/31/compiling-open-source-libraries-with-android-ndk-part-1/
http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/
I have similar bug (Eclipse Version: Indigo Service Release 2, Build id: 20120216-1857). The main problem was in Sequoya plug-in. Problem disappear when I update Sequoya to the latest version.

Categories

Resources