Getting started with AndroidLayoutsGradle for AndroidRecyclerView onClickListenersNavigationViewIntentJSON in Android with org.jsonAndroid StudioResourcesData Binding LibraryExceptionsGetting Calculated View DimensionsAsyncTaskSharedPreferencesEmulatorMaterial DesignLint WarningsServiceStoring Files in Internal & External StorageWebViewProject SDK versionsRecyclerViewGoogle Maps API v2 for AndroidPorterDuff Mode9-Patch ImagesAndroid NDKRecyclerView DecorationsCamera 2 APIViewPagerCardViewHttpURLConnectionSQLiteADB (Android Debug Bridge)ButterKnifeSupporting Screens With Different Resolutions, SizesGlideRetrofit2DialogACRAGreenDAOFormatting StringsNotificationsAlarmManagerFragmentsHandlerCreating Custom ViewsBroadcastReceiverActivitySnackbarRuntime Permissions in API-23 +Logging and using LogcatVectorDrawable and AnimatedVectorDrawableTools AttributesToastInterfacesAnimatorsLocationTheme, Style, AttributeThe Manifest FileParcelableMediaPlayerMultidex and the Dex Method LimitData Synchronization with Sync AdapterMenuInstant Run in Android StudioPicassoBluetooth and Bluetooth LE APIRoboGuiceMemory LeaksUniversal Image LoaderVolleyWidgetsDate and Time PickersIntegrate Google Sign InIn-app BillingFloatingActionButtonContentProviderDagger 2RealmUnit testing in Android with JUnitAndroid VersionsWi-Fi ConnectionsSensorManagerLocalization with resources in AndroidProgressBarCustom FontsVibrationGoogle Awareness APIsText to Speech(TTS)UI LifecycleSpinnerData Encryption/DecryptionTesting UI with EspressoWriting UI tests - AndroidGreenRobot EventBusOkHttpEnhancing Android Performance Using Icon FontsHandling Deep LinksCanvas drawing using SurfaceViewFirebaseCrash Reporting ToolsCheck Internet ConnectivityFacebook SDK for AndroidUnzip File in AndroidAndroid Places APICreating your own libraries for Android applicationsGsonDevice Display MetricsTextViewListViewBuilding Backwards Compatible AppsLoaderProGuard - Obfuscating and Shrinking your codeDetect Shake Event in AndroidTypedef Annotations: @IntDef, @StringDefCapturing ScreenshotsMVP ArchitectureOrientation ChangesXposedSecurityPackageManagerImageViewGesture DetectionDoze ModeAndroid Sound and MediaSearchViewCamera and GalleryCallback URLTwitter APIsDrawablesColorsConstraintLayoutRenderScriptFrescoSwipe to RefreshAutoCompleteTextViewInstalling apps with ADBIntentServiceAdMobImplicit IntentsPublish to Play StoreFirebase Realtime DataBaseImage CompressionEmail ValidationKeyboardButtonTextInputLayoutBottom SheetsCoordinatorLayout and BehaviorsEditTextAndroid Paypal Gateway IntegrationFirebase App IndexingFirebase Crash ReportingDisplaying Google AdsAndroid Vk SdkLocalized Date/Time in AndroidCount Down TimerBarcode and QR code readingOtto Event BusTransitionDrawablePort Mapping using Cling library in AndroidCreating Overlay (always-on-top) WindowsExoPlayerInter-app UI testing with UIAutomatorMediaSessionSpeech to Text ConversionFileProviderPublish .aar file to Apache Archiva with GradleXMPP register login and chat simple exampleAndroid AuthenticatorRecyclerView and LayoutManagersAudioManagerJob SchedulingAccounts and AccountManagerIntegrate OpenCV into Android StudioSplit Screen / Multi-Screen ActivitiesThreadMediaStoreTime UtilsTouch EventsFingerprint API in androidMVVM (Architecture)BottomNavigationViewORMLite in androidYoutube-APITabLayoutRetrofit2 with RxJavaDayNight Theme (AppCompat v23.2 / API 14+)ShortcutManagerLruCacheJenkins CI setup for Android ProjectsZip file in androidVector DrawablesfastlaneDefine step value (increment) for custom RangeSeekBarGetting started with OpenGL ES 2.0+Check Data ConnectionAndroid Java Native Interface (JNI)FileIO with AndroidPerformance OptimizationRobolectricMoshiStrict Mode Policy : A tool to catch the bug in the Compile Time.Internationalization and localization (I18N and L10N)Fast way to setup Retrolambda on an android project.How to use SparseArrayFirebase Cloud MessagingShared Element TransitionsAndroid ThingsVideoViewViewFlipperLibrary Dagger 2: Dependency Injection in ApplicationsFormatting phone numbers with pattern.How to store passwords securelyAndroid Kernel OptimizationPaintAudioTrackWhat is ProGuard? What is use in Android?Create Android Custom ROMsJava on AndroidPagination in RecyclerViewGenymotion for androidHandling touch and motion eventsCreating Splash screenConstraintSetCleverTapPublish a library to Maven Repositoriesadb shellPing ICMPAIDLAndroid programming with KotlinAutosizing TextViewsSign your Android App for ReleaseContextActivity RecognitionSecure SharedPreferencesSecure SharedPreferencesBitmap CacheAndroid-x86 in VirtualBoxJCodecDesign PatternsOkioGoogle signin integration on androidTensorFlowAndroid game developmentNotification Channel Android OBluetooth Low EnergyLeakcanaryAdding a FuseView to an Android ProjectAccessing SQLite databases using the ContentValues classEnhancing Alert DialogsHardware Button Events/Intents (PTT, LWP, etc.)SpannableStringLooperOptimized VideoViewGoogle Drive APIAnimated AlertDialog BoxAnnotation ProcessorSyncAdapter with periodically do sync of dataCreate Singleton Class for Toast MessageFastjsonAndroid Architecture ComponentsJacksonGoogle Play StoreLoading Bitmaps EffectivelyGetting system font names and using the fontsSmartcardConvert vietnamese string to english string Android

