Compare commits
No commits in common. "ea351e5789fb0379da83f72ecf39b4fa2426e501" and "437a401a5dd868c546a700be8a49b2b53974eb8c" have entirely different histories.
ea351e5789
...
437a401a5d
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -7,8 +7,8 @@ android {
|
|||||||
buildToolsVersion "30.0.3"
|
buildToolsVersion "30.0.3"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "de.edotzlaff.maps0123"
|
applicationId "de.edotzlaff.schockwelle"
|
||||||
minSdkVersion 24
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
@ -30,12 +30,12 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.3.0'
|
||||||
implementation 'com.google.android.material:material:1.3.0'
|
implementation 'com.google.android.material:material:1.3.0'
|
||||||
implementation 'com.google.android.gms:play-services-maps:17.0.1'
|
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
|
implementation 'com.google.android.gms:play-services-maps:17.0.1'
|
||||||
testImplementation 'junit:junit:4.+'
|
testImplementation 'junit:junit:4.+'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||||
implementation "com.google.android.gms:play-services-location:15.0.1" //Import to find the location from the device
|
implementation "com.google.android.gms:play-services-location:15.0.1" //Important to find the location from the device
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package de.edotzlaff.maps0123;
|
package de.edotzlaff.schockwelle;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
|
|||||||
public void useAppContext() {
|
public void useAppContext() {
|
||||||
// Context of the app under test.
|
// Context of the app under test.
|
||||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
assertEquals("de.edotzlaff.maps0123", appContext.getPackageName());
|
assertEquals("de.edotzlaff.schockwelle", appContext.getPackageName());
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,24 +1,4 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<!--
|
|
||||||
TODO: Before you run your application, you need a Google Maps API key.
|
|
||||||
|
|
||||||
To get one, follow this link, follow the directions and press "Create" at the end:
|
|
||||||
|
|
||||||
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=D2:BC:D8:1A:07:E8:86:EC:AB:EC:EC:EF:CB:1B:C0:A6:B7:FB:69:56%3Bde.edotzlaff.maps0123
|
|
||||||
|
|
||||||
You can also add your credentials to an existing key, using these values:
|
|
||||||
|
|
||||||
Package name:
|
|
||||||
de.edotzlaff.maps0123
|
|
||||||
|
|
||||||
SHA-1 certificate fingerprint:
|
|
||||||
D2:BC:D8:1A:07:E8:86:EC:AB:EC:EC:EF:CB:1B:C0:A6:B7:FB:69:56
|
|
||||||
|
|
||||||
Alternatively, follow the directions here:
|
|
||||||
https://developers.google.com/maps/documentation/android/start#get-key
|
|
||||||
|
|
||||||
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
|
|
||||||
string in this file.
|
|
||||||
-->
|
|
||||||
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyCCnjanFAzxuH91tD206IjaAU4_ymSgug0</string>
|
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyCCnjanFAzxuH91tD206IjaAU4_ymSgug0</string>
|
||||||
</resources>
|
</resources>
|
@ -1,20 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="de.edotzlaff.maps0123">
|
package="de.edotzlaff.schockwelle">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
|
||||||
|
Google Maps Android API v2, but you must specify either coarse or fine
|
||||||
|
location permissions for the "MyLocation" functionality.
|
||||||
|
-->
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.Maps0123">
|
android:theme="@style/Theme.Schockwelle">
|
||||||
<activity android:name=".map"></activity>
|
|
||||||
<!--
|
<!--
|
||||||
The API key for Google Maps-based APIs is defined as a string resource.
|
The API key for Google Maps-based APIs is defined as a string resource.
|
||||||
(See the file "res/values/google_maps_api.xml").
|
(See the file "res/values/google_maps_api.xml").
|
||||||
@ -28,8 +32,12 @@
|
|||||||
android:value="@string/google_maps_key" />
|
android:value="@string/google_maps_key" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MapsActivity"
|
android:name=".SensorMapsActivity"
|
||||||
android:label="@string/title_activity_maps">
|
android:label="@string/title_activity_sensor_maps"></activity>
|
||||||
|
<activity
|
||||||
|
android:name=".EarthquakeMapsActivity"
|
||||||
|
android:label="@string/title_activity_earthquake_maps" />
|
||||||
|
<activity android:name=".MainActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package de.edotzlaff.maps0123;
|
package de.edotzlaff.schockwelle;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
@ -8,9 +8,9 @@ import android.util.Log;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.google.android.gms.location.FusedLocationProviderClient;
|
import com.google.android.gms.location.FusedLocationProviderClient;
|
||||||
import com.google.android.gms.location.LocationServices;
|
import com.google.android.gms.location.LocationServices;
|
||||||
@ -23,8 +23,7 @@ import com.google.android.gms.maps.model.MarkerOptions;
|
|||||||
import com.google.android.gms.tasks.OnCompleteListener;
|
import com.google.android.gms.tasks.OnCompleteListener;
|
||||||
import com.google.android.gms.tasks.Task;
|
import com.google.android.gms.tasks.Task;
|
||||||
|
|
||||||
public class map extends AppCompatActivity implements OnMapReadyCallback {
|
public class EarthquakeMapsActivity extends FragmentActivity implements OnMapReadyCallback {
|
||||||
|
|
||||||
|
|
||||||
private static final String TAG = "MainActivity";
|
private static final String TAG = "MainActivity";
|
||||||
private static final String FINE_LOCATION = Manifest.permission.ACCESS_FINE_LOCATION;
|
private static final String FINE_LOCATION = Manifest.permission.ACCESS_FINE_LOCATION;
|
||||||
@ -38,7 +37,7 @@ public class map extends AppCompatActivity implements OnMapReadyCallback {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_maps);
|
setContentView(R.layout.activity_earthquake_maps);
|
||||||
|
|
||||||
getLocationPermission();
|
getLocationPermission();
|
||||||
}
|
}
|
||||||
@ -55,6 +54,7 @@ public class map extends AppCompatActivity implements OnMapReadyCallback {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
mLocationPermissionsGranted = false;
|
mLocationPermissionsGranted = false;
|
||||||
|
|
||||||
switch (requestCode) {
|
switch (requestCode) {
|
||||||
@ -68,11 +68,13 @@ public class map extends AppCompatActivity implements OnMapReadyCallback {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initMap() {
|
private void initMap() {
|
||||||
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
|
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
|
||||||
mapFragment.getMapAsync(this);
|
mapFragment.getMapAsync(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onMapReady(GoogleMap googleMap) {
|
public void onMapReady(GoogleMap googleMap) {
|
||||||
Toast.makeText(this, "Map is ready", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Map is ready", Toast.LENGTH_SHORT).show();
|
||||||
mMap = googleMap;
|
mMap = googleMap;
|
||||||
@ -88,11 +90,11 @@ public class map extends AppCompatActivity implements OnMapReadyCallback {
|
|||||||
}
|
}
|
||||||
mMap.setMyLocationEnabled(true);
|
mMap.setMyLocationEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a marker in Sydney and move the camera
|
// Add a marker in Sydney and move the camera
|
||||||
//LatLng sydney = new LatLng(-50, 151);
|
//LatLng sydney = new LatLng(-34, 151);
|
||||||
//mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
|
//mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
|
||||||
//mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
|
//mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getDeviceLocation(){
|
private void getDeviceLocation(){
|
||||||
@ -108,12 +110,12 @@ public class map extends AppCompatActivity implements OnMapReadyCallback {
|
|||||||
public void onComplete(@NonNull Task task) {
|
public void onComplete(@NonNull Task task) {
|
||||||
if (task.isSuccessful()){
|
if (task.isSuccessful()){
|
||||||
|
|
||||||
Location currentLocation = (Location) task.getResult();
|
Location currentLocation = (Location) task.getResult(); //TODO Aron hier erhält die Anwendung die GPS Positionen
|
||||||
moveCamera(new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()),15f);
|
moveCamera(new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()),15f);
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
Toast.makeText(map.this, "Current Location unavailable", Toast.LENGTH_SHORT).show();
|
Toast.makeText(EarthquakeMapsActivity.this, "Current Location unavailable", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -128,4 +130,6 @@ public class map extends AppCompatActivity implements OnMapReadyCallback {
|
|||||||
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latlng, zoom));
|
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latlng, zoom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//TODO Aron Daten an DB senden
|
||||||
}
|
}
|
@ -1,9 +1,11 @@
|
|||||||
package de.edotzlaff.maps0123;
|
package de.edotzlaff.schockwelle;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.hardware.Sensor;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -12,22 +14,18 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import com.google.android.gms.common.ConnectionResult;
|
import com.google.android.gms.common.ConnectionResult;
|
||||||
import com.google.android.gms.common.GoogleApiAvailability;
|
import com.google.android.gms.common.GoogleApiAvailability;
|
||||||
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;
|
|
||||||
|
|
||||||
public class MapsActivity extends FragmentActivity {
|
public class MainActivity extends FragmentActivity {
|
||||||
|
|
||||||
private static final String TAG = "MainActivity";
|
private static final String TAG = "MainActivity";
|
||||||
private static final int ERROR_DIALOG_REQUEST = 9001;
|
private static final int ERROR_DIALOG_REQUEST = 9001;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_map); //IMPORTANT: MapsActivity führt zur activity_map.xml (nicht zur activity_maps)
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
if (isServiceOK()){
|
if (isServiceOK()){
|
||||||
init();
|
init();
|
||||||
@ -35,21 +33,33 @@ public class MapsActivity extends FragmentActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void init(){
|
private void init(){
|
||||||
Button btnMap = (Button) findViewById(R.id.btnMap);
|
|
||||||
btnMap.setOnClickListener(new View.OnClickListener() {
|
Button btnEarthquake = (Button) findViewById(R.id.btnEarthquake);
|
||||||
|
btnEarthquake.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent intent = new Intent(MapsActivity.this, map.class);
|
Intent intent = new Intent(MainActivity.this, EarthquakeMapsActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Button btnSensor = (Button) findViewById(R.id.btnSensor);
|
||||||
|
btnSensor.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Intent intent = new Intent(MainActivity.this, SensorMapsActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isServiceOK(){
|
public boolean isServiceOK(){
|
||||||
Log.d(TAG, "isServicesOK(): checking google services version");
|
Log.d(TAG, "isServicesOK(): checking google services version");
|
||||||
|
|
||||||
int available = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(MapsActivity.this);
|
int available = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(MainActivity.this);
|
||||||
|
|
||||||
if (available== ConnectionResult.SUCCESS){
|
if (available== ConnectionResult.SUCCESS){
|
||||||
Log.d(TAG,"isServicesOK: Google Play Services is working");
|
Log.d(TAG,"isServicesOK: Google Play Services is working");
|
||||||
@ -57,7 +67,7 @@ public class MapsActivity extends FragmentActivity {
|
|||||||
}
|
}
|
||||||
else if (GoogleApiAvailability.getInstance().isUserResolvableError(available)){
|
else if (GoogleApiAvailability.getInstance().isUserResolvableError(available)){
|
||||||
Log.d(TAG, "isServicesOK(): an error occured but we can fix it");
|
Log.d(TAG, "isServicesOK(): an error occured but we can fix it");
|
||||||
Dialog dialog = GoogleApiAvailability.getInstance().getErrorDialog(MapsActivity.this, available, ERROR_DIALOG_REQUEST);
|
Dialog dialog = GoogleApiAvailability.getInstance().getErrorDialog(MainActivity.this, available, ERROR_DIALOG_REQUEST);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -65,5 +75,4 @@ public class MapsActivity extends FragmentActivity {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
28
app/src/main/res/layout/activity_earthquake_maps.xml
Normal file
28
app/src/main/res/layout/activity_earthquake_maps.xml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".EarthquakeMapsActivity">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Shake your Smartphone for a Earthquake"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:id="@+id/txtEarthquake"/>
|
||||||
|
|
||||||
|
|
||||||
|
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:map="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_below="@+id/txtEarthquake"
|
||||||
|
android:id="@+id/map"
|
||||||
|
android:name="com.google.android.gms.maps.SupportMapFragment"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
|
||||||
|
tools:context=".EarthquakeMapsActivity" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
26
app/src/main/res/layout/activity_main.xml
Normal file
26
app/src/main/res/layout/activity_main.xml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".MainActivity">
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/btnEarthquake"
|
||||||
|
android:text="Generate Earthquake"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_centerHorizontal="true" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/btnSensor"
|
||||||
|
android:text="Be a Sensor"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_below="@id/btnEarthquake"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".map">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Map"
|
|
||||||
android:id="@+id/btnMap"/>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,16 +1,27 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".EarthquakeMapsActivity">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Timer till vibration"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:id="@+id/txtSensor"/>
|
||||||
|
|
||||||
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
|
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:map="http://schemas.android.com/apk/res-auto"
|
xmlns:map="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_below="@+id/txtSensor"
|
||||||
android:id="@+id/map"
|
android:id="@+id/map"
|
||||||
android:name="com.google.android.gms.maps.SupportMapFragment"
|
android:name="com.google.android.gms.maps.SupportMapFragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".MapsActivity" />
|
tools:context=".SensorMapsActivity" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -1,6 +1,6 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Theme.Maps0123" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
<style name="Theme.Schockwelle" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||||
<!-- Primary brand color. -->
|
<!-- Primary brand color. -->
|
||||||
<item name="colorPrimary">@color/purple_200</item>
|
<item name="colorPrimary">@color/purple_200</item>
|
||||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">maps0123</string>
|
<string name="app_name">Schockwelle</string>
|
||||||
<string name="title_activity_maps">Map</string>
|
<string name="title_activity_earthquake_maps">Map</string>
|
||||||
|
<string name="title_activity_sensor_maps">Map</string>
|
||||||
</resources>
|
</resources>
|
@ -1,6 +1,6 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Theme.Maps0123" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
<style name="Theme.Schockwelle" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||||
<!-- Primary brand color. -->
|
<!-- Primary brand color. -->
|
||||||
<item name="colorPrimary">@color/purple_500</item>
|
<item name="colorPrimary">@color/purple_500</item>
|
||||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||||
|
@ -1,20 +1,4 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<!--
|
|
||||||
TODO: Before you release your application, you need a Google Maps API key.
|
|
||||||
|
|
||||||
To do this, you can either add your release key credentials to your existing
|
|
||||||
key, or create a new key.
|
|
||||||
|
|
||||||
Note that this file specifies the API key for the release build target.
|
|
||||||
If you have previously set up a key for the debug target with the debug signing certificate,
|
|
||||||
you will also need to set up a key for your release certificate.
|
|
||||||
|
|
||||||
Follow the directions here:
|
|
||||||
|
|
||||||
https://developers.google.com/maps/documentation/android/signup
|
|
||||||
|
|
||||||
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
|
|
||||||
string in this file.
|
|
||||||
-->
|
|
||||||
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">YOUR_KEY_HERE</string>
|
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">YOUR_KEY_HERE</string>
|
||||||
</resources>
|
</resources>
|
@ -1,4 +1,4 @@
|
|||||||
package de.edotzlaff.maps0123;
|
package de.edotzlaff.schockwelle;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,4 +1,4 @@
|
|||||||
#Thu Jun 10 16:33:45 CEST 2021
|
#Mon Jun 14 19:58:23 CEST 2021
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
include ':app'
|
include ':app'
|
||||||
rootProject.name = "maps0123"
|
rootProject.name = "Schockwelle"
|
Loading…
x
Reference in New Issue
Block a user