Tuesday, February 23, 2016

info Android Continous Integration

Continuous Integration 
Goal is that every time you commit your code, your code automatically goes thru some Junit testing (iOS/Android) and also builds the apps (ipa/apk). CI helps improves the quality of the app. Ideally is nice to have one system when you can kick a build and also run your unit and integration tests. CI is key to have a great app :)

Good read: Tools used by other companies:
Android Jenkins aws 
Read to learn about CI Jenkins vs. Circle CI vs Travis

 


------------------------------------------------------------------------------------------------------------
My Opinion:
Most enterprise companies use Jenkins. For small companies I would suggest CircleCI($) or Travis($$$).

------------------------------------------------------------------------------------------------------------
Jenkins:

What is Jenkins? 

Jenkins Plugin info (BUILD_NUMBER..)
Jenkins is an open source continuous integration tool which aims to automate certain tasks that developers find themselves repeating. It runs as a local server on a host machine
Tutorial by codepath
Setup:
1. Create Jenkins account.
2. Configure Jenkins:
Install Plugins: Manage Jenkins -> Manage Plugins -> Available
  • Gradle Plugin (build system)
  • Git Plugin (use git to link to your projects repos)
  • Android Emulator
  • AWS device farm (test apps with real devices using AWS Device farm)
  • HockeyApp (distribute apps)
  • Android lint plugin - Lint is a great tool created by Google to analyze the code for Android. It comes with the SDK of Android and it is useful to have good quality code.
3. Configure Git repo, ssh key.
4. Create new job to generate APK.

Enterprise Notes:
1. Create Jenkins account.
2. Install Android SDK in jenkins machine(node) 
3. Install Plugins.
4. Configure Git Enterprise repo(master).
5. Test run to generate apk.

Tips 
Jacoco Reporting

------------------------------------------------------------------------------------------------------------
Circleci uses the build file: circle.yml, you need to create and add this file to your project root.
Circleci builds apk and runs Espresso UI test(click button change text).
GitHub Project
Circleci Dashboard
Reference
Circleci iOS



------------------------------------------------------------------------------------------------------------
Travis uses the build file: travis.yml , you need to create and add this file to your project root.  Can be setup to run both unit and integration tests. Working example follow below step: CodePath Tutorial
GitHub Project
Good read
Travis Enterprise
Travis iOS 
Travis upload apk to Testflight


 



------------------------------------------------------------------------------------------------------------
Online Examples:

Android example:
https://www.bignerdranch.com/blog/continuous-delivery-for-android/

iOS example:
Build and deploy to HockeyApp
Travis iOS very example




------------------------------------------------------------------------------------------------------------
Other Resources:

CI slides-
http://www.slideshare.net/sergiizhuk/slides-v6-41909668
http://www.slideshare.net/tomoakiimai2/tips-for-better-ci-on-android?related=1

CI paper - 
https://saucelabs.com/resources/white-papers/why_ci_should_be_part_of_your_mobile_dev_process-a_sauce_labs_report.pdf/@@download/file

Gradlew-
https://guides.codepath.com/android/Getting-Started-with-Gradle
http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Tasks

Monday, February 1, 2016

info Android Material

Good read about Material Design

Components:
snackbar

Drawables tutorial

info Android Testing (and iOS)

Mobile Testing background

 ------------------------------------------------------------------------------------------------------------


Android
Robolectric for unit testing,
Espresso for UI testing,



iOS
Xcode XCTest

 ------------------------------------------------------------------------------------------------------------

Robolectric:
Very Good Tutorial
http://robolectric.blogspot.com/2010/12/testing-startactivityforresult-and.html
http://turhanoz.com/unit-test-android-starting-an-activity/
https://github.com/codepath/android_guides/wiki/Unit-Testing-with-Robolectric

-----------------
Appium:
Appium(python) and AWS Device Farm - Cloud testing
http://docs.aws.amazon.com/devicefarm/latest/developerguide/getting-started.html
iOS Video Example (*very good tutorial*)
 https://www.youtube.com/watch?v=CLeb1wjctuU
Getting started: http://docs.aws.amazon.com/devicefarm/latest/developerguide/getting-started.html 

----------------------
XCTest

 ----------------------
Espresso

Espresso vs Robotium



----------------------


Follow this tutorial: https://codelabs.developers.google.com/codelabs/android-testing/index.html?index=..%2F..%2Fandroid-dev-summit&viewga=UA-69243313-1#5

Testing Fundamentals:
http://developer.android.com/tools/testing/testing_android.html

Slides:
http://www.slideshare.net/dtmilano/introduction-to-android-testing?related=1

CodePath testing guide 


------------------------------------------------------------------------------------------------------------




------------------------------------------------------------------------------------------------------------
Resources:
 https://developer.android.com/tools/testing-support-library/index.html#AndroidJUnitRunner
https://google.github.io/android-testing-support-library/
https://codelabs.developers.google.com/codelabs/android-testing/#0