Android: NDK setup in windows - android

I've been planned to develop an Augmented_Reality(AR) application in an android. So I've gone through various of contribution installing a libraries in eclipse(IDE) like artool,qcar sdk and so on, then I've found that NDK installation should be made before getting into artool kit or qcar sdk So I started to install NDK and progressed as they said in below link:
http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/
after doing 'Cygwin' installation they wrote to write 'make -v' in console. Hhen I did I got 'GNU make 3.82.90' but theirs is 'GNU make3.81' as:
where it wasn't as same mine. I know that am using updated cygwin but my problem is I can't able to get .so file as they mentioned accordingly in eclipse. So could you tell me, where I made junk and how can I recover to run AR application in eclipse. Thank you!

actually if you are using window then you do not need to install cygwin. you can also run your project with cmd prompt with following command
start>cmd>cd C:\demoworkspace\testingndk>enter
in Command prompt This is my directory where my project is located with project name. after this
run the ndk address like
C:\demoworkspace\testingndk>C:\ndk-path\ndk-build
ndk-path is directory name where your ndk is located. this will automatically pick your jni c file.
for ndk related query please write me at kdeepak5477#gmail.com

When you are installing cygwin (I used a wizard) make sure you open the DEVEL tree and install MAKE (binary is fine, no need for source).
I also get all the GCC and MINGW stuff just in case.
Perhaps uninstall cygwin, and reinstall using the wizard and ensure MAKE is selected from DEVEL tree.

Related

Build Tensorflow Demo For Android

I am following this link to build the Android App:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/README.md
I am using Window Subsystem Linux command to do this project.
I have installed Bazel already.
I know that after I install Bazel, and before I run the build command, I need to change the WORKSPACE file with correct NDK/ADK file address and go to the workspace root and run "touch WORKSPACE". Here are the codes i ran:
'tensorflow folder sits inside 'C:\Users\username\AppData\Local\lxss\home\alexluk\tensorflow
cd /home/username/tensorflow
touch WORKSPACE
However, when i ran "touch WORKSPACE", here is the error i got:
touch: cannont touch 'WORKSPACE': onput/output error
It would be great if anyone can let me know where went wrong and what should I do.
For future people that might need help with this:
It looks like Windows Subsystem Linux is very particular about not editing the Linux files from Windows. See this blog post:
DO NOT, under ANY circumstances, create and/or modify Linux files using Windows apps, tools, scripts, consoles, etc.
At this point, you can probably remove the file using Windows and then recreate it using Linux.

Linux Mint Android SDK Path Issue

