Skip to content

Instantly share code, notes, and snippets.

View hendrawd's full-sized avatar
☺️
Happy

Hendra Wijaya Djiono hendrawd

☺️
Happy
View GitHub Profile
class MyFragment private constructor() : Fragment(){
companion object{
private val ARG_CAUGHT = "myFragment_caught"
fun newInstance(caught: Pokemon):MyFragment{
val args: Bundle = Bundle()
args.putSerializable(ARG_CAUGHT, caught)
val fragment = MyFragment()
fragment.arguments = args
return fragment
@hendrawd
hendrawd / LocalBroadcastExampleActivity.java
Created September 9, 2017 08:31 — forked from Antarix/LocalBroadcastExampleActivity.java
Simple Example of using LocalBroadcastManager in Android
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
// Copyright (c) ${YEAR}, ${USER}, ITHENA BVBA @ http://www.ithena.be
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
@hendrawd
hendrawd / MainActivity.java
Last active December 29, 2017 04:16 — forked from hbcafe/gist:e6d53488acfdf6ae0fdf81caea0d2dfe
Simpler implementation for connecting native Android app to Watson Text to Speech in under 10 minutes (TTS interface)
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.ibm.watson.developer_cloud.android.library.audio.StreamPlayer;
import com.ibm.watson.developer_cloud.text_to_speech.v1.TextToSpeech;
@hendrawd
hendrawd / android_studio_shortcuts.md
Created November 22, 2016 09:54 — forked from stkent/android_studio_shortcuts.md
Android Studio Shortcuts (Mac)

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols: