How to develop Android applications? [closed] - android

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I used to be an Android developer for 2 years, but over 2 years ago. I believe that things changed - we have Android Studio, Gradle and probably more tools that I'm not aware of right now.
What is the current development stack for creating Android applications? What tools should we used right now?
I used to use eclipse with ant, but as far as I can see, a lot of people are using AS with Gradle, which is, for my first experience, extremely slow.
How to jump back into Android development after some time of not being up to date with development stack?

Eclipse vs Android Studio is a matter of choice. You can get used to it within hours, or you can continue with Eclipse. I am using both tools for different projects.
Android Studio seemed to be more stabile at some points.
Update on Android SDK and third party libraries are more easily handled with Android Studio.
Android Studio has not NDK support yet. You have to compile native codes outside of Android Studio. Edit:(Well, actually it has support but claimed to be deprecated, probably developers are working on a better solution)
Edit2:(It will be soon officially supported with C/C++ debugger)
With Android Studio you can use java7 syntax, but you have to stick with java6 syntax on Eclipse. Edit:(you can now force java8 with a plugin on A.S and I guess java7 is usable on eclipse too) Edit2:(java7 is a must now for both parties, but still java8 syntax can only be used in A.S with a help of plugin)
Google releases example codes compatible with Android Studio saying eclipse versions will be available soon.
Android Studio has better GUI designer.
Android Studio has better refactoring capabilities.
The most important change is SDK itself, actually. Just check if Android Studio is good enough for you and study on SDK.

It depends on your project. For non critical or hobby projects you should definitely start with AS and Gradle right away because this the the future of Android development. Although it is still in 'beta' and it can break some stuff after a new upgrade, it has many new features which make you more productive and happier in development.
If you have a critical project and you don't want to spend your time with checking and fixing things your are not supposed to fix, you should stick back to Eclipse, at least until AS is released.
Independently on whether you use AS or Eclipse, you should already start learning and using Gradle. It works perfectly for both options. If you hesitate you can even keep Ant and Gradle building your project in parallel. They work together and don't overlap.

I have been using Android Studio the last year and I can say that it is a very powerful tool, that I believe, in the next year, will overcome Eclipse.
When AS was still in version 4.+ Alpha, there were some issues (mostly with external libraries .jar) but since beta was released and up until now almost every bug was fixed.
Moreover, AS is better when it comes to indexing and suggestions. You will be surprised by its suggestion system, which helps you save a lot of time when coding.
I still use eclipse for other projects, but I believe for Android Development AS is the tool you should invest in, if not for now, definitely for the future.

We are using both, Android Studio and the good old Eclipse IDE. We noticed, that it basically depends on what you're doing. Android Studio is good enough for developing from now and it will replace Eclipse soon. However, it has some drawbacks where Eclipse is your choice. A small comparison was made by Google themselves: https://developer.android.com/sdk/installing/studio.html
Eclipse: Eclipse is very stable and works perfectly with ant driven builds. However, if you want to use gradle, there's some work to do to get the build process working with eclipse. We tried to use Eclipse with Gradle but the Gradle Plugin was quite buggy at this time. If you want to use native C code, you must use Eclipse, as Android Studio does not support that, yet.
Android Studio: Looks great and does also a very good job. The gradle integration works much better there. This is a big advantage over Eclipse when you have to deal with many dependencies. This is probably not an issue for small projects. But, if you're developing projects with additional libraries or frameworks you should definitely give Gradle a try. I hope, that the NDK support is coming soon, so that we can switch to AS completely. Ant builds are someway out-dated.

First of all, I will not debate about Android Studio vs Eclipse as it's an opinion based discussion and a kind of a troll...
The Android development basically the same : the base tools still ADB, Android SDK, Java language... So you can continue to use a "notepad" and compile, build and deploy by the SDK tools.
However, like in every development project, you could choose your upper level tools. Your question is about IDE and building system. This is only a matter of choice.
Android Studio and Gradle are still in beta phase for Android developments and you could use them only if you keep this in mind. You could continue to use Eclipse and Maven or switch to Android Studio and Gradle or keep using Eclipse but moving from Maven to Gradle... just make what you prefer.
The Android development stack evolved this way :
Basics tools : Text editor, SDK tools
First IDE : Eclipse with ADT plugin (can run your program from an IDE)
Industrialisation phase : Eclipse ADT + Maven (dependencies management, building process management...)
Coming phase : Android Studio (IntelliJ based) + Gradle (you can compare Gradle to Maven, but this is another discussion)
I think that other answers will give you personnal points of view about Eclipse vs Android Studio, Maven vs Gradle, etc... which is a really personnal choice ;)

