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.Activity; | |
import android.app.ProgressDialog; | |
import android.database.Cursor; | |
import android.graphics.Bitmap; | |
import android.os.AsyncTask; | |
import android.provider.MediaStore; | |
/* | |
* @author Ashish | |
* https://github.com/ashmeh6 |
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
/** | |
* Created by Ashish on 09-Jun-16. | |
*/ | |
/** | |
* Required Library httpmime-4.1-beta1.jar | |
* | |
* Example of use | |
* | |
* doInBackground(Params...){ |
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
private boolean isValidEmail(String email) { | |
if (TextUtils.isEmpty(email)) { | |
return false; | |
} | |
if (!(email.indexOf('@') > 0 && email.lastIndexOf('.') > (email.indexOf('@') + 1) && (email.length() - 1) != email.lastIndexOf('.'))) { | |
return false; | |
} | |
return true; | |
} |
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.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; | |
import android.provider.Settings; |
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
/* | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> | |
<uses-permission android:name="android.permission.USE_CREDENTIALS" /> | |
build.gradle | |
compile 'com.google.android.gms:play-services-auth:9.0.+' | |
Release SHA1 :keytool -list -v -keystore path_file.jks -alias Key_Alias_Here -storepass Key_store_Password_Here -keypass Key_Password_Here |
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.support.v7.widget.RecyclerView; | |
import android.view.GestureDetector; | |
import android.view.MotionEvent; | |
import android.view.View; | |
/** | |
* Created by Ashish on 25-Jul-16. | |
*/ | |
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
/* | |
* Copyright (C) 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
webView.setWebViewClient(new WebViewClient() { | |
public void onPageFinished(WebView view, String url) { | |
// do your stuff here | |
webView.measure(View.MeasureSpec.makeMeasureSpec( | |
View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED), | |
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)); | |
webView.layout(0, 0, webView.getMeasuredWidth(), | |
webView.getMeasuredHeight()); | |
webView.setDrawingCacheEnabled(true); |
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 CallLogReadAndroid{ | |
public CallLogReadAndroid(){ | |
Uri allCalls = Uri.parse("content://call_log/calls"); | |
StringBuffer sb = new StringBuffer(); | |
sb.append("Call Details :"); | |
Cursor c = managedQuery(allCalls, null, null, null, CallLog.Calls.DATE + " DESC LIMIT 100"); | |
int date = c.getColumnIndex(CallLog.Calls.DATE); | |
int number = c.getColumnIndex(CallLog.Calls.NUMBER); | |
int name = c.getColumnIndex(CallLog.Calls.CACHED_NAME); | |
// String num= c.getString(c.getColumnIndex(CallLog.Calls.NUMBER));// for number |
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
private class FetchAddressFromLocation extends AsyncTask<Void, Void, String> { | |
private Context context; | |
private Double latitude; | |
private Double longitude; | |
public FetchAddressFromLocation(Context context, Double latitude, Double longitude) { | |
this.context = context; | |
this.latitude = latitude; | |
this.longitude = longitude; |
OlderNewer