Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Privacy Policy</title> <style>body{font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em;}</style></head> <body><h2>Privacy Policy</h2> <p> built the Chuyển đổi 11 số sang 10 số các mạng app as a Free app. This SERVICE is provided by at no cost and is intended for use as is.
</p> <p>This page is used to inform visitors regarding my policies with the collection, use, and
disclosure of Personal Information if anyone decided to use my Service.
</p> <p>If you choose to use my Service, then you agree to the collection and use of information in relation
to this policy. The Personal Information that I collect is used for providing and improving the
Service. I will not use or share your information with anyone except as described
in this Privacy Policy.
</
// search text timer
mEdittext = (EditText) findViewById(R.id.editText);
subTextChange = new Subscriber<CharSequence>() {
@Override
public void onCompleted() {
Log.d(TAG, "onCompleted: ");
}
@Override
public void onError(Throwable e) {
@vuhung3990
vuhung3990 / GPSTracker.java
Last active February 19, 2018 12:08
GPSTracker gps = new GPSTracker(this); if (gps.canGetLocation()) { mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(gps.getLatitude(), gps.getLongitude()), 18)); } else { gps.showSettingsAlert(); }
package grasys.com.googlemapnotification;
import android.app.AlertDialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
@vuhung3990
vuhung3990 / DetectScrollToEnd.java
Last active August 14, 2017 06:57
recycleview load more helper
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
/**
* Created by dev22 on 3/1/17.
* helper class for detect when recyclerView scroll to bottom and load more data
*/
public abstract class DetectScrollToEnd extends RecyclerView.OnScrollListener {
private final LinearLayoutManager layoutManager;
private final int mThreshold;
@vuhung3990
vuhung3990 / Test.java
Created June 20, 2017 10:46
test intent
public class MainActivityTest {
@Rule
public IntentsTestRule<MainActivity> rule = new IntentsTestRule<MainActivity>(MainActivity.class);
@Test
public void openExport_shouldPass() throws Exception {
onView(withId(R.id.export_contact)).perform(click());
intended(
allOf(
@vuhung3990
vuhung3990 / RxBus.java
Created February 2, 2016 02:27
RxBus replace of eventbus
package com.example.hungvu.testpack;
import rx.Observable;
import rx.Subscriber;
import rx.Subscription;
import rx.functions.Func1;
import rx.subjects.PublishSubject;
import rx.subjects.Subject;
/**
@vuhung3990
vuhung3990 / MainActivityTest.java
Last active March 7, 2017 12:18
- espresso pull to refresh and load more basic - RecyclerViewActions: androidTestCompile("com.android.support.test.espresso:espresso-contrib:$espressoVersion") { // Necessary to avoid version conflicts exclude group: 'com.android.support', module: 'appcompat' exclude group: 'com.android.support', module: 'support-v4' exclude group: 'com.android.…
package com.dev22.dealhunter;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static android.support.test.espresso.Espresso.onView;
// WEEK
Calendar first = Calendar.getInstance();
first.add(Calendar.DAY_OF_WEEK, first.getFirstDayOfWeek() - first.get(Calendar.DAY_OF_WEEK));
int startWeek = first.get(Calendar.DATE);
int endWeek = startWeek + 6;
// MONTH
// start = 1
Calendar date = Calendar.getInstance();
@vuhung3990
vuhung3990 / convert unix time to hh:MM:ss.java
Last active February 13, 2017 08:53
convert unix time to hh:MM:ss
/**
* convert milisec to hh:MM:ss
* @param millisUntilFinished
* @return String time
*/
public static String convertMilisecToHMmSs(long millisUntilFinished) {
return String.format("%02d:%02d:%02d",
TimeUnit.MILLISECONDS.toHours(millisUntilFinished),
TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) - TimeUnit.HOURS.toMinutes(
TimeUnit.MILLISECONDS.toHours(millisUntilFinished)),
@vuhung3990
vuhung3990 / update.java
Last active February 13, 2017 08:52
File write, read, delete example ,must have READ, WRITE permissions
/**
* Write content into file
*
* @param path require WRITE_EXTERNAL
* @param contentString
*/
public static void writeContentFile(String path, String contentString) {
File file = new File(path);
if (!file.exists())