Profile

Cover photo
Zan Markan
Works at Marks & Spencer
Attended Faculty of Electrical Engineering and Computer Science, Maribor
Lives in London
409 followers|174,472 views
AboutPosts

Stream

Zan Markan

Shared publicly  - 
 
 
Ladies and Gentlemen, it's time to start your engines and do a git pull on our Android testing samples repository[0]!

We updated all the samples to use Runner/Rules 0.3, Espresso 2.2 and the new @VisibleForTesting annotation from support-annotations[1].

Your shiny new dependency configuration should look like this:

dependencies {
    compile 'com.android.support:support-annotations:22.2.0'
    androidTestCompile 'com.android.support.test:runner:0.3'
    androidTestCompile 'com.android.support.test:rules:0.3'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
}

#happyTesting #androidTesting #androidDev

[0] Android Testing Samples on Github - https://github.com/googlesamples/android-testing
[1] VisibleForTesting Annotation - https://plus.google.com/+StephanLinzner/posts/GBdq6NsRy6S
android-testing - A collection of samples demonstrating different frameworks and techniques for automated testing
10 comments on original post
1
Add a comment...

Zan Markan

Shared publicly  - 
 
Also describes usage of the Nucleus library which is pretty neat
This article is a step-by-step introduction to MVP on Android, from a simplest possible example to best practices.
1
Add a comment...

Zan Markan

Shared publicly  - 
 
Know Your Tools : Terminal and Bash
2
Add a comment...

Zan Markan

Shared publicly  - 
 
 
We just pushed Espresso 2.0 and AndroidJUnitRunner source to AOSP. We are looking forward to all of your contributions!

Initialize your build environment
https://source.android.com/source/initializing.html

Install Repo
https://source.android.com/source/downloading.html

Checkout android-support-test branch
repo init -u https://android.googlesource.com/platform/manifest -g all -b android-support-test

Sync the source
repo sync -j24

Browse the source
cd frameworks/testing

Build and test
// Just build debug build type
./gradlew assembleDebug
// Run tests
./gradlew connectedCheck

Contribute
https://source.android.com/source/life-of-a-patch.html
c851b02 Remove legacy clang prebuilts, and update 3.6 to use appropriate groups. by Stephen Hines - 11 days ago master · 3bf3364 Remove external/apache-qp by Conley Owens - 5 months ago; 8bc0273 Remove external/lzma by Conley Owens - 13 days ago; d5bde6b Revert "Add platform/external/boringssl" ...
5 comments on original post
1
Add a comment...

Zan Markan

Shared publicly  - 
 
A valid question.
 
When you smell caffeine while urinating, should you have:
457 votes  -  votes visible to Public
Less coffee, because that's disturbing
19%
More coffee, because you just lost some
81%
10 comments on original post
1
Add a comment...

Zan Markan

Shared publicly  - 
1
Add a comment...

Zan Markan

Shared publicly  - 
 
 
Android Studio - Migration from maven central to jcenter

Some of the points:
1. jcenter is the new default repository used with Android’s gradle plugin.

2. jcenter is a Java repository in Bintray, which is the largest repo in the world for Java and Android OSS libraries, packages and components.

3. All the content in jcenter is served over a CDN, with a secure https connection. Where as the central maven 2 repository is HTTP only and HTTPS is not supported. (This might be one of the reasons as Google is a fan of HTTPs!).

4. jcenter() is a superset of mavenCentral(), that encompasses many additional repositories and artifacts.

5. The jcenter guys claim, that they have a better performance than maven central.

6. Bintray has a different approach to package identification than the legacy Maven Central.

P.S. Actually part - 10 of the lazy android developer series should be posted but that's a guest post so waiting for the same!

#AndroidDev #JCenter #MavenCentral
View original post
2
Add a comment...
In his circles
232 people
Have him in circles
409 people
Janez Novak's profile photo
David Burulič's profile photo
Morgan Giraud's profile photo
Nic Jackson's profile photo
Simon Banze's profile photo
Mott Marvin Kornicki's profile photo
magdalena dral's profile photo
Marko Part's profile photo
Žiga Mlakar's profile photo

Zan Markan

Shared publicly  - 
1
Add a comment...

Zan Markan

Shared publicly  - 
 
 
If you read the first article about Kotlin for Android, you´ll be glad to know that the second part is available. This time I´m talking about how to configure your project to get ready to work with Kotlin.

I also uploaded a first raw version of a complete app developed with Kotlin. At the moment is very simple, but will keep working on it: 