Jenkins CI setup for Android Projects

Other topics

Step by step approach to set up Jenkins for Android

This is a step by step guide to set up the automated build process using Jenkins CI for your Android projects. The following steps assume that you have new hardware with just any flavor of Linux installed. It is also taken into account that you might have a remote machine.

PART I: Initial setup on your machine

  1. Log in via ssh to your Ubuntu machine:

    ssh [email protected]

  2. Download a version of the Android SDK on your machine:

    wget https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz

  3. Unzip the downloaded tar file:

    sudo apt-get install tar
    tar -xvf android-sdk_r24.4.1-linux.tgz

  4. Now you need to install Java 8 on your Ubuntu machine, which is a requirement for Android builds on Nougat. Jenkins would require you to install JDK and JRE 7 using the steps below:

    sudo apt-get install python-software-properties
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    apt-get install openjdk-8-jdk

  5. Now install Jenkins on your Ubuntu machine:

    wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
    sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
    sudo apt-get update
    sudo apt-get install jenkins

  6. Download the latest supported Gradle version for your Android setup:

    wget https://services.gradle.org/distributions/gradle-2.14.1-all.zip
    unzip gradle-2.14.1-all.zip

  7. Set up Android on your Ubuntu machine. First move to the tools folder in the Android SDK folder downloaded in step 2:

    cd android-sdk-linux/tools // lists available SDK
    android update sdk --no-ui // Updates SDK version
    android list sdk -a | grep "SDK Build-tools" // lists available build tools
    android update sdk -a -u -t 4 // updates build tools version to one listed as 4 by prev. cmd.
    update java

  8. Install Git or any other VCS on your machine:

    sudo apt-get install git

  9. Now log in to Jenkins using your internet browser. Type ipAddress:8080 into the address bar.

  10. In order to receive the password for the first-time login, please check the corresponding file as follows (you will need su permissions to access this file):

    cat /var/lib/jenkins/secrets/initialAdminPassword

PART II: Set up Jenkins to build Android Jobs

  1. Once logged in, go to the following path:

    Jenkins > Manage Jenkins > Global Tool Configuration

  2. At this location, add JAVA_HOME with the following entries:

    Name = JAVA_HOME
    JAVA_HOME = /usr/lib/jvm/java-8-openjdk-amd64

  3. Also add the following values to Git and save the environment variables:

    Name = Default
    /usr/bin/git

  4. Now go to the following path:

    Jenkins > Manage Jenkins > Configuration

  5. At this location, add ANDROID_HOME to the "global properties":

    Name = ANDROID_HOME
    Value = /home/username/android-sdk-linux

Part III: Create a Jenkins Job for your Android project

  1. Click on New Item in the Jenkins home screen.

  2. Add a Project Name and Description.

  3. In the General tab, select Advanced. Then select Use custom workspace:

    Directory /home/user/Code/ProjectFolder

  4. In the source code management select Git. I am using Bitbucket for the purpose of this example:

    Repository URL = https://username:[email protected]/project/projectname.git

  5. Select additional behaviors for your repository:

    Clean Before Checkout
    Checkout to a sub-directory. Local subdirectory for repo /home/user/Code/ProjectFolder

  6. Select a branch you want to build:

    */master

  7. In the Build tab, select Execute Shell in Add build step.

  8. In the Execute shell, add the following command:

    cd /home/user/Code/ProjectFolder && gradle clean assemble --no-daemon

  9. If you want to run Lint on the project, then add another build step into the Execute shell:

    /home/user/gradle/gradle-2.14.1/bin/gradle lint

Now your system is finally set up to build Android projects using Jenkins. This setup makes your life so much easier for releasing builds to QA and UAT teams.

PS: Since Jenkins is a different user on your Ubuntu machine, you should give it rights to create folders in your workspace by executing the following command:

chown -R jenkins .git

Contributors

Topic Id: 7830

Example Ids: 25493

This site is not affiliated with any of the contributors.