I code mostly in Java and use Maven for all of my projects. I do really love using Maven since it is easy to download the sources and documentations, and, more importantly, I don't need to keep the copy of the external libraries under my project source code folders.
I have started to develop an Android application and I found that the Android plugin for eclipse are terribly good. However, all provided examples are not maven projects so I do not know whether, if I use maven, I would still get all the functionalities from the Android plugin or whether there is any drawback from using Maven.
So the questions are:
Please do not point to this maven support for android projects?
I would like an answer from experience developers. I already know that it is possible to use maven for an Android app. All I need to know is whether I should use it.
As you know, Maven is a popular software project management tool that helps organize project dependencies using repositories. You can build your Android apps from the command line on your machine from Android Studio,thus by avoiding the mess of plugins as there in Eclipse.
Maven will do the rest for you when you build (download to local cache if not already existing, fetch dependencies, javadoc etc). Even if you were to copy your project to another PC without the JAR's, delete the JAR's etc, if Maven is present it will re-download them automatically when you build.
Maven's primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal, Maven deals with several areas of concern: Making the build process easy. Providing a uniform build system.
Building Android applications with MavenYou only have to install Maven, write a correct pom. xml file and issue the commands to Maven to build, install and run your application. The following will build your Android application via Maven.
My teams current task is to develop an Android app. Since it is a small app and also some kind of prototype we decided to evaluate Maven and the Android Eclipse plugin.
In short: After two developers spent three days, we were not able to gain the Android Eclipse plugin functionalities in our Maven project.
Because of these issues which impeded our development sincerely we decided to develop the app without Maven. But if any of you knows how to fix these issues I would love to hear a solution!
If you want fast running tests you are nearly forced to use maven. As robolectric is the way to go then. And they said Roboletric is probably easier to set up via maven under Eclipse (they are using IDEA).
That said, did you read this post or that? And what error message exactly did you get?
Typical things I made wrong:
Install the necessary sdk (in my case 2.2_r3) via maven-android-sdk-deployer and
export ANDROID_HOME=/path/to/android/sdk
mvn install -P 2.2
And did I mention this strange tool: m2e-android - not sure why one needs so many stuff with Eclipse ... here you can install it via software updates http://rgladwell.github.com/m2e-android/updates/master/m2e-android/
Hopefully I remembered all steps correctly. Good luck!
Update:
Switching back to normal Android stuff without maven under Eclipse as the IDE makes strange stuff: http://groups.google.com/group/robolectric/browse_thread/thread/ac814076c40d9df1
But the nice thing of this Maven adventure is that I can now easily test and debug my projects via NetBeans :)
As we all know Android Devolopment migrated to Android Studio from Eclipse.
The Android Studio build system consists of an Android plugin for Gradle. Gradle is an advanced build toolkit that manages dependencies and allows you to define custom build logic.
The build system is independent from Android Studio, so you can invoke it from Android Studio or from the command line.
The Android Studio build system supports remote Maven dependencies. As you know, Maven is a popular software project management tool that helps organize project dependencies using repositories.
You can build your Android apps from the command line on your machine from Android Studio,thus by avoiding the mess of plugins as there in Eclipse.
Check out this tutorial for Building Android Apps with Maven.
Refer here for more about Gradle build
I recommend avoiding Maven for professional development on Android. Here's why:
In short, using maven as your Android build tool adds much more work than is necessary and creates a management nightmare (IMO).
Try this to illustrate:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With