Skip to content

Instantly share code, notes, and snippets.

View haerulmuttaqin's full-sized avatar
๐Ÿ’ป

Haerul Muttaqin haerulmuttaqin

๐Ÿ’ป
View GitHub Profile
@haerulmuttaqin
haerulmuttaqin / aditional
Created June 8, 2018 16:35
additional, to display an image
additional,
To display an image:
/**
you have to send the image url from server, you change php code (read_detail.php) following this:
**/
//read_detail.php
<?php
if ($_SERVER['REQUEST_METHOD']=='POST') {
package com.haerul.androidregisterandlogin;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import java.util.HashMap;
public class SessionManager {
@haerulmuttaqin
haerulmuttaqin / ApiClient.java
Created September 11, 2018 03:23
Retrofit handle the SSLHandshakeException (newsapi.org)
package com.haerul.newsapps;
import java.security.cert.CertificateException;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
@haerulmuttaqin
haerulmuttaqin / Utils.java
Created September 11, 2018 07:22
News App Utils
package com.haerul.newsapps;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import org.ocpsoft.prettytime.PrettyTime;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
@haerulmuttaqin
haerulmuttaqin / dependencies.gradle
Last active February 24, 2023 06:04
News App - dependencies
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
//Image
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
//Network
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
@haerulmuttaqin
haerulmuttaqin / color.xml
Created September 11, 2018 07:39
News App - color
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#ea474a</color>
<color name="colorPrimaryDark">#cf2a2d</color>
<color name="colorAccent">#1e344b</color>
<color name="colorBackground">#f9f9fa</color>
<color name="colorTextSubtitle">#4e4e4e</color>
<color name="colorTextTitle">#262626</color>
</resources>
@haerulmuttaqin
haerulmuttaqin / activity_detail.xml
Created September 11, 2018 12:01
News App - activity detail news (layout file)
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="@color/colorBackground"
tools:context=".NewsDetailActivity">
@haerulmuttaqin
haerulmuttaqin / MainActivity.java
Last active December 10, 2020 04:38
Firebase Login with Google (youtube tutorial)
//package com.haerulmuttaqin.firebaselogin;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
@haerulmuttaqin
haerulmuttaqin / gist:827dc1c80c49c8a21ab59751e17f1b71
Created December 10, 2018 17:07 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@haerulmuttaqin
haerulmuttaqin / ApiClient.java
Created December 25, 2018 18:50
Android CRUD Tutorial | โ€ข RETROFIT โ€ข PHP โ€ข MYSQL (https://youtu.be/Vh92eSAEu5c)
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ApiClient {
private static final String BASE_URL = "http://your-domain-name.000webhostapp.com/";
private static Retrofit retrofit;
public static Retrofit getApiClient() {