My first experiences with Kotlin: some quick notes that might comes handy for beginners

Standard

Checkout my Article about “My first experiences with Kotlin some quick notes that might comes handy for beginners” @ medium.com:

My first experiences with Kotlin

How to fix “Android N requires the IDE to be running with Java 1.8 or later” on Mac?

Standard

I get this error while I was in layout editor selecting api N for preview, It was so easy to fix,

  1. install jdk1.8
  2. Set “JDK_HOME” and “JAVA_HOME” environment variables.
  3. Edit the file “/Applications/Android Studio.app/Contents/Info.plist"
  4. Look for “JVMVersion”
  5. add “1.8*,1.8+” to it:
...
<key>JVMVersion</key>
<string>1.8*,1.8+</string>
...

Now restart your “Android Studio”

How to setup CircleCI environment JAVA7_HOME, JAVA6_HOME for RetroLambda

Standard

Using retrolambda in Android application being built using circleci as continuous integration cause some issues:

> Building 10%When running gradle with java 8, you must set the path to the old jdk, either with property retrolambda.oldJdk or environment variable JAVA5_HOME/JAVA6_HOME/JAVA7_HOME

The problem is you have to configure environment variables for Java_Home, Java7_Home, Java6_Home and etc in circleci virtual machine.

this circle.yml file could help you in this regard:

#
# Build configuration for Circle CI
#

general:
    artifacts:
        - /home/ubuntu/weather_app/app/build/outputs/apk/
        - /usr/lib/jvm/

machine:
    environment:
        ANDROID_HOME: /usr/local/android-sdk-linux
        JAVA6_HOME: /usr/lib/jvm/java-6-openjdk-amd64

    java:
      version: openjdk8

dependencies:
    override:
        - echo y | sudo apt-get update
        - echo y | sudo apt-get install libpango-1.0-0
        - echo y | sudo apt-get install openjdk-6-jre

        - echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.3,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-support
        - ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies

test:
    override:
        - (./gradlew assemble):
            timeout: 360

        - (./gradlew test):
            timeout: 360

HackerRank Challenges solved using Java on GitHub

Standard

The true test of problem solving: when one realizes that time and memory aren’t infinite.

http://hackerrank.com/

 

My answers available using Java on GitHub:

https://github.com/mirhoseini/hacker_rank

Spoil Danger!!! :roll:

Where can I find the best reference to learn Design Patterns in Java?

Standard

Design Patterns in Java Tutorial Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development. These solutions were obtained by trial and error by numerous software developers over quite a substantial period of time. This tutorial will take you through step by step approach and examples using Java while learning Design Pattern concepts.

Prerequisites Before you start proceeding with this tutorial, I’m making an assumption that you are already aware about basic java programming concepts. If you are not well aware of these concepts then I will suggest to go through our short tutorial on Java Programming.

Reference:
Design Patterns Tutorial in PDF