Skip to content

Instantly share code, notes, and snippets.

@shivam340
shivam340 / StatusBarColor.java
Created January 28, 2015 12:29
to change color of status Bar in kitkat
package com.healthkart.pillreminder.utils;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.os.Build;
#built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import java.util.HashMap;
import timber.log.Timber;
/**
* Check if the application is in the foreground or background.
* *
* Register this callbacks for an application
@shivam340
shivam340 / genymotionwithplay.txt
Created March 11, 2017 01:25 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@shivam340
shivam340 / README.md
Created November 21, 2018 06:10 — forked from gabrielemariotti/README.md
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
 ----dependencies.gradle
@shivam340
shivam340 / Mission.java
Last active January 11, 2020 09:16
Java Model class For MissionDetails
public class Mission {
private int code;
private String details;
public Mission(int code, String details){
this.code = code;
this.details = details;
}
data class Mission(var code: Int, var details: String)
data class User(val name:String, val age:Int)
val user = User(name="jack", age = 10)
val newUser = user.copy(age = 20)
@shivam340
shivam340 / User.kt
Last active January 11, 2020 10:47
data class User(val name:String){
var age:Int = 0
}
val user1 = User(name = "jack")
user1.age = 10
val user2 = User(name = "jack")
user2.age = 20
println(user1.equals(user2)) // this will return true.