Skip to content

Instantly share code, notes, and snippets.

View AswinpAshok's full-sized avatar

Aswin P Ashok AswinpAshok

  • SANDF Technologies
  • Kozhikkode, Kerala
View GitHub Profile
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
targetSdkVersion 29
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
public void copy(View view) {
File source = new File("storage/emulated/0/test.apk");
File dest = new File("storage/emulated/0/test_copy.apk");
try {
copyFileUsingStream(source, dest);
} catch (IOException e) {
e.printStackTrace();
}
}
public void copy(View view) {
File source = new File("storage/emulated/0/test.apk");
File dest = new File("storage/emulated/0/test_copy.apk");
try {
copyFileUsingStream(source, dest);
} catch (IOException e) {
e.printStackTrace();
}
}
public void copy(View view) {
File source = new File("storage/emulated/0/test.apk");
File dest = new File("storage/emulated/0/test_copy.apk");
try {
copyFileUsingStream(source, dest);
} catch (IOException e) {
e.printStackTrace();
}
}
public class ExtendedEditText extends AppCompatEditText {
String TAG = "ExtendedEditText";
TextPaint textPaint = new TextPaint();
private String suffix = "";
private String prefix = "";
private boolean appendWhiteSpace;
private int hackPadding; /**Used to fix wrong positioning of EditText cursor, when both prefix and suffix are set*/
private int leftPadding, prefixXPosition, stringXPosition, suffixXPosition;
@AswinpAshok
AswinpAshok / FileTreeBuilder.java
Created May 28, 2018 07:10
Build json array of file tree structure.
import android.content.Context;
import android.os.Environment;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
@AswinpAshok
AswinpAshok / Global.java
Created October 23, 2017 05:55
School Management Java Application class
package com.sandftechnologies.schoolmanagementStaff.ModelClasses;
import android.app.Application;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.widget.ArrayAdapter;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.sandftechnologies.schoolmanagementStaff.Activities.ViewStudent;
import com.sandftechnologies.schoolmanagementStaff.DataCache;
@AswinpAshok
AswinpAshok / Global.kt
Created October 23, 2017 05:54
School Management Kotlin application class
package com.sandftechnologies.schoolmanagementStaff.ModelClasses
import android.app.Application
import android.content.Context
import android.content.SharedPreferences
import android.graphics.Typeface
import android.widget.ArrayAdapter
import com.facebook.drawee.backends.pipeline.Fresco
import com.sandftechnologies.schoolmanagementStaff.Activities.ViewStudent
package com.sandftechnologies.schoolmanagementStaff.bottomSheet;
import android.app.Dialog;
import android.support.design.widget.BottomSheetDialogFragment;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
@AswinpAshok
AswinpAshok / AttendanceCircleView.java
Last active September 21, 2017 16:31
custom circle view
package com.sandftechnologies.schoolmanagement.CustomView;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.DisplayMetrics;