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
import java.io.BufferedInputStream; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; | |
import java.io.OutputStreamWriter; | |
import java.io.PrintWriter; |
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 String sendEmail(String yourName,String email,String artistName,String songTitle) { | |
String result; | |
String host = getString(R.string.host); | |
final String user = getString(R.string.from_email); | |
final String password = getString(R.string.password_email); | |
String to = getString(R.string.to_email); | |
// Get the session object |
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 boolean validEmail(String emailAddress) { | |
if (Build.VERSION.SDK_INT >= 8) { | |
return android.util.Patterns.EMAIL_ADDRESS.matcher(emailAddress) | |
.matches(); | |
} | |
Pattern pattern; | |
Matcher matcher; | |
String EMAIL_PATTERN = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)(\\.[A-Za-z]{2,})$"; |
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 static String getRealPathFromURI(String contentURI,Context context) { | |
Uri contentUri = Uri.parse(contentURI); | |
Cursor cursor = context.getContentResolver().query(contentUri, null, null, null, null); | |
if (cursor == null) { | |
return contentUri.getPath(); | |
} else { | |
cursor.moveToFirst(); | |
int index = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA); | |
return cursor.getString(index); | |
} |
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
100% — FF | |
95% — F2 | |
90% — E6 | |
85% — D9 | |
80% — CC | |
75% — BF | |
70% — B3 | |
65% — A6 | |
60% — 99 | |
55% — 8C |
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 PlaceActivity extends AppCompatActivity { | |
private AutoCompleteTextView mAutoCompleteTextViewPlace; | |
String[] search_text; | |
ArrayList<String> placeNameArrayList; | |
ArrayList<String> placeIdArrayList; | |
ArrayAdapter<String> adp; | |
String url; | |
private static final String TAG_RESULT = "predictions"; |
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
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; | |
import android.os.Bundle; | |
import android.os.IBinder; |
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.vs2.lovealarm.objects; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.support.design.widget.AppBarLayout; | |
import android.support.design.widget.CoordinatorLayout; | |
import android.support.v4.view.ViewCompat; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import java.util.List; |
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
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
public class AspectImageView extends ImageView { | |
private static final int DEFAULT_XRATIO = 1; | |
private static final int DEFAULT_YRATIO = 1; |