Ubuntu 14.04 Android using maven one use example engineering

Source: Internet
Author: User

The previous article describes the development of ant under the SDK, which is based on the attempt to develop with Maven.

Maven-android-plugin need to be used here.

This article mainly refers to the official document: https://code.google.com/p/maven-android-plugin/wiki/GettingStarted

First download the example project from here: Https://code.google.com/p/maven-android-plugin/wiki/Samples, Save to local jayway-maven-android-plugin-samples-4d8d535/

Go to subdirectory of this directory: Helloflashlight

Run MVN clean compile, after compiling an error, you will be prompted to install some Android SDK with the following command:

/opt/android-sdk-linux/tools/android Update SDK--no-ui--all--force

After running MVN clean compile, the compilation succeeds.

Now start the virtual appliance first

Android AVD
Then select the mt680 I created earlier to start it.

Now go back to the jayway-maven-android-plugin-samples-4d8d535 directory and run the command

MVN clean Install

After a long wait, you will see some tests succeed and some fail. Maybe my mt680 is too old.

[INFO] [INFO] Android SDK apidemos-parent ........ ....... SUCCESS [0.324 s][info] Android SDK apidemos-application ..... ..... SUCCESS [26.921 s][info] Android SDK apidemos-instrumentation Test .... SUCCESS [25.250 s][info] helloflashlight ..... ..... ................. SUCCESS [1.275 s][info] morseflash-parent ......... .............. SUCCESS [0.004 s][info] morseflash-library ......... ............. SUCCESS [35.338 s][info] morseflash-app ......... ................ SUCCESS [4.753 s][info] morseflash-instrumentation Test ...... ..... FAILURE [13.121 s][info] Scala application ......... ............... Skipped[info] The Library Projects the Parent ......... ......... Skipped[info] Library Projects-aar 1 ......... .......... Skipped[info] Library projects-apklib 1 ........ ......... Skipped[info] Library projects-apklib 2 ........ ......... Skipped[info] Library projects-main App ....................... Skipped[info] Library projects-instrumentation Tests .... Skipped[info] Library Projects-aar consumption actionbarsherlock skipped[info] Android ndk-aggregator ....... ........... Skipped[info] Android ndk-native Sample ............... Skipped[info] Android Ndk-java with Native Dependency .... Skipped[info] Android Ndk-java with Native Dependency x86 only Skipped[info] Android ndk-native Static Library ... ......... Skipped[info] Android ndk-native Code including Static Library Skipped[info] Android Ndk-java with Native statically Linked Dependency Skipped[info] Android Ndk-java with Native Library ..... Skipped[info] Android Ndk-java Transient Dependency ..... Skipped[info] Android ndk-java Native Mixed Sample ...... Skipped[info] Android ndk-native apklib Sample ...... ..... Skipped[info] Android Ndk-apklib with Native apklib Dependency Skipped[info] Android Ndk-java with NativeApklib Dependency. Skipped[info] Android Ndk-java Native Mixed with Apklib Dependency Sample Skipped[info] Android support V4 Demos ... .................... Skipped[info] tictactoe-parent ......... ............... Skipped[info] tictactoe-library ......... .............. Skipped[info] Tictactoe-app ......... .................. Skipped[info] Android Maven Plugin samples-aggregator ... Skipped[info]------------------------------------------------------------------------[INFO] BUILD Failure[info]- -----------------------------------------------------------------------[INFO] Total time:01:49 min[info] Finished At:2014-04-29t20:54:10+08:00[info] Final Memory:31m/352m[info]-------------------------------------------------- ----------------------[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2: Android-maven-plugin:3.8.2:internal-integration-test (default-internal-integration-test) on project Morseflash-instrumentation:emUlator-5554_mt680_unknown_sdk:tests failed on device. → [help 1]


Now go to the subproject Helloflashlight directory, run mvn install, the result is the APK file is generated in the targets directory, and then run the command to install to the device:

or use the following command:

MVN Android:deploy

The icon is now visible on the analog device:



After running you can see several different colors of the button, click the button window color can switch.



Ubuntu 14.04 Android using maven one use example engineering

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.