Skip to content

Instantly share code, notes, and snippets.

View fida1989's full-sized avatar
๐Ÿ˜€
Hello World!

Fida Muntaseer fida1989

๐Ÿ˜€
Hello World!
  • Dhaka, Bangladesh
  • 15:14 (UTC +06:00)
  • X @fida1989
View GitHub Profile
@fida1989
fida1989 / DemoApplication.kt
Created February 7, 2019 10:52
Spring Boot Demo Application
package com.example.demo
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.web.bind.annotation.*
@SpringBootApplication
@RestController
class DemoApplication
public class MyLocationService extends Service {
private static final String TAG = "MyLocationService";
private LocationManager mLocationManager = null;
private static final int LOCATION_INTERVAL = 1000;
private static final float LOCATION_DISTANCE = 10f;
private class LocationListener implements android.location.LocationListener {
Location mLastLocation;
public LocationListener(String provider) {
@fida1989
fida1989 / KotlinAndroidMainApplication
Created November 8, 2018 08:24 — forked from paraya3636/KotlinAndroidMainApplication
Kotlin Android MainApplication class for global applicationContext.
// Not object class. AndroidManifest.xml error happen.
class MainApplication : Application() {
init {
instance = this
}
companion object {
private var instance: MainApplication? = null
@fida1989
fida1989 / PhonecallReceiver.java
Created September 26, 2018 09:22 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@fida1989
fida1989 / ActivityEventListener.md
Created July 31, 2018 04:56 — forked from blackcj/ActivityEventListener.md
Demonstrates how to call a function in the parent Activity from within a Fragment.

Step 1: Add any functions you want to call into the interface (EventListener).

Step 2: Implement those functions in your MainActivity.

Step 3: Create the listener in your Fragment and attach it to the Activity.

Step 4: Call any functions on the listener.

@fida1989
fida1989 / post.md
Created June 5, 2018 05:54 — forked from grantland/post.md
RecyclerView item onClick

RecyclerView item onClick

RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.

Set an OnClickListener in your ViewHolder creation:

private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>  {

    public static class ViewHolder extends RecyclerView.ViewHolder
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() {
@fida1989
fida1989 / MainActivity.java
Created February 4, 2018 08:38 — forked from mksantoki/MainActivity.java
FileChooser in Android webview
/*
reference link ->https://www.opengeeks.me/2015/08/filechooser-and-android-webview/
https://github.com/OpenGeeksMe/Android-File-Chooser
*/
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
@fida1989
fida1989 / shadow.xml
Created January 14, 2018 06:10 — forked from lecho/shadow.xml
Android shadow drawable xml.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Drop Shadow Stack -->
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
public String getCardPath() {
String removableStoragePath = "";
File fileList[] = new File("/storage/").listFiles();
for (File file : fileList) {
if (!file.getAbsolutePath().equalsIgnoreCase(Environment.getExternalStorageDirectory().getAbsolutePath()) && file.isDirectory() && file.canRead()) {
removableStoragePath = file.getAbsolutePath();
}
}
return removableStoragePath;