! Usage examples for Android Maven Plugin

Overview

Android Maven Plugin - Sample Projects

WARNING

This project is deprecated. All sample projects for the Android Maven Plugin as of version 4.0.0-rc.1 are part of the actual plugin codebase and run as integration tests. They can be found in the src/it/projects folder at https://github.com/simpligility/android-maven-plugin.

The following content is mostly historical information and reference:

Introduction

This project includes a whole number of example projects that use the Android Maven Plugin available at http://simpligility.github.io/android-maven-plugin/.

It serves as samples for users as well as a test cases for the ongoing development of the plugin.

Documentation can be found there as well as in README files in the folders of the different examples.

To run all projects you will need the support library and other libraries from the SDK deployed to your Maven repository. Use the Maven Android SDK Deployer to do that.

Versioning and Downloads

The 'master' branch of this project always uses the latest development version of the Android Maven Plugin and as such is always x.y.z-SNAPSHOT.

The 'stable' branch uses the latest relase of the plugin that has been pushed to the Central Repository.

There are also branches for specific versions of the Android Maven Plugin with the branch naming equal to the version of the plugin.

You can just download the project as usual from github with

git clone https://github.com/jayway/maven-android-plugin-samples.git

Alternatively downloading of a zip file of a specific branch can be done via specific URL e.g.

List of Projects/Modules

There are a number of sub modules in this project. Here is the description for the top level ones. Details about each one is in the folder for the individual project.

apidemos-android-16

the Android SDK API demo application suite for Android 16

helloflashlight

a simple example application

libraryprojects

a number of libraries in aar and apklib format being created and used in application examples

morseflash

a simple example application with some external Java code from a library being used and an instrumentation test project

native

a number of example libraries and applications using the Android NDK

scala

an example application written in Scala

support4demos

example applications using the support library

tictactoe

an example application from the gradle samples project from the Android SDK team converted to a Maven based build

