can i compile android project without eclipse? - android

Hello there is one question which comes in my mind from last 2 days. Can we compile our android project without Eclipse? If yes then what is alternatives? Please share it.

one option is ant, and an extremely reduced tutorial goes like this:
first update your project with a proper build script and all the files that ant needs, you can do that with just one command, for example
android update project -p . -t android-10
this command has many options, feel free to browse for those options.
after that just do
ant debug
or
ant release
depending on what you want to produce, again, ant has other variations and you can easily discover them with the Android docs.

If you are developing in a non-Eclipse environment, you can build your
project with the generated build.xml Ant file that is in the project
directory. The Ant file calls targets that automatically call the
build tools for you.
Look at Here for more details.
cd /path/to/my/app
ant release
it will ask you every time for your private key to sign the app, it can be configured to auto-sign by editing "build.properties" file:
key.store=release.keystore
key.alias=release
key.store.password=my_key_password
key.alias.password=my_key_password
you can also investigate Android SDK, find the ANT build scripts it actually uses, and insert your custom obfuscator/optimizer call in middle of build process.

For people that are not used to coding in java and want to use HTML/JavaScript and CSS to build native apps for android -- you can use PhoneGap -- you can upload your code in a zip and get an APK. Currently its in beta, and thats why free.
https://build.phonegap.com/
Other Phone OSes are also supported. Its pretty interesting.

You can use maven with the maven android plugin http://code.google.com/p/maven-android-plugin/. Afterwards you can use any IDE that supports maven (NetBeans, Eclipse, IntelliJ IDEA).

If you just do not want to use Eclipse IDE you can choose other IDE like IntelliJ IDEA.

Related

Create android apk manually via command line (Makefile)

Problem
I want to create an android app
via a vim & makefile only
no gradle, no ant, no maven, no android.mk and all other stuff
Why?
It is a high performance C++ code that is wrapped for an android device.
Ergo, I do not need 99% of gradles services
15+ seconds built time via gradle for a small program? That is unacceptable.
The incorporation of native code in gradle is ridiculous. These gradle guys come up with an experimental ndk plugin that keeps changing syntax.
I only target ARMv8-A. I will have partly AARCH64 assembler code. And I use a pre-processor m4 that generates *.cpp before they get compiled. Can't imagine gradle has something for this.
My Progress
I know that the following steps are REQUIRED:
Create keystore by keytool from $JAVA_HOME/bin.
Compile source files via javac from $JAVA_HOME/bin.
Create Dalvik Executables for the device by dx from $ANDROID_HOME/built-tools.
Create the .apk file by aapt from $ANDROID_HOME/built-tools.
Sign apk package by jarsigner from $JAVA_HOME/bin.
Align apk package by zipalign from $ANDROID_HOME/built-tools.
Install software on phone by adb from $ANDROID_HOME/tools.
The app crashes on startup. Even when I want to create a blank activity.
-
ok, I figured it out. I placed my sample code on https://github.com/skanti/Android-Manual-Build-Command-Line
Hope it helps you guys too.
Inspired by your work, I published a similar package. However, I use a simple make.sh script instead of Makefile (because I had issues interpreting its syntax). https://github.com/Kolodez2106/HelloWorld-app-compiled-in-bash

Building NDK app with Android ADT on Windows

While there are tons of information on the topic, there is no clear guide on how to compile C++ code in ADT.
Is Cygwin is required?
Where the build artifacts go? How to confogure the destination folder for the build package? Are there a debug and release versions? Is it possible to debug and step through the C++ code in ADT?
Maybe it all is described in a single resource, then a link would be welcome!
Just download the brand new ADT bundle at http://developer.android.com/sdk/index.html and NDK r8c at http://developer.android.com/tools/sdk/ndk/index.html. You don't need cygwin, your NDK build is fully integrated with normal Android development (i.e. the binaries are copied to the lib/armeabi folder and automatically picked up by the APK builder).
It is possible to debug native code (if your app is debuggable), and you can choose release or debug configuration for your native code by running
ndk-build NDK_DEBUG=1 --> force a debuggable build
ndk-build NDK_DEBUG=0 --> force a release build
I strongly recommend that you read the NDK documentation and play with the samples provided as part of the NDK before you start doing things on your own. Actually NDK build system is a wrapper around GNU make, and it is very easy to make the things very complicated by misusing these tools.
Please note that on Windows, you have a completely different option to integrate Android development with Visual Studio 2010: http://code.google.com/p/vs-android/.
There is a solution for visual debugging, Visual Studio style: http://visualgdb.com/?features=android (but this is not free).
There seems to be another option, as well: http://www.wingdb.com/wgMobileEdition.htm, which works with VS 2008.
Ok, here is a page that is a lot of help http://tools.android.com/recent/usingthendkplugin
I will probably add more information here later to help others on the topic.

