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.
Related
I am having the damnedest time getting Flutter to find the SDK command-line tools. I am trying to install the latter by downloading the zip provided at that link and unpacking it in say ${HOME}/Android. This produces a tools directory, and if I run the executable
${HOME}/Android/tools/bin/sdkmanager
directly (whith any number of options, etc.) I always get an error as documented in this other post. The solution recommended there actually works: move the tools directory further down the tree to get the path
${HOME}/Android/cmdline-tools/tools/bin/sdkmanager
That new intermediate directory must be named cmdline-tools though; I've tried other things (Sdk, sdk_manager, etc.) to no effect: the same errors occur.
Now, poking around in the cloned Flutter repo, I see in the file dev/bots/download_android_sdk.sh that I'm supposed to have the executable
$ANDROID_SDK_ROOT/tools/bin/sdkmanager
This tips me off that in my setup I need
ANDROID_SDK_ROOT=${HOME}/Android/cmdline-tools
exporting that and running a bunch of sdkmanager installation commands (like say
$ANDROID_SDK_ROOT/tools/bin/sdkmanager platform-tools
and the like) I see that my ${HOME}/Android directory is starting to get populated with the corresponding directories platform-tools, build-tools, etc. So those newly-installed directories live at the same level as my $ANDROID_SDK_ROOT which remember, as I'm doing this, is set to $HOME/Android/cmdline-tools.
On the other hand though, when I then go look (in the same Flutter repo) in the file
packages/flutter_tools/lib/src/android/android_sdk.dart
I see that I'm supposed to have the directory $ANDROID_SDK_ROOT/build-tools. This is in direct contradiction with the previous observation that build-tools and the like are supposed to be at the same level as $ANDROID_SDK_ROOT, and not under it.
My problem is I don't know how to square this apparent self-contradiction in the Flutter codebase. Which is it? In my setup, is ANDROID_SDK_ROOT supposed to be $HOME/Android or $HOME/Android/cmdline-tools?
PS
I understand that $ANDROID_SDK_ROOT is supposed to be "the SDK installation directory", but in this context this tells me nothing: after all, installing SDK is precisely what I'm trying to do.
You got a couple comments on GitHub as well, but just be aware that the files in the dev/ folder in the Flutter repository are mainly intended for CI purposes and for people who are developing the Flutter framework itself.
The scripts you're pointing out are actually stale files that used to help set up some tests we ran on CI. We now set those tests up differently, but forgot to delete the files - so thanks for pointing this out, they're soon to be gone!
The best way to set up your Android SDK is by following the instructions at the Android Studio site. You can either use Studio to do it, or just download the SDK bundle(s) themselves.
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.
"Error executing aapt. Please check aapt is present at ... /platform tools/aapt"
I am trying to build Android apps using Eclipse Android SDK in Ubuntu.
I installed Ubuntu 32bit 10.10 in two different computers and I can't fix the problems now.
I installed Eclipse, ADT plugin, Android SDK, all Android APIs, ...and also I have set Preferences to Android SDK folder. I also carefully put all SDK and Eclipse in my username folder to make sure I fully have right permission.
I also try to use google to find similar cases. Most cases use 64 bit Ubuntu.
I also fix the GNU compiler and some instructions here.
But now I am really hopeless. It looks like this problem is really serious.
I really appreciate all of your helps.
Thanks so much
ddienle#gmail.com
ledangdien#yahoo.com
Thanks again
*Also, I try to restart my Computer many times and try to install many different version
of Eclipse. Each time I set Preferences for Android SDK, the following message box occur
"Failed to get the adb version: Cannot run program "/home/sdc/android-sdk-linux_x86/platform-tools/adb": java.io.IOException: error=13, Permission denied"
Now I try everything but they don't work*
Have you tried the adt-eclipse-bundle?
https://developer.android.com/sdk/installing/bundle.html
You have some wrong permissions. Perhaps some files are owned by the root user because of using sudo when it wasn't needed. All files in your home directory should be owned by your user. You can fix that with the following:
sudo chown -Rc $USER:$USER /home/sdc/
Update: This is an old post, and references below to broken aapt versions will be out of date.
Based on previous feedback, I am storing custom text fields in the assets directory of my app.
I will write the app, using default user details in an asset file, and the client would like to rebuild the app for each user, including that user's details in the asset file.
(I am aware this is method has some serious shortcomings, but the client is still keen to do it in this way - see Embed login details in APK file, different for each user (or other options?))
This question relates to troubles I am having with rebuilding the APK file, once I have unzipped it, and updated the custom asset file. I am quite convinced I am missing something small, however, the documentation and posts I have found on these methods are not helpful enough for a newcomer.
aapt - Android sdk tool: Unfortunately the android docs on "Using aapt" on the android docs [link 2 below] are very limited. The console command -help shows a bit more info. When trying to use it to just add a file to the test.apk, it ends up deleting the original, and creating a new file test.apk.zip containing only the file I tried to add. I have not been able to find the correct command line combination to take an unzipped apk and repackage it - that would be my first prize.
apkbuilder - Android sdk tool: Firstly this tool is deprecated, which is a negative point for it. I also can't get it to work with what I have in that unzipped folder. I think I'm missing a pre-apkbuilder step because apkbuilder asks for a resource zip archive, and I have a resource folder.
ant - build tool: Other similar posts say to build with ant, rather than using the android tools. I am having trouble getting ant to work. One particular link to Getting Ant to Work with Android [link 3 below] looks promising but looks like it is for a different android sdk (my build.xml that is generated by android looks different to his). Unfortunately I know little about ant, and am having trouble becoming expert enough to solve my current issue.
Further to NickT's solution below - running the ant script gives me the error
taskdef class com.android.ant.SetupTask cannot be found using the classloader AntClassLoader[].
I have found some references online to this error, have confirmed that local.properties has an sdk.dir setting that is pointing to my android sdk install folder (sdk.dir=/Applications/android-sdk-mac_86).
?????: There might be some other option that I have not listed / discovered, which I would be interested in hearing about.
I realize that delving into the gears that are normally covered up by my ide can lead to diffuculties. But I know that a lot of the SO users can do many of these things, and I hope I get the interest of some of them. Thanks for any help.
(Eclipse 3.6 on Mac Snow Leopard 10.6 64 bit)
PS, I am not able to post more than 1 hyperlink yet, so I have included these addresses to show more info to my question.
(1): stackoverflow.com/questions/4783160/embed-login-details-in-apk-file-different-for-each-user-or-other-options
(2): developer.android.com/guide/developing/tools/aapt.html
(3): www.disgruntledrats.com/?p=27
To answer my own question with the method we finally chose, and "for the record":
I was unable to get Ant working correctly for me (my lack of understanding).
I ended up using the aapt tool. It works as per the Android sdk documentation and really is quite simple to use:
aapt add -v Test.apk "assets/readme.txt"
This will add a readme.txt file (we were storing it in a subfolder of the current running folder, called assets. If you want to store the new file somewhere else, aapt does offer a command line switch to specify that)
However, there are some caveats:
I couldn't get it to work on signed APK files.
some versions of aapt don't work properly! They don't recognise the subfolder...
To solve 1:
Export the APK from eclipse as an unsigned APK.
Use the keytool to generate a key (see Android dev docs).
Use aapt.
Sign the APK using jarsigner.
To solve 2:
I can't really help with this. Every version of the SDK (on Mac) I tried to download included an aapt tool that did not recognize the subfolders. A colleague downloaded a version that worked, but we could still not figure out which version it was that he downloaded, so we kept this "magic" copy and renamed it and will be using it until we find a new version that works.
The simplest solution would be to give the template source of the app to your client with a script that rebuild the app from scratch.
This way your client simply have to change the assets in the folder, double click a batch file and get the apk in a minute or so.
You don't have to know anything about ANT to compile and package without the IDE, just follow the steps here :
http://developer.android.com/guide/developing/other-ide.html
The ANT script is generated by the "android create" "android update" commands. You then just need to run "ant release" and off you go.
A bit late, probably, but this post appears in lots of searches, so I thought this may be of interest.
I just used a standard Zip tool to 'unsign' the APK by removing the META-INF folder, updated any asset files, and then resigned the APK using jarsigner. (If I could find a way to sign JARs without using jarsigner, so we wouldn't need the Java SDK installed everywhere, this would be really useful - ideas anyone?)
To expand on Yahel's answer, yes I think Ant is the way to go. It can be a bit intimidating, but it's urprising how well it works 'out of the box' without too much messing about. Customising it takes a bit of reading but I managed it, so I'll give you the benefit of my experience.
Firstly create a sample application as suggested. Let's suppose you want it to be created in c:\junk.
Then from your a command prompt in Android SDK\tools directory type:
android create project -t 5 -n AndSampleApp -p c:\junk\AndSampleApp -a AndSampleApp -k com.yourpackage.andsample.
( -t 5 gives you API level 7, type 'android list targets' to see other options)
Let's assume you've been building your projects in an Eclipse workspace (it's /dev/projects/EclipseHelios/AndroidWorkspace on my machine). Copy the sample app's build.xml and build.properties to the project folder in Eclipse
and edit the newly created build.xml and remove the line
<project name="AndSampleApp" default="help">
and replace it with just:
<project>
Now edit the the newly created build.properties which will be empty except for comments and add (customisng where necessary):
# The password will be asked during the build when you use the 'release' target.
# OH NO IT WON'T! IF YOU PUT THE KEYS & PWDS IN AS BELOW - It'S AUTOMATIC
# Customised (hard coded) section ---------------------
projectname=YourActualProjectName
# Line below is the parent folder of where the sources are
workspace.dir=/dev/projects/EclipseHelios/AndroidWorkspace
# Line below is where you want the binaries to go
outbasebase.dir=/dev/projects/AntBuilds
key.store=c:/users/you/your-release-key.keystore
key.alias=your_release_alias
key.store.password=YourSecretPassword
key.alias.password=YourSecretPassword
#------------------------------------------------------
ant.project.name=${projectname}
base.dir=${workspace.dir}/${projectname}
source.dir=${base.dir}/src
outbase.dir=${outbasebase.dir}/${projectname}
out.dir=${outbase.dir}/bin
layout.dir=${base.dir}/res/layout
If you then get a command line prompt in /dev/projects/EclipseHelios/AndroidWorkspace/YourActualProjectName
and type 'ant release', you should end up with a built and signed apk in /dev/projects/AntBuilds/YourActualProjectName
You should be able to customise the assets location by the adding an assets.dir entry in the build.properties
I installed JavaEE, JDK, Eclipse 3.5.x (Galileo), the Android Starter SDK, and the current ADT all with no problems. However, when I try to walk through the 'Hello Android' tutorial, I bring up the New Android Project wizard, fill it in and hit 'Finish'.
After a moment, it comes back with a message saying there was a problem at path X:\so and so\ (access denied).
Things to note:
-Running Windows 7 Home Premium 64-bit
-Quadcore Pentium with 8GB RAM, 8TB NAS
-I am an Administrator
-I have also tried this by activating the full (hidden) Administrator profile
-I have reinstalled everything 8 or 9 times
-I have changed ownership & permissions all over the place
-I have launched eclipse in 'Run as Administrator' Mode
-I have installed Everything as 32-bit, as others have done this successfully
Eclipse creates the folder it's having a problem with, but then cannot work with the .project file it creates (access denied). It then can't save anything so there is nothing but an empty folder 'Hello_Android' on the left within Eclipse.
Anybody have any clues about what is going on-- I'm frustrated. I want to get into this, and I've looked EVERYWHERE on the net trying to crack this nut.... but I need help.
-J
Hmmm. Interesting.
I would double-check permissions on the folder X:\so and so\ and ensure that the Administrators group and/or your account has full control.
Have you tried creating the project outside of the users or systems environment? You know in c:\myprojects
Windows7 and creating/saving files in program files or documents can be a PITA.
Turned out to be a bug with how eclipse is written. I've developed a workaround.
The problem is that eclipse can't write to hidden files, unhide them and it should work.