My development stack for Android :
IntelliJ 14
Maven
Android SDK
plus my own OSS Framework to ease the pain of Android for a Java EE developer
Reasons:
IntelliJ is the best available IDE imo
Maven is pretty mature
The plugin has become useable
The workspace integration Maven -> IntelliJ is working great (both, using maven builds and deriving IDE builds from maven)
If Android Studio (which is in great parts IntelliJ) has become slow, it come due to the gradle stuff. I had a large scale project based on gradle and made these experiences :
Slow, Slower, gradle (up to 2GB memor consumption for building an app)
Xml is horrible, but gradle dsl is imo even worse
Switching to gradle 2.1 broke the predicate logic (e.g. formerly working project.hasProperty("foo") && property.ext.foo.equals("bar") does not work any more, this must not happen during a MINOR release
Compared with maven's xml hell, gradle leaves a callow, unmature impression on me, especially building with gradle is hell of a slow job compared with maven.
But - and this is my true oppionion - if gradle is pushed by google and gradleware, it definitely has the potential to become the next generation building tool, although I doubt that the flexibility in gradle will ever lead to a proper IDE workspace build derivation. From my point of view, the choice for gradle over maven done by google happened in a too early state.
just my two cents.
PS: Try tuning the memory settings. Give more memory to IDEA (e.g. 2GB in a 64bit enviroment). My experience with IntelliJ is, that the default mem settings are too small. You can find it in $InstallDir/bin/idea.exe.vmoptions resp. $InstallDir/bin/idea64.exe.vmoptions
EDIT: This is not intended to be gradle bashing. Gradle has large potentials indeed. This post reflects my experiences during my last project basing on gradle (non-Android). For beginners gradle might be the better choice since it is a lot easier than maven.

Related

Easiest way to code/debug in Android studio without Gradle

So a couple of days ago, I decided to start android programming using Android studio. After installing the IDE I had some problems syncing Gradle (discussed here). Now I'm trying to use Android studio without Gradle. I've read some topics about using Ant etc. but I don't know which one is the easiest way to do that, And most of them weren't talking about Android studio.(note that I want to use Android studio and build/debug apps normally, just like someone who uses Gradle)
Gradle is the build system for Android. Android Studio uses it for all its builds. You can't build without using Gradle. There were alternative build systems years ago, but they stopped being supported almost a decade ago now. While it would be technically possible to build without gradle, you'd be doing months of work to get a basic build up and running because you'd have to rewrite EVERYTHING google's build does using the alternative system.
Basically you can spend a few days figuring out how to fix your gradle setup (which will almost certainly end up being trivial) or you can spend the next year writing a build system. Pick the first option.

Is it possible to run the same source code in eclipse and android studio?

I am new to android development, So I am not sure if this question is very silly
I was wondering if the same source code can run in both eclipse and android studio
If this is possible how to do it, and what points should be considered?
If not what are the road blocks to accomplish this.
Simple answer: Yes, you can "write" (not run) in both IDE's.
Aside: You really don't even need an IDE. If using Gradle, you can write code using any text-editor, then compile, build, test, and install all using Gradle.
If this is possible how to do it?
Well, Android Studio can import Eclipse projects. That is pretty well documented.
Eclipse (unofficially) has an Andmore project and also supports Gradle projects.
what are the road blocks to accomplish this
If using Eclipse, it's not supported by the Android team anymore, and you'll likely be missing out on features that are actively added to Android Studio.

What are the differences between android studio and the eclipse version bundled with android SDK

I don't have experience in android development and I'd like to start writing an application.
The official developer tools page contains link to two different IDEs. The first contains a bundled ADT version of Eclipse.
Android Studio, the second IDE, is based on IntelliJ.
Apart from these differences I can't get if there is anything that I can do with only one of them (I guess the answer to this question is no) and what's the point of having two distinct official IDEs.
What are the differences between the two?
The first contains a bundled ADT version of Eclipse.
This is simply a packaging convenience. You are welcome to obtain Eclipse separately and add Android tooling to it.
Android Studio, the second IDE, is based on IntelliJ.
At the present time, this is an early-access preview. IMHO, it is not suited for someone who does not have experience in Android application development.
Apart from these differences I can't get if there is anything that I can do with only one of them
At the present time, Android Studio is an early-access preview, meaning that there are lots of things that it does not have integrated in. Now, by this time next year, and hopefully far sooner, Android Studio will have equivalent or superior integration than does Eclipse with the ADT plugin.
and what's the point of having two distinct official IDEs.
There are an infinite number of "official" tools. You are welcome to use a plain text editor and tools outside of any IDE, for example.
You are welcome to watch the Google I|O 2013 video on developer tools, where they describe a bit of the rationale behind the development of Android Studio.
Android Studio vs Eclipse – Main Differences:
Build Tools
Android Studio utilizes the fast growing Gradle build system. It
builds on top of the concepts of Apache Ant and Apache Maven but it
also introduces a Groovy DSL (Domain-Specific Language) that allows
for scripted builds which opens up many automation possibilities like
uploading your beta .apk to TestFlight for testing. Eclipse on the
other hand uses Apache Ant as its main build system which a very
robust XML based build system that many Java developers may already be
familiar with.
Advanced Code Completion/Refactoring
Both IDEs feature the standard Java code auto completion but in the
case of Android Studio, Google has baked in deeper support for
specific Android code and refactoring. Android Studio can refactor
your code in places where it’s just not possible using Eclipse and
ADT. In addition, in my opinion IntelliJ’s Java auto completion seems
more “intelligent” and predicts better what I want to do so there is
definitely an improvement in this area over Eclipse.
User Interface Design
One of the main selling point Google used to market Android Studio
when it came out was its completely redesigned user interface design
tool. After working with it for some time, it’s clear that the new
tool is much better than the old. It literally crashes it. The new
interface design too in Android Studio is faster, responds to changes
more rapidly and has more customization options that with Eclipse, you
had to manually set in the XML.
Project Organization
Both IDEs work differently in an effort to help you manage and
organize your projects. If you’ve used Eclipse then you must be
familiar with the concept of workspaces. When Eclipse starts, you
select the workspace that contains your projects and you can load all
project of that workspace in your tree navigation. If you want to
switch to a project in a different workspace, then you have to restart
the whole IDE. Android Studio treats this situation differently by
introducing the concept of modules. Your app could be one module, a
library that you just downloaded can be another and the Ad SDK you are
currently integrating could be a third. Each of these modules can have
their own Gradle build files and declare their own dependencies. To
me, Android Studio seems more natural but it takes some time to get
used to if you have been using Eclipse for a long time.
IDE Performance/Stability
Eclipse is a purely Java based software, and a big one. In order to
run it reliably you need to have more than decent amount of RAM and
good CPU power to back it up. Many user who do not strictly meet these
criteria are reporting very bad experiences with it. It is not unusual
for Eclipse to crash while exporting an apk or having to restart it
after using it for a few hours straight. Having said that, Android
Studio is still in beta so it comes with its own bugs that crash the
IDE every now and then but in the meanwhile, the whole experience
feels faster and more robust.
Conclusion
Having used both Android Studio and Eclipse for a while now, I would
personally say that Android Studio has the edge over the two. It might
be a bit unstable yet and some updates require a complete
re-installation of the software but when it eventually comes out of
beta, it will blow Eclipse with ADT out of the water. I especially
like the stability of the editor and not having to reboot every now
and then, the new and improved UI designer and the sexy themes that
make Android Studio a real eye candy. What side will you take in the
Android Studio vs Eclipse battle?
Besides the numerous points already made, while you can use the ADT tool for other projects outside Android, the Android Studio is purely dedicated to the development of Android apps.Android Studio also allows you to work faster as it gives you intelligent suggestions as you type, freeing you from the shackles of having to go back to your .java or .xml files to look up names of variable or other stuff you can't remember.I just started using Android Studio myself and i can say i am never leaving it.It is particularly good for new programmers.

How to install new Android Studio extensions to IntelliJ IDEA

Is it possible at the moment to add the Android Studio extensions to a current IntelliJ IDEA installation?
Xavier Ducrohet and Tor Norbye mentioned in their talk, that Android Studio is an extension to the Community Edition of IntelliJ IDEA and that it's not a fork. So it should be possible to add the extension.
Is there an easy way to do so and probably to revert?
They also mentioned in their talk, that Android Studio uses Gradle as default build system. This should break the builds of current modules. Is this correct?
Thanks for the answers, but I finally found the corresponding statement by JetBrains: http://blog.jetbrains.com/blog/2013/05/15/intellij-idea-is-the-base-for-android-studio-the-new-ide-for-android-developers/
You can upgrade by hitting help -> Checking for updates and then choose Early Access Program as channel in the Update settings. You should receive a notification, that version 13 is available.
This EAP version contains almost all Android Studio features except the new Project Wizard and the App Engine Cloud Endpoints, but they will come soon. The reason for the delay is the Google IO, in the future new Android Studio and IntelliJ versions will be synced (mentioned in the comments of the blog post).
I guess it will be at androidstudio but the project is currently empty.
The installation page is here: Android Studio.
From what I understand in the download page & from what they said in the conference, it's a stand alone IDE based on the intelliJ, but i'm skeptical to whether one can get it as an extension to an already installed intelliJ IDEA.
About the build - in Migrating from Eclipse page they explain how to generate Gradle build files for your projects in Eclipse and then import those projects to Android Studio. It's pretty simple and straight forward.

Scala, Android and Eclipse

I've started learning Scala, and I... I think I'm in love. I've only coded small test snippets so far, but since I currently working in Android development, what I really want to do is try my hand at writing Android applications in Scala.
I've found articles and questions on the matter, but mostly referring to older versions of the three tools (Android SDK/Scala/Eclipse), so the general question is:
Is anybody coding Android apps in Scala right now, with the latest SDK, Scala 2.9 and Eclipse Indigo? How viable is it?
And, in particular:
How's the interaction/integration between Scala's features and the Android library?
What's the state of the Scala plugin for Eclipse? I've read all the features you'd expect are there, but I'd like to know first-hand stories, specially about the debugger.
How well does the build process (scala to java to dalvik, ant, proguard, etc.) automate?
Thanks!
We are using Scala heavily to test our Android code - you can read a writeup of how we're doing so here. We use Ant or SBT to compile - there's an excellent SBT plugin for Android development.
Having said all of that, I'm not sure that I would recommend Scala for production Android development. In particular Scala 2.9.x is basically unusable as there is no good way to get the libraries to work on Android. You can read about the issue here.
It's a real pity, as Android development would benefit considerably from Scala if we could get it working properly.
Solution found here to use the latest Android SDK, with Eclipse 3.7.2 and Scala 2.9 :
https://stackoverflow.com/a/11084146/1287856
It completely handles the android library
You can make Android Library out of scala projects as usual
The build process is completely automated, including proguard-ing and exporting the project with the regulard Android tools.
I started to implement the android application (a twitter client) from the book "Learning Android" with Scala 2.9.0-1 a while ago.
In my opinion you can use it. I had only one problem with the parameter list at AsyncTask (see this link, problem #3).
If you want to checkout out the project, you can find it here.
This video from ScalaDays 2011 may be hepful:
Scala on Android: Real-world Experience at Bump Technologies by Michael Galpin
EDIT:
If you really really want to run Scala code on Android (and not really make an app, but for yourself), then I have an easier solution. It depends on if your phone supports the procedure. In summary the steps are:
Install Ubuntu on your device (as described here). This will not affect the Android installation.
Boot Ubuntu, install JDK, Scala, etc, copy your Scala jars and run from there.

Categories

Resources