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 isGPSEnabled(Context mContext) { | |
LocationManager locationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE); | |
return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); | |
} |
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 boolean isInternetConnected(Context ctx) { | |
ConnectivityManager connectivityMgr = (ConnectivityManager) ctx | |
.getSystemService(Context.CONNECTIVITY_SERVICE); | |
NetworkInfo wifi = connectivityMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI); | |
NetworkInfo mobile = connectivityMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); | |
// Check if wifi or mobile network is available or not. If any of them is | |
// available or connected then it will return true, otherwise false; | |
if (wifi != null) { | |
if (wifi.isConnected()) { | |
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
private LocationManager locationManager; | |
private android.location.LocationListener myLocationListener; | |
public void checkLocation() { | |
String serviceString = Context.LOCATION_SERVICE; | |
locationManager = (LocationManager) getSystemService(serviceString); | |
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { |
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 tweepy | |
import csv | |
import pandas as pd | |
####input your credentials here | |
consumer_key = '' | |
consumer_secret = '' | |
access_token = '' | |
access_token_secret = '' | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) |
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 com.google.android.gms.maps.model.LatLng; | |
import static java.lang.Math.asin; | |
import static java.lang.Math.atan2; | |
import static java.lang.Math.cos; | |
import static java.lang.Math.pow; | |
import static java.lang.Math.sin; | |
import static java.lang.Math.sqrt; |
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.os.Handler; | |
import android.os.SystemClock; | |
import android.view.animation.AccelerateDecelerateInterpolator; | |
import android.view.animation.Interpolator; | |
import com.google.android.gms.maps.model.LatLng; | |
import com.google.android.gms.maps.model.Marker; |
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.Manifest; | |
import android.content.pm.PackageManager; | |
import android.location.Location; | |
import android.os.Build; | |
import android.os.Bundle; | |
import android.os.Looper; | |
import android.view.View; | |
import android.widget.Toast; | |
import androidx.annotation.NonNull; |
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
<?php | |
//getting the dboperation class | |
require_once '../includes/DbOperation.php'; | |
//function validating all the paramters are available | |
//we will pass the required parameters to this function | |
function isTheseParametersAvailable($params){ | |
//assuming all parameters are available | |
$available = true; | |
$missingparams = ""; | |
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
<?php | |
class DbOperation | |
{ | |
//Database connection link | |
private $con; | |
//Class constructor | |
function __construct() | |
{ |
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
<?php | |
//Class DbConnect | |
class DbConnect | |
{ | |
//Variable to store database link | |
private $con; | |
//Class constructor |
NewerOlder