Aplikasi Sistem Informasi Objek Parawista Provinsi Sumatera Utara

1

LAMPIRAN PROGRAM

Splashscreen.xml





Activty_tes.xml




Universitas Sumatera Utara

2















Universitas Sumatera Utara

4

Activty_baby.xml






















Universitas Sumatera Utara

7


Activty_berat.xml










Activty_main.xml








Activty_sport.xml















Activty_tips.xml


Universitas Sumatera Utara


12










Activty_tes.xml


Universitas Sumatera Utara

13

















Activty_maps.xml


Universitas Sumatera Utara

16


LocationOpenDb.java
package com.example.xyzskylake.healthcare.ORM.Helper;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import
import
import
import
import
import
import
import
import

com.example.xyzskylake.healthcare.ORM.Model.Location;
com.example.xyzskylake.healthcare.R;
com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
com.j256.ormlite.dao.Dao;

com.j256.ormlite.dao.GenericRawResults;
com.j256.ormlite.dao.RawRowMapper;
com.j256.ormlite.stmt.QueryBuilder;
com.j256.ormlite.support.ConnectionSource;
com.j256.ormlite.table.TableUtils;

import java.sql.Date;
import java.sql.SQLException;
import java.util.List;
/**
* Created by dolly on 11/19/16.
*/
public class LocationOpenDb extends OrmLiteSqliteOpenHelper{
private static final String DATABASE_NAME = "map_db";
private static final int DATABASE_VERSION = 1;
/**
* The data access object used to interact with the Sqlite
database to do C.R.U.D operations.
*/
private Dao Location;

public LocationOpenDb(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION,
/**
* R.raw.ormlite_config is a reference to the
ormlite_config.txt file in the
* /res/raw/ directory of this project
* */
R.raw.ormlite_config);
}
@Override
public void onCreate(SQLiteDatabase database, ConnectionSource
connectionSource) {
try {
/**
* creates the PairData database table
*/
TableUtils.createTable(connectionSource,
Location.class);
} catch (SQLException e) {
e.printStackTrace();


Universitas Sumatera Utara

17

}
}
@Override
public void onUpgrade(SQLiteDatabase database,
ConnectionSource connectionSource, int oldVersion, int newVersion)
{
try {
/**
* Recreates the database when onUpgrade is called by
the framework
*/
TableUtils.dropTable(connectionSource, Location.class,
false);
onCreate(database, connectionSource);
} catch (SQLException e) {

e.printStackTrace();
}
}
/*
* Returns an instance of the data access object
* @return
* @throws SQLException
*/
public Dao getDao() throws SQLException {
if (Location == null) {
Location = getDao(Location.class);
}
return Location;
}
/**
* Insert PairData
*
* @param location
*/
public void insert(Location location) {
try {
getDao().create(location);
Log.i("InsertLocation", location.toString());
} catch (SQLException e) {
e.printStackTrace();
}
}
public List fetchAll() {
List locations;
try {
QueryBuilder qb =
this.getDao().queryBuilder().orderBy("id",true);
GenericRawResults results =
this.getDao().queryRaw(
qb.prepareStatementString(),
new RawRowMapper() {
public Location mapRow(String[]
columnNames, String[] resultColumns) {

Universitas Sumatera Utara

18

Location location = new Location(
resultColumns[1],
Double.parseDouble(resultColumns[2]),
Double.parseDouble(resultColumns[3]),
resultColumns[4],
resultColumns[5]
);
location.setId(Long.parseLong(resultColumns[0]));
location.setCreatedDate(new
Date(Long.parseLong(resultColumns[6])));
return location;
}
});
locations = results.getResults();
return locations;
} catch (SQLException e) {
// TODO Auto-generated catch block
Log.e("FetchAll", "Error Fetch All");
e.printStackTrace();
return null;
}
}
public Location fetch(Long id) {
try {
return this.getDao().queryForId(id);
} catch (SQLException e) {
// TODO Auto-generated catch block
Log.e("FetchID", Long.toString(id));
e.printStackTrace();
return null;
}
}
/**
* Drop current table
*/
public void drop() {
try {
TableUtils.dropTable(getConnectionSource(),
Location.class, false);
Log.i("Location", "dropped");
} catch (SQLException e) {
e.printStackTrace();
}
}
}

Location.java
package com.example.xyzskylake.healthcare.ORM.Model;
/**
* Created by ali on 03/12/16.
*/

Universitas Sumatera Utara

19

