Skip to content

Instantly share code, notes, and snippets.

@AHarazim
AHarazim / DateFormat.java
Created August 8, 2014 07:28
Localised Date in Andorid
public String formatDate(Date date, boolean withTime) {
String result = "";
DateFormat dateFormat;
if (date != null) {
try {
String format = Settings.System.getString(mContext.getContentResolver(), Settings.System.DATE_FORMAT);
if (TextUtils.isEmpty(format)) {
dateFormat = android.text.format.DateFormat.getDateFormat(mContext);
} else {
@AHarazim
AHarazim / gitiignore
Created June 6, 2014 07:16
Git ignore for Eclipse, IntelliJ IDEA and Android Studio
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
@AHarazim
AHarazim / build.gradle
Created May 21, 2014 15:14
get content of folder to json
import groovy.io.FileType
buildscript {
repositories {
mavenCentral()
}
}
task rename(type: Copy) {
from 'in'