https://github.com/antoniolg/Bandhook-Kotlin
How to create a new Android project using Kotlin. This article will guide through the configuration needed to start writing your first app using Kotlin.
2 comments on original post
1
Add a comment...

Zan Markan

Shared publicly  - 
 
 
How to attach own implementation instead of Mocks in Android Studio Unit Tests?

Android Studio Unit Testing - great feature! but it has several issues that are not resolved right now. I highlighted them in my previous post. Today I will introduce one of possible approaches that will allow to adjust this feature for real life projects...

I create a small extension to gradle scripts that helps to achieve this. You should do several simple steps:
Step 1:  include into Unit tests own implementation of android class that you want to replace. Package name should be the same as in android Jar.

Preview: http://tinyurl.com/ovlbz3a

Step 2: adjust gradle for including our implementation into tests. Actually I did opposite: I exclude mock class from android jar!

Preview: http://tinyurl.com/nex7qfy

Same in text for copy/paste:

afterEvaluate {
    /* Adjust Mockable Android task  */
    tasks.matching { it.name.startsWith('mockableAndroidJar') }.each { mock ->
        // http://goo.gl/wXhBIF --> MockableJarGenerator.java
        mock.finalizedBy patchMockableAndroidJar
    }

/* Create a copy of original mockable Jar */
task copyMockableAndroidJar(type: Copy) {
    from "${project.buildDir}\\intermediates\\mockable-android-${androidTargetSdkVersion}.jar"
    into "${project.buildDir}\\intermediates\\"

    rename { String fileName ->
        fileName.replace("mockable-android-${androidTargetSdkVersion}.jar",
                "mockable-android-${androidTargetSdkVersion}-original.jar")
    }
}
/* Exclude classes that we want to replace by own implementation  */
task patchMockableAndroidJar(type: Zip, dependsOn: copyMockableAndroidJar) {
    description = 'patch mockable-android-${api}.jar by own classes'
    group = 'Code Quality'

    // set archive name and destination
    destinationDir = file("${project.buildDir}\\intermediates")
    archiveName = "mockable-android-${androidTargetSdkVersion}.jar"
    def source = "${project.buildDir}\\intermediates\\mockable-android-${androidTargetSdkVersion}-original.jar"

    // exclude from Mocks Jar classes which we replace by own implementation
    from(zipTree(source)) {
        exclude '**/android/util/SparseArray.class'
    }
}

Step 3: Customization for own needs.

Important to modify lines by adding more classes to exclude:
exclude '*/android/util/SparseArray.class'* 

Important to keep the same package name for android classes!

Afterwords:
solution has own "dark side" - with it is hard to replace class by Mockable instance that generated in runtime... Another complexity is a requirement to included classes - their implementation may have dependencies on other classes and that can be hard to resolve. 
Solution recommended only for "low level" generic classes.

Tags: #android   #androidstudio   #unittesting   #gradle   #mocks  
9 comments on original post
1
Add a comment...

Zan Markan

Shared publicly  - 
 
 
Samsung what are you doing?

Samsung

Samsung stahp

stahp

STAHP
11 comments on original post
1
Add a comment...
People
In his circles
232 people
Have him in circles
409 people
Janez Novak's profile photo
David Burulič's profile photo
Morgan Giraud's profile photo
Nic Jackson's profile photo
Simon Banze's profile photo
Mott Marvin Kornicki's profile photo
magdalena dral's profile photo
Marko Part's profile photo
Žiga Mlakar's profile photo
Work
Occupation
Space Cowboy
Employment
  • Marks & Spencer
    Software Engineer, 2013 - present
    Android, ActionScript and automation magic.
  • EqualEyes Solutions Limited
    Chief Space Cowboy, 2012 - 2013
  • 2ndSight
    Co-Founder, Devel's Advocate, 2011 - 2012
  • EESTEC LC Maribor
    Chairman, 2010 - 2012
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
London
Previously
Velenje - Maribor
Links
YouTube
Contributor to
Story
Tagline
Hackers gonna hack, Rockets gonna rock.
Introduction
Software engineer @ Marks & Spencer
Doing Android and Actionscript stuff mainly.

Also Chief Space Cowboy @ EqualEyes Solutions Ltd
building the inclusive design smartphone for people with disabilities.

I like tech, space and challenges, old school R&R and burning rubber. 



Bragging rights
I live on the internets and feed on information
Education
  • Faculty of Electrical Engineering and Computer Science, Maribor
    CS (MS), 2012
  • Faculty of Electrical Engineering and Computer Science, Maribor
    ICT (BS), 2007 - 2010
Basic Information
Gender
Male
Apps with Google+ Sign-in
  • 2048