import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import java.util.Date;
@DatabaseTable(tableName = "location")
public class Location {
@DatabaseField(generatedId=true)
private Long id;
@DatabaseField
private String tittle;
@DatabaseField
private double latitude;
@DatabaseField
private double longitude;
@DatabaseField
private String type;
@DatabaseField
private String description;
@DatabaseField(dataType = DataType.DATE_LONG)
private Date createdDate;
public Location() {
}
public Location(String tittle, Double latitude, Double
longitude, String type, String description) {
this.setTittle(tittle);
this.setLatitude(latitude);
this.setLongitude(longitude);
this.setType(type);
this.setDescription(description);
this.setCreatedDate(new Date());
}
public String getTittle() {
return tittle;
}
public void setTittle(String tittle) {
this.tittle = tittle;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}

Universitas Sumatera Utara

20

public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
@Override
public String toString() {
return this.getTittle();
}
}

OrmLiteDbConfig.java
package com.example.xyzskylake.healthcare.ORM.Util;
import com.example.xyzskylake.healthcare.ORM.Model.Location;
import com.j256.ormlite.android.apptools.OrmLiteConfigUtil;
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;

Universitas Sumatera Utara

21

/**
* Created by dolly on 11/19/16.
*/
public class OrmLiteDbConfig extends OrmLiteConfigUtil {
/**
* classes represents the models to use for generating the
ormlite_config.txt file
*/
private static final Class[] classes = new Class[]
{Location.class};
/**
* Given that this is a separate program from the android app,
we have to use
* a static main java method to create the configuration file.
* @param args
* @throws IOException
* @throws SQLException
*/
public static void main(String[] args) throws IOException,
SQLException {
String currentDirectory = "user.dir";
String configPath =
"/app/src/main/res/raw/ormlite_config.txt";
/**
* Gets the project root directory
*/
String projectRoot = System.getProperty(currentDirectory);
/**
* Full configuration path includes the project root path,
and the location
* of the ormlite_config.txt file appended to it
*/
String fullConfigPath = projectRoot + configPath;
File configFile = new File(fullConfigPath);
/**
* In the a scenario where we run this program serveral
times, it will recreate the
* configuration file each time with the updated
configurations.
*/
if(configFile.exists()) {
configFile.delete();
configFile = new File(fullConfigPath);
}
/**
* writeConfigFile is a util method used to write the
necessary configurations
* to the ormlite_config.txt file.
*/
writeConfigFile(configFile, classes);

Universitas Sumatera Utara

22

}
}

Spashscreen.java
package com.example.xyzskylake.healthcare;
import
import
import
import
import
import
import
import
import

android.app.Activity;
android.content.Intent;
android.graphics.PixelFormat;
android.os.Bundle;
android.view.Window;
android.view.animation.Animation;
android.view.animation.AnimationUtils;
android.widget.ImageView;
android.widget.LinearLayout;

public class Splashscreen extends Activity {
public void onAttachedToWindow() {
super.onAttachedToWindow();
Window window = getWindow();
window.setFormat(PixelFormat.RGBA_8888);
}
/** Called when the activity is first created. */
Thread splashTread;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splashscreen);
StartAnimations();
}
private void StartAnimations() {
Animation anim = AnimationUtils.loadAnimation(this,
R.anim.alpha);
anim.reset();
LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay);
l.clearAnimation();
l.startAnimation(anim);
anim = AnimationUtils.loadAnimation(this,
R.anim.translate);
anim.reset();
ImageView iv = (ImageView) findViewById(R.id.splash);
iv.clearAnimation();
iv.startAnimation(anim);
splashTread = new Thread() {
@Override
public void run() {
try {
int waited = 0;
// Splash screen pause time
while (waited < 3500) {
sleep(100);
waited += 100;
}
Intent intent = new Intent(Splashscreen.this,
MainActivity.class);

Universitas Sumatera Utara

23

intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent);
Splashscreen.this.finish();
} catch (InterruptedException e) {
// do nothing
} finally {
Splashscreen.this.finish();
}
}
};
splashTread.start();
}
}

Mainactivty.java
package com.example.xyzskylake.healthcare;
import
import
import
import
import

android.content.Intent;
android.support.v7.app.AppCompatActivity;
android.os.Bundle;
android.view.View;
android.widget.Button;

public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
View Button = findViewById(R.id.angry_btn);
Button.setOnClickListener(
new Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),tes.class);
startActivity(myIntent);
}
}
);
}}

tes.java
package com.example.xyzskylake.healthcare;
import android.content.Intent;

Universitas Sumatera Utara

24

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class tes extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tes);
View hospital = findViewById(R.id.imageView13);
View imageView = findViewById(R.id.imageView14);
View imageView2 = findViewById(R.id.imageView17);
View imageView3 = findViewById(R.id.imageView16);
View imageView4 = findViewById(R.id.imageView15);
View masuk = findViewById(R.id.imageView18);
View imageView5 = findViewById(R.id.imageView19);

