Skip to content

Instantly share code, notes, and snippets.

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

Fida Muntaseer fida1989

๐Ÿ˜€
Hello World!
View GitHub Profile
@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;
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 / 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
@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 / 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 / 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
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 / 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
@fida1989
fida1989 / australian-postcodes.sql
Created March 18, 2019 19:39 — forked from randomecho/australian-postcodes.sql
Australian postcodes (with states and suburb names) geocoded with latitude and longitude.
/*
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod
May contain errors where latitude and longitude are off. Use at own non-validated risk.
*/
SET NAMES utf8;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS postcodes_geo;
@fida1989
fida1989 / MapsActivity.kt
Last active March 31, 2019 06:56
MapsActivity
import android.Manifest
import android.annotation.SuppressLint
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.pm.PackageManager
import android.location.Location
import android.os.Bundle
import android.os.Handler