Skip to content

Instantly share code, notes, and snippets.

View shaon2016's full-sized avatar

Ashiqul Islam Shaon shaon2016

View GitHub Profile
private void doPay() {
int rand = new Random().nextInt();
/*Mandatory Field*/
MandatoryFieldModel mandatoryFieldModel = new MandatoryFieldModel("", "", "200",
"trans_" + rand, CurrencyType.BDT, SdkType.TESTBOX, SdkCategory.BANK_LIST);
/*Call for the payment*/
PayUsingSSLCommerz.getInstance().setData(this, mandatoryFieldModel, new OnPaymentResultListener() {
@novodimaporo
novodimaporo / NV21Utils.cpp
Last active June 11, 2021 09:12
NV21 Utils
void convertNV21ToArray2d(JNIEnv* env, dlib::array2d<dlib::rgb_pixel>& out,
jbyteArray data, jint width, jint height) {
jbyte* yuv = env->GetByteArrayElements(data, 0);
int frameSize = width * height;
int y, u, v, uvIndex;
int r, g, b;
out.set_size((long) height, (long) width);
for(int row = 0; row < height; row++) {
@anggadarkprince
anggadarkprince / AppHelper.java
Last active May 2, 2023 22:39
Upload file with Multipart Request Volley Android
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import java.io.ByteArrayOutputStream;
/**
* Sketch Project Studio
* Created by Angga on 12/04/2016 14.27.
*/
public class AppHelper {
@romainpiel
romainpiel / MyTest.java
Last active August 13, 2019 08:31
Source for https://medium.com/p/3f6f4179652e - "RecyclerView and espresso, a complicated story"
RecyclerViewInteraction.<Item>onRecyclerView(withId(R.id.recyclerview))
.withItems(items)
.check(new ItemViewAssertion<Item>() {
@Override
public void check(Item item, View view, NoMatchingViewException e) {
matches(hasDescendant(withText(item.getDisplayName())))
.check(view, e);
}
});
@broady
broady / 1MarkerAnimation.java
Last active March 13, 2024 12:44
Animating Markers
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;
@granoeste
granoeste / EachDirectoryPath.md
Last active April 4, 2024 22:32
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories