package de.edotzlaff.schockwelle; import androidx.fragment.app.FragmentActivity; import android.location.Location; import android.os.Bundle; import android.widget.TextView; 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.LatLng; import com.google.android.gms.maps.model.MarkerOptions; import org.w3c.dom.Text; public class SensorMapsActivity extends FragmentActivity implements OnMapReadyCallback { private GoogleMap mMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sensor_maps); TextView tv= (TextView) findViewById(R.id.txtSensor); initMap(); } void initMap(){ // 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); } @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; // Add a marker in Sydney and move the camera LatLng sydney = new LatLng(-34, 151); mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); } //TODO Aron Daten von DB abfragen //TODO Edward Distanz zwischen zwei Punkten berechnen //TODO Edward Dauer für Timer berechnen bis Smartphone vibriert /* private float distance(double currentlatitude, double currentlongitude, double originLat, double originLon) { float[] results = new float[1]; Location.distanceBetween(currentlatitude, currentlongitude, -34, 151, results); float distanceInMeters = results[0]; return distanceInMeters; } */ }