imageView.setOnClickListener(
new android.widget.Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),sport.class);
startActivity(myIntent);
}
}
);
imageView2.setOnClickListener(
new android.widget.Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),activity2.class);
startActivity(myIntent);
}
}
);
imageView3.setOnClickListener(
new android.widget.Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),berat.class);
startActivity(myIntent);
}
}
);
imageView4.setOnClickListener(
new android.widget.Button.OnClickListener()
{
public void onClick(View v)
{

Universitas Sumatera Utara

25

Intent myIntent = new
Intent(v.getContext(),baby.class);
startActivity(myIntent);
}
}
);
imageView5.setOnClickListener(
new android.widget.Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),list.class);
startActivity(myIntent);
}
}
);
masuk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent myIntent = new
Intent(v.getContext(),Input.class);
startActivity(myIntent);
}
});
hospital.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent myIntent = new
Intent(v.getContext(),Hospital.class);
startActivity(myIntent);
}
});
}
}

baby.java
package com.example.xyzskylake.healthcare;
import
import
import
import
import

android.content.Intent;
android.support.v7.app.AppCompatActivity;
android.os.Bundle;
android.view.View;
android.widget.Button;

public class baby extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_baby);
View TextView = findViewById(R.id.textView7);
View TextView2 = findViewById(R.id.textView9);
View TextView3 = findViewById(R.id.textView10);
View TextView4 = findViewById(R.id.textView22);

Universitas Sumatera Utara

26

View TextView5 = findViewById(R.id.textView20);
TextView.setOnClickListener(
new Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),baby2.class);
startActivity(myIntent);
}
}
);
TextView2.setOnClickListener(
new Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),baby3.class);
startActivity(myIntent);
}
}
);
TextView3.setOnClickListener(
new Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),baby4.class);
startActivity(myIntent);
}
}
);
TextView4.setOnClickListener(
new Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),baby5.class);
startActivity(myIntent);
}
}
);
TextView5.setOnClickListener(
new Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),baby6.class);
startActivity(myIntent);
}
}
);
}
}

Universitas Sumatera Utara

27

berat.java
package com.example.xyzskylake.healthcare;
import
import
import
import
import

android.support.v7.app.AppCompatActivity;
android.os.Bundle;
android.view.View;
android.widget.EditText;
android.widget.TextView;

public class berat extends AppCompatActivity {
private EditText height;
private EditText weight;
private TextView result;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_berat);
height = (EditText) findViewById(R.id.height);
weight = (EditText) findViewById(R.id.weight);
result = (TextView) findViewById(R.id.result);
}
public void calculateBMI(View v){
String heightStr = height.getText().toString();
String weightStr = weight.getText().toString();
if (heightStr != null && !"".equals(heightStr)
&& weightStr != null && !"".equals(weightStr)){
float heightvalue = Float.parseFloat(heightStr)/100;
float weightvalue = Float.parseFloat((weightStr));
float bmi = weightvalue / (heightvalue * heightvalue);
displayBMI(bmi);
}
}
private void displayBMI(float bmi){
String bmilabel = "";
if (Float.compare(bmi, 15f) 0 && Float.compare(bmi,
16f) 0 && Float.compare(bmi,
18.5f) 0 &&
Float.compare(bmi, 25f) 0 && Float.compare (bmi,
30f) 0 && Float.compare (bmi,
35f) 0 && Float.compare (bmi,
40f)> 1) :
(result >> 1));
lng += dlng;
LatLng p = new LatLng((((double) lat / 1E5)),
(((double) lng / 1E5)));
poly.add(p);
}
return poly;
}
}

sport.java
package com.example.xyzskylake.healthcare;
import
import
import
import
import

android.content.Intent;
android.support.v7.app.AppCompatActivity;
android.os.Bundle;
android.view.View;
android.widget.Button;

public class sport extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sport);
View TextView = findViewById(R.id.textView8);
View TextView2 = findViewById(R.id.textView7);
View TextView3 = findViewById(R.id.textView9);
View TextView4 = findViewById(R.id.textView10);
TextView.setOnClickListener(
new Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),sport1.class);
startActivity(myIntent);
}
}
);

Universitas Sumatera Utara

31

TextView2.setOnClickListener(
new Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),sport2.class);
startActivity(myIntent);
}
}
);
TextView3.setOnClickListener(
new Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),sport3.class);
startActivity(myIntent);
}
}
);
TextView4.setOnClickListener(
new Button.OnClickListener()
{
public void onClick(View v)
{
Intent myIntent = new
Intent(v.getContext(),sport4.class);
startActivity(myIntent);
}
}
);
}
}

tips.java
package com.example.xyzskylake.healthcare;
import
import
import
import

android.support.v7.app.AppCompatActivity;
android.os.Bundle;
android.webkit.WebView;
android.widget.Button;

public class tips1 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tips1);
}
}

Universitas Sumatera Utara

32

Mapsactivty.java
package com.example.xyzskylake.healthcare;
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import

