I've recently been trying to setup maven for building my android projects, using the maven-android-plugin.
Whilst this is a good exercise, I'm not convinced that the benefits will outweigh the frustration in getting it working.
Can anyone give me some pros/cons on using Maven for android? I'm not looking for subjective answers, but the facts on whether its worth the effort.
Regards
Well maven is worth it if you are developing a j2ee application to save you from the jar hell
when using external apis
So if you are not going to use the maven repositories its not worth it.
I hate maven because of the problems you already mentioned. But it saves a lot time if you need xy jars. Im currently developing a eclipse plugin which can download required jars and dependencies form maven without the maven compiler or pom files. But its far from ready
You can also create a separate maven project and include it in the android project
im not sure if it works with android but you can do it in standart jdk
Maybe the gradle makes more sense.
Google released an ide called AndroidStudio, it uses gradle. Seems like google will suggest gradle in building an Android project.
I tried to use Maven to build my android project, it's hard to use, finally I changed to gradle.
Another good answer on stackoverflow why-use-gradle-instead-of-ant-or-maven
My android app shares business objects and other functionality with my back-end server so I pulled this out into a common maven project which both the app and the server (as maven projects) have a dependency on. Maven is perfect for this sort of thing, so its helpful in this instance, but if you are writing fairly straightforward apps, I'm not sure what benefit maven would have, especially when getting the android-maven-plugin to behave took me so long.
Related
I want to remove gradle completely from my app, and start using Maven. I know that Gradle is the official and default way, but due to some restrictions, I need Maven. I have investigated but did not come up with a solution. Is is possible? How?
In case that it is possible, how can you set the different parameters? e.g. multiDexEnable, compileSdkVersion, buildTypes...
You can use the Android Maven Plugin
The Android Maven Plugin is used to build applications for the Android operating system as well as build libraries to be used in these efforts in AAR and the legacy APKLIB format using Apache Maven.
It seems quite updated and there's also a GitHub page. Beside, some examples will help you setup your project.
We are using android studio for android development.
We are using lot of java libraries in our android development.To keep jar files at one place we kept them on our server.
So here is the scenario
We are using java1.jar,java2.jar,java3.jar,java4.jar all of then located on remote server in one folder.
So how to gradle build script which will download all the four jars for us and ads references to our android project.
Can anyone please guide?
Sounds like you want a private Maven or Ivy repo.
The two biggest for Maven are Nexus and Artifactory.
I've been working in JSF projects for a couple years; from the standpoint of managing dependencies, maven was a huge time saver as projects may have up to 50 dependencies, and a large number of them were the same from project to project.
Now I'm developing Android projects, I noticed is unusual having more than 5 dependencies, and they're often vary from project to project; in much cases, I don't have a jar to import, but a Project library. So I'm managing my android projects dependencies manually, and didn't miss maven so far.
My questions are:
Is it always a good practice to use maven for any android project, even if it uses only a couple of external jars? Why? If not, when is it a good a time to think about using maven in a project?
I tried to create an android test project using Robotium as testing framework and maven as builder. But, is it necessary for my android application to use maven as builder ???
No, you do not per se need Maven. As a matter of fact, the Getting Started of Robotium gives a basic example of how to do this in just Eclipse.
Now, would life be better when using Maven. I generally like "yes" for an answer to that question. Testing is only one part of your iterative development, and it is great to have all your steps automated. Doing that with Maven allows you to leverage the entire lifecycle that it offers for your project from test driven development, perhaps in an IDE, to packaging and deployment. And the Android Maven Plugin fits into that approach.
I am extremely new to the idea of Build Automation, and am not sure if it would be helpful for me or not. Honestly, I'm not exactly sure what it does or the benefits of it. I've been looking up a lot of information about Maven, and am having a bit of trouble piecing it all together.
Right now I develop a lot of similar Android applications. Most of these applications have a similar base of functionality which I copy from one application to the next. However, when I make changes to one part of that "main functionality," I need to go back and apply the changes to other applications. This is horribly inefficient, obviously. What I've been beginning to do is to set the main functionality as a library which is then imported by each application. So far so good.
So in addition to the library approach I'm using, would Maven be helpful? Is there something else more helpful that I haven't seen yet? Sorry for the really basic questions and thanks for the help!
Maven will not help you for code generation it will only help you to automate your build process.
You can configure your eclipse using maven plugin for android Android SDK Full Javdocs with Maven in Eclipse
I have not used Maven for android project as of now since currently I am using Ant for that purpose. You will find sample maven and ant files in the examples in android SDK
About code Generation:
I have read that Acceleo provides support for android based UML Code generations.