Comments
  • Morse flash UI Automator tests added.

    Morse flash UI Automator tests added.

    Hi Manfred,

    I have added a simple morse flash test class using UI Automator and the new UI Automator goal.

    It works, but still, uiautomator.jar should be deployed to maven central.

    opened by stephanenicolas 11
  • Supportandten

    Supportandten

    • added support demo for v4 compatibility library
    • updated apidemos to android 10 supplied demos
    • a bunch of little name changes for the modules

    You will need to install the android jar files with the Maven Android SDK Deployer to get the compatibility libraries and 4.0 android into your maven repo for this to work. I tested this and the complete build is working with a 2.3.3 emulator.

    I will add some readme once you got it green on jenkins..

    manfred

    opened by mosabua 6
  • Issue 438 - adding Aar dep classes to compile classpath

    Issue 438 - adding Aar dep classes to compile classpath

    NB the plugin is NOT WORKING as of this commit.

    This commit introduces the AarMavenLifecycleParticipant which is invoked after the project is read but before any Mojos have been executed. It has been suggested by Igor that this is where we need to add the dependent Aar lib classes to the compile classpath. That means we need to extract the libs here and THEN add the Aar classes to the compile classpath. IMHO this is also where we should be adding any apklib sources to the compileSourceRoot too. NB the AarMavenLifecycleParticipant actually works and successfully extracts the libs, nut doesn't add the classes to the compile classpath.

    Also introduces the AarMavenLifecycleParticipantPlayground which is a testing ground for altering the compile classpath. It is currently failing because it is not being successfully injected with the

    This commit also includes BuildHelper which does all the heavy lifting of extracting the libs into target\unpacked-libs. It was a necessary addition because we need this func in the MavenLifecycleParticipant, and this functionality was originally in ConsumeAarMojo and AbstractAndroidMojo. They both now delegate to the BuildHelper.

    Final class is MavenDependencyInjector which is just a copy from Tycho of a class that Igor suggested should how to inject classes into the compile classpath. I have left it there as reference. It should be deleted before release.

    What needs to be done is to get AarMavenLifecycleParticipantPlayground to alter the compile classpath. Once that is proven we should push that into the AarMavenLifecycleParticipant and remove AarMavenLifecycleParticipantPlayground. At that point ConsumeAarMojo becomes redundant.

    I have also updated the libraryproject samples to provide good coverage across all the use cases we want to support.

    opened by william-ferguson-au 5
  • A bunch of cheanges

    A bunch of cheanges

    Hi Hugo,

    Here are a whole bunch of changes that should make the different samples stand more on their own and make things easier to rip out for users and understand.

    There is also more documentation and a bunch of clean up things in there.

    I am not sure if the current setup works for the release process. Could you have a look or let me know how to test that myself? I will use the examples from my clone for my presentation next week in Toronto at AndroidTO but ultimately I think this sort of approach should make it into the next release.

    Let me know if you want me to change anything...

    manfred

    opened by mosabua 5
  • simple aar sample

    simple aar sample

    Small sample of aar. Unfortunately it doesn't work correctly :(

    If

    <type>aar</type>
    

    is changed for

    <type>apklib</type>
    

    it works.

    opened by Macarse 4
  • Updates for fixes to support multiple architectures

    Updates for fixes to support multiple architectures

    Adds the necessary architectures to also allow build for multiple architectures.

    APKLIB support is still sketchy and currenly only supports a single architecture.

    opened by nahojkap 4
  • Example integration test that takes device screenshots as it goes along

    Example integration test that takes device screenshots as it goes along

    Small example showing how to do the screenshot stuff. There are some bug fixes in pull request 105 on the android-maven-plugin that will make this example run much better, so it's worth merging that before running this!

    https://github.com/rtyley/android-screenshot-lib#readme

    opened by rtyley 3
  • updated dependency version to new revisions as distributed with sdk 16

    updated dependency version to new revisions as distributed with sdk 16

    Before you pull this in you have to update the dependencies available on jenkins with the maven android sdk deployer.. pull in whenever convenient and you got that done..

    opened by mosabua 3
  • Removing PluginManagement for AMP in parent POM

    Removing PluginManagement for AMP in parent POM

    It has zero effect as all child POMs do not inherit and explicitly define the AMP version. And having it there is confusing as you expect changing it to have some effect.

    opened by william-ferguson-au 2
  • updated layout of library project app and all resources that are pulled ...

    updated layout of library project app and all resources that are pulled ...

    ...in and updated the test accordingly, activated test even though it currently fails, this will serve as discussion base in the pull request and the mailing list

    The app now looks like this screenshot in my Nexus 5.

    device-2014-02-11-002627

    Currently this fails so we need to figure out how to get instrumentation tests with Robotium to work again. Here is command line output I get

    [INFO] [INFO] --- android-maven-plugin:3.8.3-SNAPSHOT:internal-integration-test (default-internal-integration-test) @ libraryprojects-tests --- [INFO] android.devices parameter not set, using all attached devices [INFO] Device 03dd80410939aa47_LGE_Nexus5 found. [INFO] 03dd80410939aa47_LGE_Nexus5 : Running instrumentation tests in com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.tests [INFO] 03dd80410939aa47_LGE_Nexus5 : Run started: com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.tests, 1 tests: [INFO] 03dd80410939aa47_LGE_Nexus5 : Start [1/1]: android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed [INFO] 03dd80410939aa47_LGE_Nexus5 : ERROR:android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed [INFO] 03dd80410939aa47_LGE_Nexus5 : java.lang.RuntimeException: Exception during suite construction at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:238) at java.lang.reflect.Method.invokeNative(Native Method) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.test.suitebuilder.TestMethod.instantiateTest(TestMethod.java:87) at android.test.suitebuilder.TestMethod.createTest(TestMethod.java:73) at android.test.suitebuilder.TestSuiteBuilder.addTest(TestSuiteBuilder.java:262) at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:184) at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:379) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4335) at android.app.ActivityThread.access$1500(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NoClassDefFoundError: com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivity at com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivityTest.(MainActivityTest.java:16) ... 18 more

    [INFO] 03dd80410939aa47_LGE_Nexus5 : End [1/1]: android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed [INFO] 03dd80410939aa47_LGE_Nexus5 : Run ended: 11 ms [ERROR] 03dd80410939aa47_LGE_Nexus5 : FAILURES!!! [INFO] Tests run: 1, Failures: 0, Errors: 1 [INFO] 03dd80410939aa47_LGE_Nexus5 : Report file written to /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/libraryprojects/libraryprojects-tests/target/surefire-reports/TEST-03dd80410939aa47_LGE_Nexus5.xml

    opened by mosabua 2
  • Improvements and fixes for APKLib support with Native code

    Improvements and fixes for APKLib support with Native code

    This pull request adds sample projects to the native directory to demonstrate working with apklibs containing native libraries.

    This goes along with my recent pull request to maven-android-plugin of the same title.

    opened by andi12 2
Owner
Jayway
Jayway
Examples for my Android GraphView library

Chart and Graph Library for Android GraphView - open source graph plotting library for Android GraphView is a library for Android to programmatically

Jonas Gehring 297 Dec 16, 2022
A sample Android app which showcases advanced usage of Dagger among other open source libraries.

U+2020 A sample Android app which showcases advanced usage of Dagger among other open source libraries. Watch the corresponding talk or view the slide

Jake Wharton 5.7k Dec 22, 2022
Open-source telematics app for Android. The application is suitable for UBI (Usage-based insurance), shared mobility, transportation, safe driving, tracking, family trackers, drive-coach, and other driving mobile applications

TelematicsApp-Android with Firebase© integration Description This Telematics App is created by DATA MOTION PTE. LTD. and is distributed free of charge

Damoov 21 Dec 12, 2022
🔥 Android MVP with Volley usage simple registration App 🔥

?? Android MVP with Volley usage simple registration App ?? This is a MVP architecture app that uses volley .Project is made using Android Studio. Vol

ABHISHEK KUMAR PATHAK 3 Aug 7, 2022
Quality-Tools-for-Android 7.5 0.0 L5 Java This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android platform.

Quality Tools for Android This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android pl

Stéphane Nicolas 1.3k Dec 27, 2022
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

Mike Penz 1.8k Nov 10, 2022
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

Mike Penz 1.8k Nov 10, 2022
simple android grocery app using kotlin and android studio

Project Idea The idea of this project is to make a grocery android app that users can use to order the groceries they want. It doesn't contain any bac

null 0 Nov 29, 2021
Beetlebug is an open source insecure Android application with CTF challenges built for Android Penetration Testers and Bug Bounty hunters.

Beetlebug Beetlebug is a beginner-friendly Capture the Flag Android application that aims to inspire interest in Mobile Application Security. It is ge

Hafiz Abdulaziz 60 Oct 11, 2022
Do's and Don'ts for Android development, by Futurice developers

Best practices in Android development Avoid reinventing the wheel by following these guidelines. Lessons learned from Android developers in Futurice.

Futurice 20.2k Dec 31, 2022
Learning RxJava for Android by example

Learning RxJava for Android by example This is a repository with real-world useful examples of using RxJava with Android. It usually will be in a cons

Kaushik Gopal 7.6k Dec 30, 2022
Proguard configurations for common Android libraries

android-proguard-snippets Example Proguard configurations for common Android libraries. This project assumes that your ProGuard configuration is based

Kevin Schultz 4.6k Dec 18, 2022
A simple chat demo for socket.io and Android

socket.io-android-chat This is a simple chat demo for socket.io and Android. You can connect to https://socket-io-chat.now.sh using this app. Installa

Naoyuki Kanezawa 1.9k Dec 30, 2022
Google Play game services - Android samples

Google Play game services - Android Samples Copyright (C) 2014 Google Inc. Contents These are the Android samples for Google Play game services. Colle

Google Play Game Services 952 Dec 27, 2022
Android common lib demo, include ImageCache, HttpCache, DropDownListView, DownloadManager, install apk silent and so on, you can find description

android-demo 关于我,欢迎关注 微博:Trinea 主页:trinea.cn 邮箱:trinea.cn#gmail.com 微信:codek2 依赖:trinea-android-common android-auto-scroll-view-pager viewpager-indica

Trinea 1.1k Nov 10, 2022
Cheat Sheet for Android Interviews

Android-Cheat-sheet Cheat Sheet for Android Interviews Topics Common Coding Programs Data Structure Coding Programs Android Interview Questions Java I

Anitaa Murthy 2k Dec 31, 2022
RxJava architecture library for Android

Reference Architecture for Android using RxJava This is an ambitious reference project of what can be done with RxJava to create an app based on strea

Reark 2.1k Dec 17, 2022
📚 Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.

Android Components Architecture in a Modular Word Android Components Architecture in a Modular Word is a sample project that presents modern, 2020 app

Madalin Valceleanu 2.3k Dec 30, 2022