How to build apk without eclipse or Modify the apk building with a config file?

I want to build an apk with some large configuration from a xml file.I want to know if there is any method that can control the building process of apk or is there any way to create apk from our source with a little bit of modification on our source based on our config xml file.Or any other way to build apk file
I don't want to read my config file each and every time when the app run ,I want to include the change in application itself
All Suggestions,Comments,Answers,Ideas are Welcome
Thanks in advance.....
If you want to manually build your application :
First off, you should really understand the build process, if you don't.
If you are developing in Eclipse, the ADT plugin incrementally builds
your project as you make changes to the source code. Eclipse outputs
an .apk file automatically to the bin folder of the project, so you do
not have to do anything extra to generate the .apk.
If you are developing in a non-Eclipse environment, you can build your
project with the generated build.xml Ant file that is in the project
directory. The Ant file calls targets that automatically call the
build tools for you.
Once you understand the build process, you can start off by learning the commands to perform the various steps involved in building. The documentation talks about the various commands you can use.
This Tutorial on Ant takes you from start to finish on how to perform a custom build.
A few more tutorials:
Documentation
http://www.vogella.com/articles/AndroidBuildAnt/article.html
http://code.google.com/p/autoandroid/wiki/AndroidAnt
http://www.linux-mag.com/id/7667/
http://www.alittlemadness.com/2010/05/31/setting-up-an-android-project-build/
You can use the Apache Ant tool. It allows you to build your application through commands instead of with Eclipse.
You can look at the question asked and the answer given in this thread.
I use Maven. It's VERY hard to configure but is the best if you work in a team.
Please refer to the link below. This has step by step proceduce to automate Building of Android Applications
http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html

Build/Package Android application with rake?

Is it possible to build an android application with rake? The only other question on this subject I saw was a while back and someone advised using Gradle.
So is there any way to do this on the command line, as I am sure under the hood eclipse just runs a lot of command line guff to get the apk file generated then spits it to the device, I just want to generate the apk file (there is alot of other things to be done but these are prior to the APK building).
Is it possible to build an android application with rake?
Yes, insofar as it is possible to build an Android application using Ant, and rake can in theory do everything Ant can.
If you are expecting to find an existing rake script, though, you will likely be disappointed. The Ant scripts necessary to build an Android app are rather substantial, and porting all of that to rake will take quite some time. And, then, they will perpetually be out of date, as those Ant scripts are often modified with Android tools releases.
Here's a small example project that's worth a look: https://github.com/jberkel/android-helloworld-rake
I've been meaning to try it out myself.

Why we use build.xml in android?

I am android developer.I am not aware of ant in android .I have downloaded a code from internet But It has file called build.xml but I am not able to find out what it is doing and for what purpose it is used please give some advise or some kind of tutorial.So I can understand its working thanks in advance.
When you are developing your application, Eclipse is the most convenient way of building the project.
However Ant is most useful when you come to produce a release version. You can set up your Ant build, such that it takes the same source files as the Eclipse project, yet produces a signed, zip-aligned version of the apk in completely separate output location.
By means of a custom build.properties file you can specify source and output locations, keystore names and locations and passwords. It also takes care of any Proguard obfuscation you may want.You can do all this from the command line with a single statement and know that you are going through a repeatable process, not vulnerable to a mouse click in the wrong place.
Have a look at Managing Projects from the Command Line and Building and Running from the Command Line
Take the build.xml from the sample project referred to and use it as a basis for your own project. It works pretty much out of the box.
This build file is an alternative (and less common) way to build your projects using ant.
Eclipse (and the Android plugins) do a n excellent job of saving you the trouble - just use the plugin to build your projects and export APKs.

Categories

Resources