Skip to content

Instantly share code, notes, and snippets.

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

Fida Muntaseer fida1989

๐Ÿ˜€
Hello World!
  • Dhaka, Bangladesh
  • 21:45 (UTC +06:00)
  • X @fida1989
View GitHub Profile
@fida1989
fida1989 / MainActivity.java
Last active November 21, 2017 16:28
Reading text file from sdcard
package com.hungrydroid.textread;
import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder
.setMessage("Are you sure?")
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
// Yes-code
}
})
@fida1989
fida1989 / colors.xml
Last active November 3, 2017 10:19
Android color resource xml.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="White">#ffffff</color>
<color name="Ivory">#fffff0</color>
<color name="LightYellow">#ffffe0</color>
<color name="Yellow">#ffff00</color>
<color name="Snow">#fffafa</color>
<color name="FloralWhite">#fffaf0</color>
<color name="LemonChiffon">#fffacd</color>
<color name="Cornsilk">#fff8dc</color>
@fida1989
fida1989 / README
Created August 10, 2017 13:32 — forked from MarsVard/README
android drawable to imitate google cards.
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file.
set the background of a view to card,
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view
``` xml
<View
android:layout_width="fill_parent"
package com.emil.android.util;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* Check device's network connectivity and speed
* @author emil http://stackoverflow.com/users/220710/emil
public class MyFragment {
boolean loaded;
private void maybeLoad() {
if (!loaded && getUserVisibleHint()) {
loaded = true;
loadMyData();
}
}
@Override
public class AnimatedActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//opening transition animations
overridePendingTransition(R.anim.activity_open_translate,R.anim.activity_close_scale);
}
package com.discoverbangladesh.utils;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import android.content.Context;
import android.database.Cursor;