Skip to content

Instantly share code, notes, and snippets.

View shihabmi7's full-sized avatar
🎯
Focusing

Muhammad Shihab Uddin shihabmi7

🎯
Focusing
  • Accord Innovations
  • Malaysia
  • 10:39 (UTC +08:00)
View GitHub Profile
@shihabmi7
shihabmi7 / get-the-sha1-fingerprint-certificate
Last active June 23, 2016 04:47
Map Keystore : get-the-sha1-fingerprint-certificate
# Step 1: Go to your java bin directory via the cmd:
C:\Program Files\Java\jdk1.7.0_71\bin>
# Step 2: Now type in the below command in your cmd:
keytool -list -v -keystore c:\users\your_user_name.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
example:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
@shihabmi7
shihabmi7 / AlertDialog
Last active December 15, 2016 10:10 — forked from emil2k/Connectivity.java
Android utility class for checking device's network connectivity and speed.
android.support.v7.app.AlertDialog.Builder builder1;
builder1 = new android.support.v7.app.AlertDialog.Builder(YourActivity.this);
builder1.setMessage("Please check your internet connection");
builder1.setCancelable(true);
builder1.setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
@shihabmi7
shihabmi7 / gist:777bb978765d5e5de0f076947058b969
Created August 4, 2016 01:06
Edittext Ime , Hide keyboard
EditText
android:id="@+id/et_go"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:inputType="text"
android:imeOptions="actionGo"
android:hint="@string/hnt_et_go" />
@shihabmi7
shihabmi7 / Application Class Multidex
Last active November 28, 2016 14:23
Multidex Enable
public class YourApplication extends Application {
@Override
protected void attachBaseContext(Context context) {
super.attachBaseContext(context);
MultiDex.install(this);
}
@Override
public void onCreate() {
super.onCreate();
@shihabmi7
shihabmi7 / ScrollableActivity.java
Created November 21, 2016 17:36
// How to use Location Service :) Follow carefully..
package com.alhikmah.weather360.activity;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Typeface;
import android.location.Location;
import android.os.Bundle;
@shihabmi7
shihabmi7 / spinner_back.xml
Last active November 1, 2021 11:22
Spinner Backgroud Design with image
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape>
<stroke
android:width="1dp"
android:color="#AAAAAA" />
<corners
@shihabmi7
shihabmi7 / google play service available
Created November 29, 2016 12:55
google play service available
// Checking if Google Play Services Available or not
private boolean isGooglePlayServicesAvailable() {
GoogleApiAvailability googleAPI = GoogleApiAvailability.getInstance();
int result = googleAPI.isGooglePlayServicesAvailable(this);
if(result != ConnectionResult.SUCCESS) {
if(googleAPI.isUserResolvableError(result)) {
googleAPI.getErrorDialog(this, result,
0).show();
}
return false;
@shihabmi7
shihabmi7 / DividerItemDecoration.java
Last active January 9, 2017 16:16
Recylar View with Divider
package com.passenger.ucabs.adapter;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
@shihabmi7
shihabmi7 / MapViewHolder.java
Created January 9, 2017 15:03 — forked from alunsford3/MapViewHolder.java
RecyclerViews with MapViews
public class MapViewHolder extends RecyclerView.ViewHolder {
private MapViewListItemView mMapViewListItemView;
public MapViewHolder(MapViewListItemView mapViewListItemView) {
super(mapViewListItemView);
mMapViewListItemView = mapViewListItemView;
}
public void mapViewListItemViewOnCreate(Bundle savedInstanceState) {