android.*;
android.Manifest;
android.content.pm.PackageManager;
android.graphics.Color;
android.location.Location;
android.os.AsyncTask;
android.os.Build;
android.support.annotation.NonNull;
android.support.annotation.Nullable;
android.support.v4.app.ActivityCompat;
android.support.v4.app.FragmentActivity;
android.os.Bundle;
android.support.v4.content.ContextCompat;
android.util.Log;
android.widget.Toast;

import
com.example.xyzskylake.healthcare.ORM.Helper.LocationOpenDb;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.PolylineOptions;
import com.j256.ormlite.android.apptools.OpenHelperManager;
import org.json.JSONObject;
import
import
import
import
import
import
import
import
import

java.io.BufferedReader;
java.io.IOException;
java.io.InputStream;
java.io.InputStreamReader;
java.net.HttpURLConnection;
java.net.URL;
java.util.ArrayList;
java.util.HashMap;
java.util.List;

public class MapsActivity extends FragmentActivity implements
OnMapReadyCallback,
GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener,
LocationListener {
private LocationOpenDb locationOpenDbHelper;
String tittle_show;
double lat,lng;
private GoogleMap mMap;

Universitas Sumatera Utara

33

GoogleApiClient mGoogleApiClient;
Location mLastLocation;
Marker mCurrLocationMarker;
LocationRequest mLocationRequest;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
this.locationOpenDbHelper =
OpenHelperManager.getHelper(this,LocationOpenDb.class);
com.example.xyzskylake.healthcare.ORM.Model.Location
location;
final long coor_map =
getIntent().getExtras().getLong("id");
Log.i("Simpan",Long.toString(coor_map));
location = this.locationOpenDbHelper.fetch(coor_map +1);
lat = location.getLatitude();
lng = location.getLongitude();
tittle_show = location.getTittle();
if (android.os.Build.VERSION.SDK_INT >=
Build.VERSION_CODES.M) {
checkLocationPermission();
}
// Obtain the SupportMapFragment and get notified when the
map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment)
getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be
used.
* This is where we can add markers or lines, add listeners or
move the camera. In this case,
* we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the
user will be prompted to install
* it inside the SupportMapFragment. This method will only be
triggered once the user has
* installed Google Play services and returned to the app.
*/
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
// Add a marker in Sydney and move the camera
if (android.os.Build.VERSION.SDK_INT >=
Build.VERSION_CODES.M) {
if (ContextCompat.checkSelfPermission(this,
android.Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED) {

Universitas Sumatera Utara

34

buildGoogleApiClient();
mMap.setMyLocationEnabled(true);
}
}
else {
buildGoogleApiClient();
mMap.setMyLocationEnabled(true);
}
}
protected synchronized void buildGoogleApiClient() {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
mGoogleApiClient.connect();
}
@Override
public void onConnected(@Nullable Bundle bundle) {
mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(1000);
mLocationRequest.setFastestInterval(1000);
mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POW
ER_ACCURACY);
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED) {
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleAp
iClient, mLocationRequest, this);
}
}
@Override
public void onConnectionSuspended(int i) {
}
@Override
public void onConnectionFailed(@NonNull ConnectionResult
connectionResult) {
}
@Override
public void onLocationChanged(Location location) {
mLastLocation = location;
if (mCurrLocationMarker != null) {
mCurrLocationMarker.remove();
}
//Place current location marker
LatLng latLng = new LatLng(location.getLatitude(),
location.getLongitude());

Universitas Sumatera Utara

35

MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(latLng);
//markerOptions.title("Current Position");
markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDes
criptorFactory.HUE_GREEN));
mCurrLocationMarker = mMap.addMarker(markerOptions);
LatLng dest = new LatLng(lat, lng);
markerOptions.position(dest);
markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDes
criptorFactory.HUE_ROSE));
mCurrLocationMarker = mMap.addMarker(markerOptions);
double temp1 =(location.getLatitude() + 3.566843)/2;
double temp2 = (location.getLongitude() + 98.867636)/2;
LatLng move = new LatLng(temp1, temp2);
String url = getDirectionsUrl(latLng, dest);
DownloadTask downloadTask = new DownloadTask();
// Start downloading json data from Google Directions API
downloadTask.execute(url);
//move map camera
mMap.moveCamera(CameraUpdateFactory.newLatLng(move));
mMap.animateCamera(CameraUpdateFactory.zoomTo(10));
//stop location updates
if (mGoogleApiClient != null) {
LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApi
Client, this);
}
}
public static final int MY_PERMISSIONS_REQUEST_LOCATION = 99;
public boolean checkLocationPermission(){
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
// Asking user if explanation is needed
if
(ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.ACCESS_FINE_LOCATION)) {
// Show an explanation to the user
*asynchronously* -- don't block
// this thre