Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ntruchsess committed Aug 30, 2019
0 parents commit 053be8c
Show file tree
Hide file tree
Showing 90 changed files with 5,589 additions and 0 deletions.
14 changes: 14 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright (C) 2018 Norbert Truchsess [email protected]

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# send2Car
Android App to send location to BMW car

46 changes: 46 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.truchsess.send2car"
minSdkVersion 16
targetSdkVersion 28
versionCode 7
versionName "7"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:preference-v7:28.0.0'

implementation 'com.google.code.gson:gson:2.8.2'

implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'

androidTestImplementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
androidTestImplementation group: 'xpp3', name: 'xpp3_min', version: '1.1.4c'
androidTestImplementation group: 'xmlpull', name: 'xmlpull', version: '1.1.3.1'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'xpp3:xpp3_min:1.1.4c'
androidTestImplementation 'xmlpull:xmlpull:1.1.3.1'
androidTestImplementation 'org.mockito:mockito-core:1.10.19'
}

456 changes: 456 additions & 0 deletions app/src/main/AndroidManifest.xml

Large diffs are not rendered by default.

168 changes: 168 additions & 0 deletions app/src/main/assets/nominatim.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
airport Flughafen
arts_centre Kunstzentrum
atm Geldautomat
auditorium Auditorium
bank Bank
bar Bar
bench Sitzbank
bicycle_parking Fahrradabstellplatz
bicycle_rental Leihfahrräder
brothel Bordell
bureau_de_change Wechselstube
bus_station Busbahnhof
cafe Cafe
car_rental Autovermietung
car_wash Autowaschanlage
casino Spielkasino
cinema Kino
clinic Krankenhaus
club Klub
college Hochschule
community_centre Gemeindezentrum
courthouse Gericht
crematorium Krematorium
dentist Zahnarzt
doctors Ärzte
dormitory Wohnheim
drinking_water Trinkwasser
driving_school Fahrschule
embassy Botschaft
emergency_phone Notruf
fast_food Fast Food
ferry_terminal Fähranlegestelle
fire_hydrant Hydrant
fire_station Feuerwache
fountain Brunnen
fuel Tankstelle
grave_yard Friedhof
hall Halle
health_centre Gesundheitszentrum
hospital Krankenhaus
hotel Hotel
hunting_stand Jagd Stand
ice_cream Eiscafe
kindergarten Kindergarten
library Bibliotek
market Markt
marketplace Marktplatz
nightclub Nachtclub
nursery Kinderkrippe
nursing_home Pflegeheim
office Büro
park Park
parking Parkplatz
pharmacy Apotheke
place_of_worship Kirche
police Polizei
post_box Briefkasten
post_office Postamt
preschool Vorschule
prison Gefängnis
pub Kneipe
public_Öffendliches Gebäude
public_market Öffendlicher Markt
reception_area Pforte
restaurant Restaurant
retirement_home Altenheim
sauna Sauna
school Schule
shelter Schutzhütte
shop Geschäft
shopping Geschäft
social_club Privater Club
studio Studio
supermarket Supermarkt
taxi Taxistand
telephone Telefon
theatre Theater
toilets Toiletten
townhall Rathaus
university Universität
veterinary Tierarzt
waste_basket Abfalleimer
wifi Wireless LAN
youth_centre Jugendzentrum
apartments Wohnungen
block Wohnblock
bunker Bunker
chapel Kapelle
church Kirche
commercial Gewerbegebäude
dormitory Wohnheim
entrance Eingang
faculty Fakultät
farm Bauernhof
flats Wohnungen
garage Werkstatt
hospital Krankenhaus
hotel Hotel
house Haus
industrial Industriegebäude
office Büro
public Öffendliches Gebäude
residential Straße im Wohngebiet
living_street Verkehrsberuhigter Bereich
retail Einzelhandel
school Schule
shop Geschäft
stadium Stadion
store Geschäft
terrace Terasse
tower Turm
train_station Bahnhof
university Universität
bridleway Reitweg
bus_stop Bushaltestelle
construction Baustelle
cycleway Radweg
distance_marker Entfernungsangabe
emergency_access_point Anfahrtspunkt für Rettungsfahrzeuge
footway Fußweg
gate Gatter
motorway Autobahn
motorway_junction Abzweigung Autobahn
path Pfad
pedestrian Fußgängerzone
platform Bahnsteig
primary Hauptstraße
primary_link Abzeigung Hauptstraße
raceway Rennstrecke
road Straße
secondary Sekundärstraße
secondary_link Abzweigung Sekundärstraße
services Versorgungsstraße
steps Treppe
tertiary Nebenstraße
track Wirtschaftsweg
trail Pfad
trunk Ausfallstraße
trunk_link Abzweigung Ausfallstraße
unsurfaced Unbefestigte Straße
archaeological_site Archaelogische Stätte
battlefield Schlachtfeld
historisches Gebäude
castle Burg
church Kirche
house historisches Gebäude
icon Bildzeichen
manor Landgut
memorial Gedenkstätte
mine Bergwerk
monument Denkmal
museum Museum
ruins Ruinen
tower Turm
wayside_cross Kreuz
wayside_shrine Schrein
wreck Wrack
cemetery Friedhof
commercial Gewerbegebiet
construction Baustelle
farm Bauernhof
farmland Feld
farmyard Feld
forest Wald
grass Grass
industrial Industriegebiet
water Wasserfläche
camp_site Campingplatz
108 changes: 108 additions & 0 deletions app/src/main/java/com/truchsess/send2car/GeoFragment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package com.truchsess.send2car;

import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.truchsess.send2car.geo.GeoUrl;

/**********************************************************************************************
Copyright (C) 2018 Norbert Truchsess [email protected]
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
**********************************************************************************************/
public class GeoFragment extends Fragment {

private EditText mEditTextLat;
private EditText mEditTextLon;
private EditText mEditTextDescription;

private Listener mListener;

public void setListener(Listener listener) {
mListener = listener;
}

public interface Listener {
void onLookupGeoDataClicked();
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {

final View view = inflater.inflate(R.layout.fragment_geo, container, false);

mEditTextLat = view.findViewById(R.id.editTextLat);
mEditTextLon = view.findViewById(R.id.editTextLon);
mEditTextDescription = view.findViewById(R.id.editTextDescription);

view.findViewById(R.id.buttonClearLat).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mEditTextLat.setText("");
}
});

view.findViewById(R.id.buttonClearLon).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mEditTextLon.setText("");
}
});

view.findViewById(R.id.buttonClearDescription).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mEditTextDescription.setText("");
}
});

view.findViewById(R.id.buttonLookupGeodata).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mListener != null) {
mListener.onLookupGeoDataClicked();
}
}
});

return view;
}

public void setGeoUrl(final GeoUrl geoUrl) {
mEditTextLat.setText(geoUrl != null && geoUrl.isValid() ? GeoUrl.degreeToString(geoUrl.getLat()) : " - ");
mEditTextLon.setText(geoUrl != null && geoUrl.isValid() ? GeoUrl.degreeToString(geoUrl.getLon()) : " - ");
mEditTextDescription.setText(geoUrl == null || geoUrl.getDescription() == null ? " - " : geoUrl.getDescription());
}

public GeoUrl getGeoUrl() {
double lat = Double.NaN;
double lon = Double.NaN;

try {
lat = Double.parseDouble(mEditTextLat.getText().toString());
lon = Double.parseDouble(mEditTextLon.getText().toString());
} catch (NumberFormatException nfe) {
}

return new GeoUrl(lat,lon,mEditTextDescription.getText().toString());
}
}
Loading

0 comments on commit 053be8c

Please sign in to comment.