I'm not able to include the android sdk to my PATH variable, so that I can use "android" from terminal.
I was following this tutorial to enable phonegap (which is my primary goal http://julianhigman.com/blog/2013/10/17/notes-on-setting-up-phonegap-on-ubuntu-for-android-app-development/)
First I took a look at the official android dev page
http://developer.android.com/sdk/installing/index.html?pkg=studio
It says:
"You may want to add android-studio/bin/ to your PATH environmental variable so that you can start Android Studio from any directory."
So I extended my .bashrc file with following lines
export PATH="/usr/local/android-sdk/android-studio/bin/:$PATH"
This points to the correct path as described in on the dev page.
Since this does not work I did some deeper research and found several threads which did not help either.
(Android command not found even PATH set)
Most recommend to do the following:
export PATH=${PATH}:/usr/local/android-sdk/tools
export PATH=${PATH}:/usr/local/android-sdk/platform-tools
The problem here is, that I dont have any folders named tools or platform tools?
I'm running on Linux mint 16.
If anyone could point me in the right direction, that would be great!
Update:
echo $PATH results to:
/usr/local/heroku/bin:/home/foo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/android-sdk/tools:/usr/local/android-sdk/platform-tools:/usr/local/android-sdk/android-studio/bin
But I added only this line
Added to enable android on the path
export PATH="/usr/local/android-sdk/android-studio/bin:$PATH"
Update
Had to install the packages after for android sdk and added them successfully to the .bashrc, now android is available.
Thanks in advance
Best

how to setup eclim with android developer tool (eclipse 4.2)

I have the Android Developer Tool which shows eclipse version 4.2 (juno).
According to Eclim site required version of Eclim is as
Eclipse 4.3.x (Kepler) (Eclim 2.2.x), Eclipse 3.7.x (Indigo) (Eclim 1.7.x), or Eclipse 3.8 (Eclim 1.7.13 or greater)
I thought eclim 1.7.18 will work with eclipse 4.2. I also tried 2.3 but none are compatible with eclipse 4.2 which comes bundled in ADT.
So which version of Eclim should I use?
I got ADT bundle with eclipse 4.2 and installed eclim 2.2.6 which doesn't complain about eclipse's version.
I hope it works for you too.
For other readers not satisfied I'll tell my story, before you read you must know I'm that type of developers who love using the CLI and thinks that keyboard shurtcuts are faster than using a mouse, if you don't agree may be this setup is not for you:
Install main tools
I've downloaded Eclipse Luna (4.4.0) from the eclipse project website.
Download the Android SDK.
Later install the ADT Plugin (through Help > Install New Software).
After installing the ADT Plugin will ask for the path to the Android SDK.
Later on installed Eclim (2.4.0), it will ask for the eclipse installation folder as well for the .vim folder.
Start the Eclim daemon service. (In debian you can use update-rc.d to make it always run, or search a solution for your system, you can setup to start at system start, let the ideas come out!)
Setting up the Android Development Vim Studio
Check Eclim is up by typing in vim :PingEclim you should see the version of Eclim as well of Eclipse.
I suggest installing the NeoComplCache Vim plugin it integrates nicely with Eclim autocomplete, in the Eclim doc web site it says what you need to add to integrate it.
Eclim will detect the android-sdk path based on the setup you made on eclipse but if not you can define the android-sdk path (see Eclim docs).
How to create projects and install on device
With my NERDTreee I automagically CD in the selected root dir and use :ProjectCreate %/MyProjectFolder -n android, it will ask for some configs.
Later in order to you can build and install the app to your phone you need first to generate the build files (eclipse doesn't share these build files), use :!android project update --path %/MyProjectFolder (note you can omit '/MyProjectFolder' if you're already inside that folder). You can add --target and --name flags if you want to update these values.
At this point you can work in your project without any issues, code completion works excellent, if you need import something use :JavaImport but you know you can map it.
Wenever you want to test the app in your device (I use a physical device) use :Ant debug install and if build succeeds use :!adb shell am start -n your.package.name/.YourMainActivity this will fire the app in your device just like eclipse does.
You can combine the build and install command with :!ant debug install && adb shell am start -n your.package.name/.YourMainActivity. Also remember to keep a terminal open for your logcat adb logcat or if you declare a tag (I suggest doing it) adb logcat -s "MyTag"
Why to use eclim?
I was in a pain after updating my eclipse juno only errors was shown, I was tired of downloading, installing, updating eclipse, even the bundled ADT was bugy, Android Studio looks very ugly on linux by the swing font rendering, many hours were wasted at the end I just search for integrate my vim (I use it for web dev) and never looked back, used Eclim because I had the buggied eclipse on my system (is still here can't use that slow bugy crap, I HATE ECLIPSE).
Does it worth it?
If you don't have eclipse I suggest you try another Android Development Vim Studio without eclim, but if you already have Eclipse, go for eclim. And yes I'm happier to code this way in Vim rather than in eclipse, the only miss is the GUI Layout Designer. As some people say If you want something done well, better do it your self
Looks like a lot of work
Yes, for sure I'll start building a vimscript for this.

Installing SDK and NDK to start coding android apps with python

http://python-for-android.readthedocs.org/en/latest/toolchain/#introduction
Please do not mind because this not really related to SO. I aint getting replies in askubuntu that is why I am posting this question. Please do answer. it will be much appreciated.
refer the link above, I downloaded the SDK and the NDK, i run the SDK manager and I installed the required files. This is enough as a platform right? or I need to download ADT or eclipse?
I installed cython also as given in the doc. What I want to know it, if I install eclipse, which version should I first download? because there is no eclipse in particular for python.
Secondly, after setting up any platform(in my case, its just SDK manager, not eclipse) it says
'after installing them export both installation path, NDK version and API to use' what does it even mean?
I remember, before installing or running sdk manager, I opened .bashrc file, put up 2 lines,
export path=$path:......android-sdk
export path=$path........android-ndk
saved it.
I do not know whether the SDK manager started working because of that, but it works and my emulator also works after creating a vew avd.
I am totally stuck at the exporting of installation paths, versions and apis. Where do I export them to?
And if you go futher down, you can also see 'configure youre path to add android binary:' what does this mean? I have a ubunu 12.04, I need to set environment variables?
Then further down, it says 'USAGE',
./distribute.sh -m "kivy"
When i run it, it says distribute : no file or directory. Well, I have just downloaded kivy and extracted I havnt done anything more to it. What am I supposed to do. Please help me here. I really need it. Thank you
I can't give all the details on the individual bits of the build process you might have done wrong, but rather than doing things this way you can use the buildozer tool. If you follow the instructions to install it, it automatically downloads and links all the dependencies (including sdk/ndk/python-for-android/python/kivy), reducing the build process for a kivy app to a single command.
Then further down, it says 'USAGE', ./distribute.sh -m "kivy"
When i run it, it says distribute : no file or directory. Well, I have just downloaded kivy and extracted I havnt done anything more to it.
You would need to run that command from within the directory where you unpacked python-for-android. There would be a file in that directory called 'distribute.sh'.
Also, you don't need to download kivy yourself, python-for-android does this automatically as part of its distribute process. You do need to install your own version of kivy to use it locally, which I assume you've already done?
I assume you are making a kivy app? That is what these instructions are designed for.

Android: Install released version of app to device from Eclipse

When I want to compile a released version of my app, I sign it and rename the apk file to include a version number in the filename. To launch the app on my device I use adb. Is there a way this can be done in Eclipse?
Another related issue: If I press Run (Ctrl-F11), Eclipse will compile my apk and run it on the device. If my project is called "My App", the file "My App.apk" gets generated. It would be nice if I could get Eclipse to generate a filename that has the same filename as my released version and then maybe Eclipse would also install it with the Run command. Is this possible?
You could achieve all that is mentioned in your question using Ant. You can also run an Ant command from Eclipse.
The following resources would be helpful:
Using Ant to automate building Android applications
Building and running from the command line
This not currently customizable in Eclipse. If you need to automate it, use Ant. You can then start Ant tasks from Eclipse as needed.
A suggestion to make the command line option easier...
Create a top level directory. Copy adb.exe, AdbWinApi.dll and AdbWinUsbApi.dll into this, plus .apk. Then you can do this...
C:\Users\your_username>CD top
C:\Users\your_username\top>adb -d install yourapp.apk

Categories

Resources