This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name?.let{ println(it) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (name != null) { | |
System.out.println(name) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Person (val id : String, val name : String, val surName : String, | |
val address : String, val zipCode : Int, val phone : Int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person { | |
private String id; | |
private String name; | |
private String surName; | |
private String address; | |
private int zipCode; | |
private int phone; | |
public Person(String id, String name, String surName, String address, int zipCode, int phone) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read only variables, assign just once | |
val name : String = "develodroid" | |
val name2 = "develodroid" // Type inference | |
val name3 : String // Type is required when no initialization | |
name4 = "develodroid" // | |
// Mutable variables | |
var name5 : String = "develodroid" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
println("Hello World!") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class App { | |
public static void main(String[] args) { | |
System.out.println("Hello World!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.develodroid.kotlinsample | |
import android.os.Bundle | |
import android.support.design.widget.FloatingActionButton | |
import android.support.design.widget.Snackbar | |
import android.support.v7.app.AppCompatActivity | |
import android.support.v7.widget.Toolbar | |
import android.view.View | |
import android.view.Menu | |
import android.view.MenuItem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23.0.3" | |
defaultConfig { | |
applicationId "com.develodroid.kotlinsample" | |
minSdkVersion 21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//In order to extract a peer certificate: | |
File certificate = new File(certificateUri); | |
String peerCertificate = PeerCertificateExtractor.extract(certificate); | |
//Retrieved peer certificates format: | |
sha256/u4QJrwx7aSejc080BBQKGyTaoJovFBg4SbQ9nhoohb8= | |
//Enabling okhttp certificate pinning is now made the following way: |
NewerOlder