Skip to content

Instantly share code, notes, and snippets.

View milaptank's full-sized avatar
💭
a lazy android developer

milap tank milaptank

💭
a lazy android developer
View GitHub Profile
package com.core.storage;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteStatement;
import java.io.BufferedReader;
import java.io.IOException;
package com.core.storage;
import android.database.sqlite.SQLiteDatabase;
public abstract class DatabaseConfig {
/**
* Override this method and execute the table creation
* queries using <CODE>DatabaseHelper.executeSQL()</CODE> method.
*
@milaptank
milaptank / gist:778c4fe36ef994bd646ac34be6f4392e
Created November 24, 2017 05:26
GIT add new repo command
Command line instructions
Git global setup
git config --global user.name "Milap Tank"
git config --global user.email "android@webmobtech.com"
Create a new repository
git clone https://gitlab.com/WebMobTechnologies/TCC_2016_Android.git
cd TCC_2016_Android
@milaptank
milaptank / User.java
Created February 27, 2017 10:32
with builder pattern
package com.webmobtech.android.instascraper.util;
public class User {
private String user_id;
private String username;
private String fullname;
private String workplace;
private String p_re_ward;
private String p_re_district;
private String p_re_province;
package com.mpt.android.multitextwatcher;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
public class MultiTextWatcher implements TextWatcher {
private OnTextWatcher onTextWatcher;
private EditText editText;
class Test
{
static int x = 100; // line 3
int y = 200; // line 4
public static void main(String []args)
{
final int z; // line 7
z = x + y; // line 8
System.out.println(z);
@milaptank
milaptank / AbstractRecyclerAdapter.java
Created August 11, 2016 16:43 — forked from iChintanSoni/BaseRecyclerAdapter.java
This implementation of generic recycler adapter is truely inspired from Firebase Database UI Adapter.
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
package api;
import android.os.Handler;
import android.os.Looper;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
@milaptank
milaptank / CursorRecyclerAdapter.java
Created June 10, 2016 09:03 — forked from quanturium/CursorRecyclerAdapter.java
A simple implementation of CursorAdapter for the new RecyclerView. It is designed to work with CursorLoaders and do not register any content observer (which can cause leaks if not handled properly)
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 ARNAUD FRUGIER
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@milaptank
milaptank / 0_reuse_code.js
Created April 27, 2016 10:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console