This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sample 1 | |
Observable.just(1, 2, 3, 4, 5) | |
// filter result | |
.filter(new Func1<Integer, Boolean>() { | |
@Override | |
public Boolean call(Integer integer) { | |
return integer % 2 == 0; | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
private CallbackManager fbCallbackManager; | |
private LoginButton loginButton; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
/// remember after setContentView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git stash save "name..." | |
git stash list | |
git stash apply stash@{0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.hungvu.testpack; | |
import android.content.Context; | |
import android.support.v4.content.AsyncTaskLoader; | |
import android.util.Log; | |
/** | |
* Template Custom Asynctask Loader | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.scalefocus.com/blog/identifying-memory-leaks-in-android-applications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android:windowSoftInputMode="stateVisible|adjustPan" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.hungvu.testpack; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.net.wifi.WifiInfo; | |
import android.os.Bundle; | |
import android.provider.Settings; | |
import android.support.v7.app.AppCompatActivity; | |
import android.util.Log; | |
import android.view.Menu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* format unix time to string | |
* | |
* @param unixTime | |
* @param pattern FORMAT PATTERNS | |
* ----------------------------------------------------------------- | |
* Letter Date or Time Component Presentation Examples | |
* ----------------------------------------------------------------- | |
* G Era designator Text AD | |
* y Year Year 1996; 96 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* calculate SHA1 of string | |
* @param encryptString string to encrypt | |
* @return encrypted sha1 or NULL | |
*/ | |
public static String sha1Encrypt(String encryptString) | |
{ | |
// return null (default) if calculator fail | |
String sha1 = null; | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.hungvu.testpack"> | |
<uses-permission android:name="ANDROID.PERMISSION.CAMERA" /> | |
<uses-permission android:name="ANDROID.PERMISSION.READ_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="ANDROID.PERMISSION.WRITE_EXTERNAL_STORAGE" /> | |
<uses-feature | |
android:name="android.hardware.camera" |