Apply the main stream ratio 16:9, here are the screen sizes:
- mdpi: ~160dpi, 640 x 360 px
- hdpi: ~240dpi, 960 x 540 px
- xhdpi: ~320dpi, 1280 x 720 px
- xxhdpi: ~higher, 1920 x 1080 px
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.
#Control Structures
##If statement
Kotlin if statement should look familiar with other language
fun main(args : Array<String>) {
val total = 10
<?php | |
require 'tmhOAuth.php'; // Get it from: https://github.com/themattharris/tmhOAuth | |
// Use the data from http://dev.twitter.com/apps to fill out this info | |
// notice the slight name difference in the last two items) | |
$connection = new tmhOAuth(array( | |
'consumer_key' => '', | |
'consumer_secret' => '', | |
'user_token' => '', //access token |
https://twitter.com/YOUR_USER_NAME/following
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
var INCR = 16; // Number of messages per page | |
var SENT_URL = '//www.linkedin.com/inbox/invitations/sent?startRow='; | |
var loMessageLinks = []; // Main array for all contacts | |
var fetchMessages = function(i, cb) { | |
console.log('Fetching message page #' + (i+1)); | |
$.get(SENT_URL + (i*INCR), function(data){ | |
var $dom = $(data); | |
public class MainActivity extends | |
private PopupWindow popWindow; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
} |
mpg | cyl | disp | hp | drat | wt | qsec | vs | am | gear | carb | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Mazda RX4 | 21 | 6 | 160 | 110 | 3.9 | 2.62 | 16.46 | 0 | 1 | 4 | 4 | |
Mazda RX4 Wag | 21 | 6 | 160 | 110 | 3.9 | 2.875 | 17.02 | 0 | 1 | 4 | 4 | |
Datsun 710 | 22.8 | 4 | 108 | 93 | 3.85 | 2.32 | 18.61 | 1 | 1 | 4 | 1 | |
Hornet 4 Drive | 21.4 | 6 | 258 | 110 | 3.08 | 3.215 | 19.44 | 1 | 0 | 3 | 1 | |
Hornet Sportabout | 18.7 | 8 | 360 | 175 | 3.15 | 3.44 | 17.02 | 0 | 0 | 3 | 2 | |
Valiant | 18.1 | 6 | 225 | 105 | 2.76 | 3.46 | 20.22 | 1 | 0 | 3 | 1 | |
Duster 360 | 14.3 | 8 | 360 | 245 | 3.21 | 3.57 | 15.84 | 0 | 0 | 3 | 4 | |
Merc 240D | 24.4 | 4 | 146.7 | 62 | 3.69 | 3.19 | 20 | 1 | 0 | 4 | 2 | |
Merc 230 | 22.8 | 4 | 140.8 | 95 | 3.92 | 3.15 | 22.9 | 1 | 0 | 4 | 2 |
/******This Gist explains how to create instagram like Gradient color transition in android.******/ | |
1. Create some gradient color drawables inside drawable Folder. | |
a) color1.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
<gradient | |
android:startColor="#c44e4e" | |
android:endColor="#dcb9b9" | |
android:angle="0"/> |