Robotium project and maven - android

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.

Related

How to create an eclipse-compatible, mavenised Android project?

I need to create a Maven project for my Android application. When I use the normal Android Maven plugin, it produces a file structure with incorrect location of test classes (the test classes lie where Maven expects them, but eclipse doesn't and it leads to difficulties debugging unit tests in eclipse). There is a workaround for this, but it isn't very elegant.
How can I create a Maven project, which will be compatible with eclipse (allow me to run unit tests in eclipse and - ideally - deploy my application to an emulator from within eclipse) ?
Maybe this project can serve you as inspiration.
Sonatype, one of the main developers of Maven and related projects, has a free chapter about using Maven for Android.

How to use code automation for Android Projects?

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.

Maven Integration for Android Development

How can we used Maven for android?
I'm using Lint tool in android for programming error solution.
Is it Maven same as this tool or provide more features over android?
Because i'm using Maven tool in Java programming for different kinds of testing like integration testing unit testing with predefined test cases.
If Maven work same in android also, than provide me help to implement in my existing project. What basic steps needs to be done for integrate Maven in android?
Following two links help you to start with Maven integration in android:
m2eclipse-android-integration
New Maven Android Plugin features
If you have any specific requirement or query than you can ask me.

Continuous Integration for Android via TeamCity. Preferred tools?

Our team is new to both Android and Java development (originally, we came from C++), therefore our knowledge about build tools for java is pretty shallow.
There are few build tools which can be used for build automation, and the most interesting I found were ant and maven. And although there are many articles on build automation, I didn't find any comprehensive tutorial on automating Integration process for android apps.
I would be very greatful if you could state your preferable build tool for Android and explain or give any links explaining the process of continuous integration for android apps (which cover not only building application package, but running tests under the emulator).
Thank you very much for your time and assistance.
P.S.: We are using Team City as the Continuous Integration server.
We are building our continuous integration platform for Android using the following:
Maven - for managing the build/unit-test/integration-test/deploy cycle
Hudson - for continuous integration
Team City will also run Maven projects - it is fairly simple to configure a TeamCity agent to run a specific Maven goal e.g. mvn integration-test - the agent could be running on a PC with an Android emulator or a real Android device plugged in.
In the past I've had a whole bank of TeamCity agents testing against different hardware. For example if you have 5 Android devices plugged into an agent you can configure the TeamCity build pipeline to run the integration tests (controlled easily via Maven) on ALL 5 devices and only declare a PASS when they pass on all 5.
Ant (http://ant.apache.org/) is pretty much the de facto standard for building java projects. It features a very easy to learn scripting language and can even be used to deploy your application to multiple targets.
For automated testing, most java developers use jUnit (http://www.junit.org/). While not quite as seamless as the Ruby on Rails testing framework, jUnit tests do allow for test-driven development.
Maven (http://maven.apache.org/what-is-maven.html) is more of a meta-program that can use ant scripts and run your jUnit tests. True, ant can also be used to run jUnit tests, but Maven does a good job of pulling all of that together as well as providing extra functionality (example: the ability to automatically find external dependencies and download them).
While I am not familiar with TeamCity, I would be surprised if it did not have a way to integrate with ant/maven/junit.
Best of luck!

What benefits does Maven give (over ant) for building android projects?

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.

Categories

Resources