Tag Archives: android

November Community Spotlight: Manfred Moser of simpligility technologies


November 7, 2011 By Emily Blades

Open source software emerges when people work in unison to create something greater than any one of them could create on their own. While the result may always be a collective work, the contributions and sacrifices that make a project thrive are always individual. These contributions deserve recognition. Sonatype will be paying tribute to the members of the Java open source community, who dedicate themselves to improving these projects. We’ll do so by featuring them in our new Community Spotlight each month. This month’s spotlight is on Manfred Moser of simpligility technologies.

If there is someone you would like to nominate for the community spotlight, please don’t hesitate to contact us at communityspotlight@sonatype.com. Thank you! Continue reading

Droid Does Maven, Android Does


July 9, 2010 By Tim O'Brien

If you already use Maven, developing a Android application isn’t going to be a stretch. There’s a very active community of open source projects for maven-droid development, and the Android SDK artifacts are available on Central.

You’ve probably noticed increased advertising for Google’s Android platform over the past few months. The mobile wars are heating up with the release of iPhone 4 and Android-based phones seem to be gaining market share at a rapid pace. Even if you don’t already develop for a mobile platform, you, your company, the organization you are a part of has started to have discussions about developing applications for these smart phones.

If you are thinking about mobile development with Maven, Here are some pointers to some great resources to get you started:

Continue reading

MASA: Building Android Applications with Maven


November 10, 2008 By shane

When I first downloaded the SDK for Android nearly a year ago, I was greeted by an ant build file. I wanted to start developing Android applications but wasn’t willing to go back to ant to do it; so I decided to throw together a quick set of plugins to build Android with Maven: MASA Plugins. The name MASA comes from PKD’s book We Can Build You. In the book, there is a company MASA Associates (Multiplex Acoustical System of America), responsible for building simulacra (or androids). PKD’s MASA is also a play on the word NASA, and as we all know, Maven is as simple as rocket science.

After starting, I found there was little documentation on how to use the command line to build Android apps, leading me to dissect the build.xml file to learn how the command line options worked.

After that, it was just a matter of creating a custom lifecycle for the packaging type ‘android:apk’. The plugins largely consisted of translating POM parameters to the command line, similar to Apache NMaven, undergoing incubation at the ASF.

A sample POM looks like:

<project>
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.jvending.masa</groupId>
   <artifactId>maven-test</artifactId>
   <version>1.0.1</version>
   <packaging>android:apk</packaging>
   <name>maven-test</name>
   <dependencies>
      <dependency>
         <groupId>android</groupId>
         <artifactId>android</artifactId>
         <version>1.0</version>
      </dependency>
   </dependencies>
   <build>
      <sourceDirectory>src</sourceDirectory>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
               <source>1.5</source>
               <target>1.5</target>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.jvending.masa.plugins</groupId>
            <artifactId>maven-dx-plugin</artifactId>
            <extensions>true</extensions>
         </plugin>
      </plugins>
   </build>
</project>

So by specifying the packaging type as ‘android:apk’ and the sourceDirectory as ‘src’, you can build your android project with Maven. If you type ‘mvn install -Dmasa.debug’ the plugins will also deploy the apk to the G1 device over USB or to the emulator.

For the latest SDK, I included the packaging type: ‘android:apk:platformTest’ that will deploy the apk to the device and run the unit tests on the target device.

At the time, the Android source was not open-source, so MASA provides a build script for importing the android.jar into the local repo. Now that Android is open-source, I’ll be looking to deploy the android.jar into the Maven repo to avoid this additional step and then getting a release of MASA deployed as well.

One area that I still need to work on is the delayed signing of apks, so expect to see future updates.