21 Commits

Author SHA1 Message Date
Robin Koedood
b2c320dd14 [UPDATED] Route Test 2021-01-06 17:12:52 +01:00
Sem van der Hoeven
ce264d78bc rename 2021-01-06 17:09:11 +01:00
Robin Koedood
f8acc35c5b Merge remote-tracking branch 'origin/follow-route' into follow-route 2021-01-06 17:07:47 +01:00
Robin Koedood
e5e0916555 [ADD] Static Data Test 2021-01-06 17:07:26 +01:00
Sem van der Hoeven
c738deab23 commentssssssssssssssssssssss 2021-01-06 17:06:27 +01:00
Sem van der Hoeven
223e77cdc8 Merge branch 'follow-route' of https://github.com/SemvdH/Next-Location into follow-route 2021-01-06 16:57:08 +01:00
Sem van der Hoeven
7c9dc07c3d added keeping zoom level 2021-01-06 16:56:57 +01:00
Robin Koedood
187f45b770 Merge remote-tracking branch 'origin/follow-route' into follow-route 2021-01-06 16:56:21 +01:00
Robin Koedood
04487b77a7 [ADD] RouteHandler Test 2021-01-06 16:56:16 +01:00
RemoMeijer
d67d78b385 Added total distance in route detail 2021-01-06 16:27:28 +01:00
Sem van der Hoeven
fb2f7e8a66 added updating time when you start a route but are already following another one 2021-01-06 16:20:03 +01:00
Sem van der Hoeven
c412f36e6c moved sections into own methods 2021-01-06 16:09:00 +01:00
RemoMeijer
2d9dfe9c0e updated coords 2021-01-06 15:53:02 +01:00
RemoMeijer
b31ba7023e Updated coordinates 2021-01-06 15:50:43 +01:00
Sem van der Hoeven
7ba87b71b0 added time 2021-01-06 15:44:14 +01:00
Sem van der Hoeven
edfc125427 added icon 2021-01-06 15:37:10 +01:00
Sem van der Hoeven
6d3a092298 Merge branch 'follow-route' of https://github.com/SemvdH/Next-Location into follow-route 2021-01-06 15:32:35 +01:00
Sem van der Hoeven
15608bed2b added icon to drawable 2021-01-06 15:32:25 +01:00
RemoMeijer
deb4bd5a19 Distance Calculation works, added distance test 2021-01-06 15:26:07 +01:00
Sem van der Hoeven
05c8951f2c Merge branch 'follow-route' of https://github.com/SemvdH/Next-Location into follow-route 2021-01-06 15:25:36 +01:00
Sem van der Hoeven
a27ebfc0c3 added stopping route if last location has been reached 2021-01-06 14:40:30 +01:00
45 changed files with 504 additions and 370 deletions

View File

@@ -11,9 +11,9 @@
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@drawable/next_location_icon"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@drawable/next_location_icon"
android:supportsRtl="true"
android:theme="@style/Theme.NextLocation"
android:hardwareAccelerated="false">

View File

@@ -1,10 +0,0 @@
[
{
"code": "KROKET10",
"reward": "Gratis 2e kroket bij Kees Kroket™"
},
{
"code": "654",
"reward": ",juygly"
}
]

View File

@@ -1,135 +0,0 @@
[
{
"name":"McDonald's Breda Karnemelkstraat",
"coordinates":"51.58596318905295,4.77586651481887",
"description":"Wist je dat McDonalds de grootste restaurantketen ter wereld is? Hierdoor hebben we een indrukwekkende geschiedenis. Maar wij kijken liever naar onze toekomst. Nieuwe restaurants, betere producten en duurzaam ondernemen.",
"imageUrl":"mc_donalds"
},
{
"name":"Subway Karnemelkstraat 10 A, 1",
"coordinates":"51.58632782568612,4.775219531501114",
"description":"Subway is een Amerikaanse multinationale fastfoodketen die voornamelijk sandwiches verkoopt. Het bedrijf onderscheidt zich van veel andere broodjeszaken doordat de klant zelf de sandwich kan laten samenstellen. Subway werkt met franchisenemers. Het bedrijf heeft bijna 45.000 vestigingen in alle werelddelen.",
"imageUrl":"subway"
},
{
"name":"Wok To Go Halstraat 40",
"coordinates":"51.58650312572897,4.777467069592386",
"description":"Bij Wok To Go houden we van snelle, gezonde en smaakvolle maaltijden. Sinds 2003 ontwikkelen onze chef-koks de lekkerste wokgerechten met verse ingrediënten. We doen dit vól overgave onder het motto “Making people happy through food”. Door het roerbakken met een kleine hoeveelheid olie op grote hitte, blijven de smaak en gezonde voedingsstoffen bewaard. We kiezen voor gezonde en unieke ingrediënten en bereiden uitgebalanceerde gerechten in een Wokki box voor een gezonde levensstijl.",
"imageUrl":"wok_to_go"
},
{
"name":"De Boterhal Grote Markt 19",
"coordinates":"51.588069667604756,4.7762685632180695",
"description":"De Boterhal in Breda is een internationaal tapasrestaurant, speciaalbiercafé en wijnbar. Men kan gezellig bij ons lunchen, borrelen en dineren. Wij hebben een uitgebreide menukaart met een hele hoop bieren, wijnen, zowel per glas als per fles te verkrijgen, lunch en tapasgerechtjes. Naast het eten wat wij serveren hebben we ook een hoop bieren en wijnen. Naast de bieren op de kaart hebben wij wisselende bieren; vijf ketelbieren en vijf seizoensbieren.",
"imageUrl":"de_boter_hal"
},
{
"name":"Gauchos Grote Markt 33",
"coordinates":"51.58859328857082,4.77601349563689",
"description":"De middeleeuwse Grote Markt is een historische plek in het Bourgondische hart van Breda, ooit in handen van de Spaanse bezetter. Gauchos Grill-Restaurant combineert daar Brabantse gemoedelijkheid met professionele gastvrijheid. In onze Latijnse keuken bereiden wij op uw aanwijzing een malse Argentijnse steak of een smakelijk visgerecht van de grill.",
"imageUrl":"gauchos"
},
{
"name":"The Tosti Club Breda A4, Vlaszak 2",
"coordinates":"51.58905632735254,4.780729463841719",
"description":"Je kunt bij al onze vestigingen de hele dag terecht, want bij The Tosti Club eet je het klokje rond. Dus kom gezellig ontbijten, lunchen of voor een snelle hap aan het einde van de dag (wat dacht je van onze The Tosti Slice, onze variant op pizza!). Even geen zin in brood? Dan kunnen we je ook verblijden met onder andere acaï smoothiebowls, pancakes, granolas / yoghurt of gewoon een lekkere warme drank met gebak. Mogen we je de Red Velvet fudge cake aanraden?",
"imageUrl":"the_tosti_club"
},
{
"name":"Coffee & Lunch 4 you Oude Vest 31",
"coordinates":"51.58741730235298,4.779832967540571",
"description":"Welkom bij Coffee & Lunch 4 you! Onze sfeervolle lunchroom is gelegen in het centrum van Breda, in de directe nabijheid van de parkeergarage en de fietsenstalling.",
"imageUrl":"coffee_and_lunch"
},
{
"name":"t Zusje Breda Vismarktstraat 28",
"coordinates":"51.590133292554434,4.773911506170458",
"description":"Dat is een avond bij t Zusje. Gezellig samenzijn in een huiselijke sfeer en genieten van onze kleine gerechtjes, die je de hele avond kunt bestellen. Bij t Zusje ben je thuis: jij bepaalt zelf de invulling van de avond.\nWe horen graag wat je wensen zijn, vinden het leuk je te verrassen met bijzondere gerechtjes en zetten graag die extra stap. We bieden je een avond uit, zoals wij die zelf ook graag zien. Avondvullend Bourgondisch genieten? In het prachtige pand van ons Zusje in Breda beleef je een gezellige avond met avondvullend tapas eten voor 31,80.\nBel snel en reserveer!",
"imageUrl":"t_zusje_breda"
},
{
"name":"VR-World Nassaustraat 2",
"coordinates":"51.5913566342086,4.786256804321071",
"description":"Virtual Reality is hét uitje van dit moment. Zombies verslaan, vuurballen schieten of met laserzwaarden vechten, met Virtual Reality is niks te gek. Bij VR World zijn we elke dag opzoek naar de nieuwste experiences voor jullie.\n\nWat dacht je bijvoorbeeld van een Escape Room, maar dan in Virtual Reality? Bij VR World bieden wij de nieuwste Escapes aan op het gebied van Virtual Reality. Ontsnap bijvoorbeeld uit een Piramide of ontmantel een raket. Durf jij deze uitdaging aan?\n\nVR World is gelegen op een unieke locatie, namelijk de koepelgevangenis van Breda. Deze gevangenis was tot 2016 nog in werking en daarna hebben bedrijven er hun intrek genomen, zo ook VR World.",
"imageUrl":"vr_world"
},
{
"name":"Kees Kroket Houtmarkt 9",
"coordinates":"51.58647180329833,4.77741809637617",
"description":"KEEEEES KROKET! Al meer dan tien jaar is Kees Kroket in het centrum van Breda gevestigd, vlakbij het winkelend publiek. Eerst in de welbekende Houtmarktpassage en sinds april 2019 zijn we gevestigd op onze nieuwe locatie aan de Houtmarkt 9. U proeft de kwaliteit bij onze verse frites. Deze, uit de Agria aardappel gesneden frites, wordt in zonnebloemolie voorgebakken en in een mix van plantaardige oliën afgebakken. Dit zorgt niet alleen voor de heerlijke smaak maar ook dat onze frites relatief weinig verzadigde vetten en transvetzuren bevat, waardoor we van het beeldmerk Verantwoord Frituren gebruik mogen maken.",
"imageUrl":"kees_kroket"
},
{
"name":"Prison Escape Kloosterlaan 168",
"coordinates":"51.59073795635181,4.784917104321059",
"description":"Prison Escape duurt in het totaal 3 uur en je hebt als doel om te ontsnappen uit de zwaarbewaakte gevangenis. Een cast van 25 acteurs brengt de ervaring tot leven en het is aan jou om een weg naar buiten te vinden. In de gevangenis zijn verschillende objecten verstopt die het wellicht makkelijker zouden kunnen maken om de weg naar buiten te realiseren.\n\nWees op je hoede, kijk goed om je heen, vertrouw (bijna) niemand en stap op mensen af..\nDe klok tikt en jij hebt 1 doel: de weg naar de vrijheid vinden.",
"imageUrl":"prison_escape_room"
},
{
"name":"De Koepel - FutureDome Events Nassausingel 26",
"coordinates":"51.590431588532105,4.786756741648511",
"description":"n groepen word je onder begeleiding van een van onze gidsen rondgeleid langs de meest unieke en mooiste monumentale plekken in en rondom de Koepel!\n\u200B\n\nDe gids zal hierbij op de verschillende locaties toelichting geven over het roemruchte verleden. De rondleiding over het gevangenisterrein brengt u onder andere langs de koepel, de authentieke kapel, vrouwengevangenis, verschillende luchtplaatsen en het oude gerechtsgebouw.",
"imageUrl":"de_koepel_future_events"
},
{
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
"coordinates":" 51.59110835530862,4.784147222780912",
"description":"Escaping Breda is een nieuwe moderne locatie en heeft op dit moment 2 avontuurlijke escape rooms. Daarnaast komen er volgend jaar nog 2 extra escape rooms bij. \n\nOntsnap uit de spannende escape room Lets Rob The Bank, een kamer geschikt voor volwassenen én kinderen. Ontsnap je liever uit een escape room met een hoger spannings- en spelniveau? Kies dan voor Patient X.\n\nOp onze locatie in Breda hebben we ook een gezellig boardgame café. Combineer je ontsnapping met een drankje, hapje en alle gratis boardgames.\n\nEscaping Breda is de perfecte plek voor een uitje met je familie, vrienden of collegas.",
"imageUrl":"escaping_room"
},
{
"name":"MEZZ Breda Keizerstraat 101",
"coordinates":"51.58394697737321,4.779757901349616",
"description":"MEZZ is een open club, betrokken, nieuwsgierig en onderzoekend. MEZZ heeft humor, is gevat, soms provocatief en verrassend. Beleving en plezier staan centraal waarbij wij bottom up denken. Wij zijn er voor jou, jouw MEZZ. Heb je ideeën of wil je meer weten, neem contact op. Wij reageren altijd.",
"imageUrl":"mezz_breda"
},
{
"name":"Het Klooster Breda Schorsmolenstraat 13",
"coordinates":"51.58775443759389,4.765568874365066",
"description":"In dit oude Kapucijnenklooster wordt een woon- en werkgemeenschap gevestigd onder de naam\n”Het Klooster Breda”. \nMet de inkomsten uit bedrijvigheid wordt 12 mensen die dakloos zijn onderdak geboden, van waaruit zij zich weer een plek in de samenleving kunnen verwerven.",
"imageUrl":"het_klooster_breda"
},
{
"name":"Beach & Lounge club Spider “rooftop bar” Nieuwe Prinsenkade",
"coordinates":"51.59212977605884,4.774043765582372",
"description":"Beach & Lounge Club Spider staat bekent om zijn immens populaire locatie in Bergen op Zoom. Sinds 2020 heeft deze hoog segment lounge club een tweede locatie geopend in Breda genaamd Beach & Lounge Club Spider Rooftop Bar.",
"imageUrl":"beach_and_lounge_club"
},
{
"name":"Koningin Wilhelmina Paviljoen Kraanstraat 4b",
"coordinates":"51.590645369292396,4.776045124415531",
"description":"Koningin Wilhelmina Paviljoen is een bouwwerk in Breda Centrum in Breda. Het behoort tot de Koninklijke Militaire Academie (KMA) en bezit de status van rijksmonument. Het staat aan het Kasteelplein 15, vlak voor het Kasteel van Breda. Het ligt met de voorgevel aan de westkant van de oprijlaan van het kasteel, met de lange rechterzijgevel aan de kasteelgracht en de lange linkerzijgevel aan de Cingelstraat.",
"imageUrl":"koningin_wilhelimna_paviljoen"
},
{
"name":"Hercules en de Nemeïsche leeuw",
"coordinates":"51.59130522182325,4.778161739135078",
"description":"Het beeld toont Hercules met de huid van de Nemeïsche leeuw. Herakles of Hercules is een figuur uit de Griekse mythologie. Hij was een Griekse heros en werd beroemd om de 12 moeilijke werken die hij uitvoerde in opdracht van koning Eurystheus. Het beeld maakt onderdeel uit van 17 anderen zandstenen beelden die Willem III tussen 1670 en 1686 kocht. De beelden stonden verdeeld over grasperken in het Valkenberg park.\nHercules is het enige originele beeld dat overgebleven is.",
"imageUrl":"hercules_park_valkenburg"
},
{
"name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1",
"coordinates":"51.592530636759136,4.780278353833301",
"description":"Het Baroniemonument of Nassau-Baroniemonument is een beeld van de Nederlandse architect Pierre Cuypers. Het staat in het Park Valkenberg in Breda. Het monument werd geplaatst ter herinnering aan de 500-jarige band (1904) tussen Breda en het huis Oranje-Nassau. In 1404 werd Engelbrecht I van Nassau-Siegen gehuldigd als heer van Breda.",
"imageUrl":"nassau_baroniemonument"
},
{
"name":"Station Breda Gravinnen van Nassauboulevard 43",
"coordinates":"51.59569850758307,4.780295549958155",
"description":"Station Breda is het centrale spoorwegstation van de Nederlandse stad Breda. Het bevindt zich ten noorden van het centrum van de stad. Omliggende wijken zijn Stationskwartier en Drie Hoefijzers aan de zuidkant, en aan de noordzijde Belcrum, Doornbos-Linie en Havenkwartier.\n\nHet eerste station in Breda werd geopend op 1 mei 1855, toen de Spoorlijn Roosendaal - Breda werd geopend. Dit station werd in 1863 door een nieuw gebouw vervangen, toen de lijn naar Tilburg werd geopend. Omdat Breda toen nog een vesting was en het station onder de beperkingen van de Vestingwet viel, was het zodanig uitgevoerd dat het in tijden van oorlog snel gesloopt zou kunnen worden.",
"imageUrl":"station_breda"
},
{
"name":"Belcrum Beach Veilingkade 12a",
"coordinates":"51.599434239284726,4.76632797992092",
"description":"Belcrum Beach is HET stadsstrand van Breda, gelegen op het Haveneiland in de wijk Belcrum. Wij zijn begonnen in 2013 op deze unieke lokatie in Breda. Het strand werkt met drie beheerders en een groot aantal vrijwilligers voor bar, onderhoud, programmering, sponsoring en tuin. Een plek om te relaxen met een drankje en een hapje, genietend van de zon, gezellig kletsen met je vrienden, luisterend naar muziek van een band of DJ, soms in een festival setting. Kinderen die kunnen spelen in het zand of mee kunnen doen aan speciale kinderactiviteiten. Belcrum Beach is ook een unieke lokatie voor een feestje of om je verjaardag te vieren, trouwen op het strand of een trouwfeest behoren ook tot de mogelijkheden.",
"imageUrl":"belcrum_beach"
},
{
"name":"De Belcrum Watertoren (1935) Speelhuislaan 158",
"coordinates":"51.60135351009892,4.7705765989322755",
"description":"De watertoren in de Belcrum in Breda is een industrieel monument uit het interbellum. De toren is de thuisbasis voor SOAB adviseurs voor woning en leefomgeving en onderstreept de missie van ons bureau. De toren hoort bij de Belcrum. Als landmark en als onderdak voor activiteiten. Zo vierden de Belcrummers hun 400 jaar bestaan in de toren en worden lunches met rondleiding op hoog niveau georganiseerd. Kijken en proeven.",
"imageUrl":"belcrum_watertoren"
}
]

View File

@@ -1,135 +1,135 @@
[
{
"name":"McDonald's Breda Karnemelkstraat",
"coordinates":"51.58596318905295,4.77586651481887",
"description":"Did you know McDonald's is the largest restaurant chain in the world? This gives us an impressive history. But we prefer to look at our future. New restaurants, better products, and sustainable entrepreneurship.",
"coordinates":"51.586062613842245, 4.77579695141302",
"description":"Wist je dat McDonalds de grootste restaurantketen ter wereld is? Hierdoor hebben we een indrukwekkende geschiedenis. Maar wij kijken liever naar onze toekomst. Nieuwe restaurants, betere producten en duurzaam ondernemen. Wil je meer weten over McDonalds? Lees verder op: https://www.mcdonalds.com/nl/nl-nl/over-ons.html!",
"imageUrl":"mc_donalds"
},
{
"name":"Subway Karnemelkstraat 10 A, 1",
"coordinates":"51.58632782568612,4.775219531501114",
"description":"Subway is an American multinational fast-food chain that mainly sells sandwiches. The company distinguishes itself from many other sandwich shops because the customer can have the sandwich put together themselves. Subway works with franchises. The company has nearly 45,000 offices on all continents.",
"coordinates":"51.58604142340411, 4.7751359436675545",
"description":"Subway is een Amerikaanse multinationale fastfoodketen die voornamelijk sandwiches verkoopt. Het bedrijf onderscheidt zich van veel andere broodjeszaken doordat de klant zelf de sandwich kan laten samenstellen. Subway werkt met franchisenemers. Het bedrijf heeft bijna 45.000 vestigingen in alle werelddelen.",
"imageUrl":"subway"
},
{
"name":"Wok To Go Halstraat 40",
"coordinates":"51.58650312572897,4.777467069592386",
"description":"At Wok To Go we love fast, healthy and tasty meals. Since 2003 our chefs have been developing the most delicious wok dishes with fresh ingredients. We do this with complete dedication under the motto “ Making people happy through food ”. By stir-frying - with a small amount of oil - on high heat, the taste and healthy nutrients are preserved. We choose healthy and different ingredients and prepare balanced courses in a 'Wokki box' for a healthy lifestyle. ",
"coordinates":"51.586464146477574, 4.777606887874218",
"description":"Bij Wok To Go houden we van snelle, gezonde en smaakvolle maaltijden. Sinds 2003 ontwikkelen onze chef-koks de lekkerste wokgerechten met verse ingrediënten. We doen dit vól overgave onder het motto “Making people happy through food”. Door het roerbakken met een kleine hoeveelheid olie op grote hitte, blijven de smaak en gezonde voedingsstoffen bewaard. We kiezen voor gezonde en unieke ingrediënten en bereiden uitgebalanceerde gerechten in een Wokki box voor een gezonde levensstijl.",
"imageUrl":"wok_to_go"
},
{
"name":"De Boterhal Grote Markt 19",
"coordinates":"51.588069667604756,4.7762685632180695",
"description":"De Boterhal in Breda is an international tapas restaurant, specialty beer café, and wine bar. You can enjoy lunch, drinks, and dinner with us. We have an extensive menu with a lot of beers, wines, both per glass and per bottle, lunch, and tapas dishes. In addition to the food we serve, we also have a lot of beers and wines. In addition to the beers on the menu, we have varying beers: five kettle beers and five seasonal beers. ",
"coordinates":"51.58798747205394, 4.776265846483903",
"description":"De Boterhal in Breda is een internationaal tapasrestaurant, speciaalbiercafé en wijnbar. Men kan gezellig bij ons lunchen, borrelen en dineren. Wij hebben een uitgebreide menukaart met een hele hoop bieren, wijnen, zowel per glas als per fles te verkrijgen, lunch en tapasgerechtjes. Naast het eten wat wij serveren hebben we ook een hoop bieren en wijnen. Naast de bieren op de kaart hebben wij wisselende bieren; vijf ketelbieren en vijf seizoensbieren.",
"imageUrl":"de_boter_hal"
},
{
"name":"Gauchos Grote Markt 33",
"coordinates":"51.58859328857082,4.77601349563689",
"description":"The medieval Grote Markt is a historic place in the Burgundian heart of Breda, once in the hands of the Spanish occupier. Gauchos Grill-Restaurant combines Brabant conviviality with professional hospitality. In our Latin kitchen, we prepare a tender Argentinian steak or a tasty fish dish from the grill. ",
"coordinates":"51.588449106286255, 4.77604936398091",
"description":"De middeleeuwse Grote Markt is een historische plek in het Bourgondische hart van Breda, ooit in handen van de Spaanse bezetter. Gauchos Grill-Restaurant combineert daar Brabantse gemoedelijkheid met professionele gastvrijheid. In onze Latijnse keuken bereiden wij op uw aanwijzing een malse Argentijnse steak of een smakelijk visgerecht van de grill.",
"imageUrl":"gauchos"
},
{
"name":"The Tosti Club Breda A4, Vlaszak 2",
"coordinates":"51.58905632735254,4.780729463841719",
"description":"You can go to all our branches all day because at The Tosti Club you eat around the clock. So come for breakfast, lunch, or a quick bite at the end of the day (how about our The Tosti Slice, our variant on pizza!). If you don't feel like bread, then we can also delight you with acai smoothie bowls, pancakes, granolas/yogurt, or just a nice hot drink with cake. Can we recommend the Red Velvet fudge cake?",
"coordinates":"51.588922458012384, 4.7804923888638",
"description":"Je kunt bij al onze vestigingen de hele dag terecht, want bij The Tosti Club eet je het klokje rond. Dus kom gezellig ontbijten, lunchen of voor een snelle hap aan het einde van de dag (wat dacht je van onze The Tosti Slice, onze variant op pizza!). Even geen zin in brood? Dan kunnen we je ook verblijden met onder andere acaï smoothiebowls, pancakes, granolas / yoghurt of gewoon een lekkere warme drank met gebak. Mogen we je de Red Velvet fudge cake aanraden?",
"imageUrl":"the_tosti_club"
},
{
"name":"Coffee & Lunch 4 you Oude Vest 31",
"coordinates":"51.58741730235298,4.779832967540571",
"description":"Welcome to Coffee & Lunch 4 you! Our atmospheric lunchroom is located in the center of Breda, near the parking garage and the bicycle shed.",
"coordinates":"51.587223367256605, 4.779547820326475",
"description":"Welkom bij Coffee & Lunch 4 you! Onze sfeervolle lunchroom is gelegen in het centrum van Breda, in de directe nabijheid van de parkeergarage en de fietsenstalling.",
"imageUrl":"coffee_and_lunch"
},
{
"name":"t Zusje Breda Vismarktstraat 28",
"coordinates":"51.590133292554434,4.773911506170458",
"description":"That is an evening at 't Zusje. Cozy get-together in a homely atmosphere and enjoy our small dishes, which you can order all evening. At' t Zusje you are at home: you determine the content of the evening yourself. \nWe would like to hear what your wishes are, would like to surprise you with special dishes, and would like to go the extra mile. We offer you an evening out, as we would like to see in ourselves. Enjoy a full evening of Burgundian? In the beautiful building of our Zusje in Breda, you will experience a pleasant evening with full evening tapas food for 31.80. \nCall quickly and book!",
"coordinates":"51.589820093624986, 4.773333478675191",
"description":"Dat is een avond bij t Zusje. Gezellig samenzijn in een huiselijke sfeer en genieten van onze kleine gerechtjes, die je de hele avond kunt bestellen. Bij t Zusje ben je thuis: jij bepaalt zelf de invulling van de avond.\nWe horen graag wat je wensen zijn, vinden het leuk je te verrassen met bijzondere gerechtjes en zetten graag die extra stap. We bieden je een avond uit, zoals wij die zelf ook graag zien. Avondvullend Bourgondisch genieten? In het prachtige pand van ons Zusje in Breda beleef je een gezellige avond met avondvullend tapas eten voor 31,80.\nBel snel en reserveer!",
"imageUrl":"t_zusje_breda"
},
{
"name":"VR-World Nassaustraat 2",
"coordinates":"51.5913566342086,4.786256804321071",
"description":"Virtual Reality is the outing of the moment. Beating zombies, shooting fireballs, or fighting with laser swords, nothing is too crazy with Virtual Reality. At VR World we are looking every day for the newest experiences for you. \n\nWhat about for an example of an Escape Room, but in Virtual Reality? At VR World we offer the latest Escapes in Virtual Reality. Escape from a Pyramid or dismantle a rocket, for example. Do you dare to take on this challenge? \n\nVR World is located at a unique location, namely the dome prison of Breda. This prison was still in operation until 2016 and then companies moved in, including VR World.",
"coordinates":"51.5915020518371, 4.786101713659277",
"description":"Virtual Reality is hét uitje van dit moment. Zombies verslaan, vuurballen schieten of met laserzwaarden vechten, met Virtual Reality is niks te gek. Bij VR World zijn we elke dag opzoek naar de nieuwste experiences voor jullie.\n\nWat dacht je bijvoorbeeld van een Escape Room, maar dan in Virtual Reality? Bij VR World bieden wij de nieuwste Escapes aan op het gebied van Virtual Reality. Ontsnap bijvoorbeeld uit een Piramide of ontmantel een raket. Durf jij deze uitdaging aan?\n\nVR World is gelegen op een unieke locatie, namelijk de koepelgevangenis van Breda. Deze gevangenis was tot 2016 nog in werking en daarna hebben bedrijven er hun intrek genomen, zo ook VR World.",
"imageUrl":"vr_world"
},
{
"name":"Kees Kroket Houtmarkt 9",
"coordinates":"51.58647180329833,4.77741809637617",
"description":"KEEEEES KROKET! For more than ten years, Kees Kroket has been located in the center of Breda, close to shoppers. First in the well-known Houtmarktpassage and since April 2019, we have been located at our new location at Houtmarkt 9. You can taste the quality of our fresh fries. These fries, cut from the Agria potato, are pre-fried in sunflower oil and finished in a mix of vegetable oils. This not only ensures the delicious taste, but also that our fries contain relatively little saturated fats and trans-fatty acids, so may use the logo 'Responsible Frying'.",
"coordinates":"51.58628401688983, 4.776977039420005",
"description":"KEEEEES KROKET! Al meer dan tien jaar is Kees Kroket in het centrum van Breda gevestigd, vlakbij het winkelend publiek. Eerst in de welbekende Houtmarktpassage en sinds april 2019 zijn we gevestigd op onze nieuwe locatie aan de Houtmarkt 9. U proeft de kwaliteit bij onze verse frites. Deze, uit de Agria aardappel gesneden frites, wordt in zonnebloemolie voorgebakken en in een mix van plantaardige oliën afgebakken. Dit zorgt niet alleen voor de heerlijke smaak maar ook dat onze frites relatief weinig verzadigde vetten en transvetzuren bevat, waardoor we van het beeldmerk Verantwoord Frituren gebruik mogen maken.",
"imageUrl":"kees_kroket"
},
{
"name":"Prison Escape Kloosterlaan 168",
"coordinates":"51.59073795635181,4.784917104321059",
"description":"Prison Escape lasts a total of 3 hours and your goal is to escape the maximum-security prison. A cast of 25 actors brings the experience to life and it's up to you to find your way out. Hidden objects that might make it easier to realize the way out. \n\nBe careful, look around you, trust (almost) nobody, and approach people .. \nThe clock is ticking and you have 1 goal: to find the way to freedom.",
"coordinates":"51.59062116889821, 4.784611234825872",
"description":"Prison Escape duurt in het totaal 3 uur en je hebt als doel om te ontsnappen uit de zwaarbewaakte gevangenis. Een cast van 25 acteurs brengt de ervaring tot leven en het is aan jou om een weg naar buiten te vinden. In de gevangenis zijn verschillende objecten verstopt die het wellicht makkelijker zouden kunnen maken om de weg naar buiten te realiseren.\n\nWees op je hoede, kijk goed om je heen, vertrouw (bijna) niemand en stap op mensen af..\nDe klok tikt en jij hebt 1 doel: de weg naar de vrijheid vinden.",
"imageUrl":"prison_escape_room"
},
{
"name":"De Koepel - FutureDome Events Nassausingel 26",
"coordinates":"51.590431588532105,4.786756741648511",
"description":"In groups, you will be guided by one of our guides across the most unique and beautiful monumental places in and around the Dome! \n\n The guide will explain the illustrious past at the various locations. tour of the prison grounds will take you past the dome, the authentic chapel, women's prison, various air places, and the old court building.",
"coordinates":"51.59010624820322, 4.788301630342321",
"description":"n groepen word je onder begeleiding van een van onze gidsen rondgeleid langs de meest unieke en mooiste monumentale plekken in en rondom de Koepel!\n\u200B\n\nDe gids zal hierbij op de verschillende locaties toelichting geven over het roemruchte verleden. De rondleiding over het gevangenisterrein brengt u onder andere langs de koepel, de authentieke kapel, vrouwengevangenis, verschillende luchtplaatsen en het oude gerechtsgebouw.",
"imageUrl":"de_koepel_future_events"
},
{
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
"coordinates":" 51.59110835530862,4.784147222780912",
"description":"Escaping Breda is a new modern location and currently has 2 adventurous escape rooms. Besides, 2 extra escape rooms will be added next year. \n\nEscape from the exciting escape room Let's Rob The Bank, a room suitable for adults and children. If you prefer to escape from an escape room with a higher level of excitement and play, then choose Patient X. \n\nOt our location in Breda we also have a cozy board game café. Combine your escape with a drink, snack, and all free board games. \n\nEscaping Breda is the perfect place for an outing with your family, friends, or colleagues.",
"coordinates":"51.59096347875923, 4.783722665161644",
"description":"Escaping Breda is een nieuwe moderne locatie en heeft op dit moment 2 avontuurlijke escape rooms. Daarnaast komen er volgend jaar nog 2 extra escape rooms bij. \n\nOntsnap uit de spannende escape room Lets Rob The Bank, een kamer geschikt voor volwassenen én kinderen. Ontsnap je liever uit een escape room met een hoger spannings- en spelniveau? Kies dan voor Patient X.\n\nOp onze locatie in Breda hebben we ook een gezellig boardgame café. Combineer je ontsnapping met een drankje, hapje en alle gratis boardgames.\n\nEscaping Breda is de perfecte plek voor een uitje met je familie, vrienden of collegas.",
"imageUrl":"escaping_room"
},
{
"name":"MEZZ Breda Keizerstraat 101",
"coordinates":"51.58394697737321,4.779757901349616",
"description":"MEZZ is an open club, involved, curious and inquisitive. MEZZ has humor, is witty, sometimes provocative, and surprising. Experience and fun are central where we think bottom-up. We are there for you, your MEZZ. Do you have ideas or will you want to know more, contact us. We always respond.",
"coordinates":"51.58361639477683, 4.778550518987883",
"description":"MEZZ is een open club, betrokken, nieuwsgierig en onderzoekend. MEZZ heeft humor, is gevat, soms provocatief en verrassend. Beleving en plezier staan centraal waarbij wij bottom up denken. Wij zijn er voor jou, jouw MEZZ. Heb je ideeën of wil je meer weten, neem contact op. Wij reageren altijd.",
"imageUrl":"mezz_breda"
},
{
"name":"Het Klooster Breda Schorsmolenstraat 13",
"coordinates":"51.58775443759389,4.765568874365066",
"description":"In this old Capuchin monastery a living and working community will be established under the name\" Het Klooster Breda \". \nWith the income from activities, 12 people who are homeless are offered shelter, from which they can regain a place in society .",
"coordinates":"51.587727575660196, 4.7649956643240525",
"description":"In dit oude Kapucijnenklooster wordt een woon- en werkgemeenschap gevestigd onder de naam\n”Het Klooster Breda. \nMet de inkomsten uit bedrijvigheid wordt 12 mensen die dakloos zijn onderdak geboden, van waaruit zij zich weer een plek in de samenleving kunnen verwerven.",
"imageUrl":"het_klooster_breda"
},
{
"name":"Beach & Lounge club Spider “rooftop bar” Nieuwe Prinsenkade",
"coordinates":"51.59212977605884,4.774043765582372",
"description":"Beach & Lounge Club Spider is known for its immensely popular location in Bergen op Zoom. Since 2020, this high segment lounge club has opened a second location in Breda called Beach & Lounge Club Spider Rooftop Bar.",
"coordinates":"51.59138317151629, 4.771525073666575",
"description":"Beach & Lounge Club Spider staat bekent om zijn immens populaire locatie in Bergen op Zoom. Sinds 2020 heeft deze hoog segment lounge club een tweede locatie geopend in Breda genaamd Beach & Lounge Club Spider Rooftop Bar.",
"imageUrl":"beach_and_lounge_club"
},
{
"name":"Koningin Wilhelmina Paviljoen Kraanstraat 4b",
"coordinates":"51.590645369292396,4.776045124415531",
"description":"Queen Wilhelmina Pavilion is a building in Breda Center in Breda. It belongs to the Royal Military Academy (KMA) and has the status of a national monument. It is located at Kasteelplein 15, just in front of Breda Castle. the west side of the driveway of the castle, with the long right side wall on the castle moat and the long left side wall on the Cingelstraat. ",
"name":"Koningin Wilhelmina Paviljoen, Kraanstraat 4b, Breda",
"coordinates":"51.590380346954696, 4.775770191566508",
"description":"Koningin Wilhelmina Paviljoen is een bouwwerk in Breda Centrum in Breda. Het behoort tot de Koninklijke Militaire Academie (KMA) en bezit de status van rijksmonument. Het staat aan het Kasteelplein 15, vlak voor het Kasteel van Breda. Het ligt met de voorgevel aan de westkant van de oprijlaan van het kasteel, met de lange rechterzijgevel aan de kasteelgracht en de lange linkerzijgevel aan de Cingelstraat.",
"imageUrl":"koningin_wilhelimna_paviljoen"
},
{
"name":"Hercules en de Nemeïsche leeuw",
"coordinates":"51.59130522182325,4.778161739135078",
"description":"The statue shows Hercules with the skin of the Nemean lion. Heracles or Hercules is a figure from Greek mythology. He was a Greek hero and became famous for the 12 difficult works he performed at the behest of King Eurystheus. The statue is part of the 17 other sandstone statues that Willem III bought between 1670 and 1686. The statues were spread over lawns in the Valkenberg park.\nHercules is the only original statue that remains.",
"coordinates":"51.591204052421965, 4.777900596046037",
"description":"Het beeld toont Hercules met de huid van de Nemeïsche leeuw. Herakles of Hercules is een figuur uit de Griekse mythologie. Hij was een Griekse heros en werd beroemd om de 12 moeilijke werken die hij uitvoerde in opdracht van koning Eurystheus. Het beeld maakt onderdeel uit van 17 anderen zandstenen beelden die Willem III tussen 1670 en 1686 kocht. De beelden stonden verdeeld over grasperken in het Valkenberg park.\nHercules is het enige originele beeld dat overgebleven is.",
"imageUrl":"hercules_park_valkenburg"
},
{
"name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1",
"coordinates":"51.592530636759136,4.780278353833301",
"description":"The Baroniemonument or Nassau-Baroniemonument is a statue of the Dutch architect Pierre Cuypers. It is located in Park Valkenberg in Breda. The monument was placed in memorial of the 500-year bond (1904) between Breda and the Oranje-Nassau house. In 1404 Engelbrecht I of Nassau-Siegen was honored as lord of Breda. ",
"description":"Het Baroniemonument of Nassau-Baroniemonument is een beeld van de Nederlandse architect Pierre Cuypers. Het staat in het Park Valkenberg in Breda. Het monument werd geplaatst ter herinnering aan de 500-jarige band (1904) tussen Breda en het huis Oranje-Nassau. In 1404 werd Engelbrecht I van Nassau-Siegen gehuldigd als heer van Breda.",
"imageUrl":"nassau_baroniemonument"
},
{
"name":"Station Breda Gravinnen van Nassauboulevard 43",
"coordinates":"51.59569850758307,4.780295549958155",
"description":"Breda Station is the central railway station of the Dutch city of Breda. It is located north of the city center. Surrounding neighborhoods are Stationskwartier and Drie Hoefijzers on the south side, and Belcrum, Doornbos-Linie, and Havenkwartier on the north side. \n\nThe first station in Breda was opened on May 1, 1855, when the Roosendaal - Breda Railway was opened. This station was replaced by a new building in 1863, when the line to Tilburg was opened, because Breda was still a fortress at the time and it station fell under the restrictions of the Fortress Act, it was constructed in such a way that it could be quickly demolished in times of war. ",
"coordinates":"51.5924883160154, 4.779744240625213",
"description":"Station Breda is het centrale spoorwegstation van de Nederlandse stad Breda. Het bevindt zich ten noorden van het centrum van de stad. Omliggende wijken zijn Stationskwartier en Drie Hoefijzers aan de zuidkant, en aan de noordzijde Belcrum, Doornbos-Linie en Havenkwartier.\n\nHet eerste station in Breda werd geopend op 1 mei 1855, toen de Spoorlijn Roosendaal - Breda werd geopend. Dit station werd in 1863 door een nieuw gebouw vervangen, toen de lijn naar Tilburg werd geopend. Omdat Breda toen nog een vesting was en het station onder de beperkingen van de Vestingwet viel, was het zodanig uitgevoerd dat het in tijden van oorlog snel gesloopt zou kunnen worden.",
"imageUrl":"station_breda"
},
{
"name":"Belcrum Beach Veilingkade 12a",
"coordinates":"51.599434239284726,4.76632797992092",
"description":"Belcrum Beach is THE city beach of Breda, located on the Haveneiland in the Belcrum district. We started in 2013 at this unique location in Breda. The beach works with three managers and a large number of volunteers for the bar, maintenance, programming, sponsoring, and garden. A place to relax with a drink and a snack, enjoying the sun, chatting with your friends, listening to music from a band or DJ, sometimes in a festival setting. Children who can play in the sand or join do special children's activities. Belcrum Beach is also a unique location for a party or to celebrate your birthday, getting married on the beach or a wedding are also possible. ",
"coordinates":"51.59960126665085, 4.765433657156298",
"description":"Belcrum Beach is HET stadsstrand van Breda, gelegen op het Haveneiland in de wijk Belcrum. Wij zijn begonnen in 2013 op deze unieke lokatie in Breda. Het strand werkt met drie beheerders en een groot aantal vrijwilligers voor bar, onderhoud, programmering, sponsoring en tuin. Een plek om te relaxen met een drankje en een hapje, genietend van de zon, gezellig kletsen met je vrienden, luisterend naar muziek van een band of DJ, soms in een festival setting. Kinderen die kunnen spelen in het zand of mee kunnen doen aan speciale kinderactiviteiten. Belcrum Beach is ook een unieke lokatie voor een feestje of om je verjaardag te vieren, trouwen op het strand of een trouwfeest behoren ook tot de mogelijkheden.",
"imageUrl":"belcrum_beach"
},
{
"name":"De Belcrum Watertoren (1935) Speelhuislaan 158",
"coordinates":"51.60135351009892,4.7705765989322755",
"description":"The water tower in the Belcrum in Breda is an industrial monument from the interwar period. The tower is the home base for SOAB advisers for housing and living environments and underlines the mission of our office. The tower is part of the Belcrum. As a landmark and as a shelter for activities. For example, the Belcrummers celebrated their 400th anniversary in the tower, and lunches with a guided tour are organized at a high level. Watch and taste. ",
"coordinates":"51.60051284129074, 4.7689723624007",
"description":"De watertoren in de Belcrum in Breda is een industrieel monument uit het interbellum. De toren is de thuisbasis voor SOAB adviseurs voor woning en leefomgeving en onderstreept de missie van ons bureau. De toren hoort bij de Belcrum. Als landmark en als onderdak voor activiteiten. Zo vierden de Belcrummers hun 400 jaar bestaan in de toren en worden lunches met rondleiding op hoog niveau georganiseerd. Kijken en proeven.",
"imageUrl":"belcrum_watertoren"
}
]

View File

@@ -1,40 +0,0 @@
[
{
"name": "rondje stad",
"locations": [
{
"name":"Prison Escape Kloosterlaan 168",
"coordinates":"51.59073795635181,4.784917104321059",
"description":"4811EE Breda",
"imageUrl":"NULL"
},
{
"name":"De Koepel - FutureDome Events Nassausingel 26",
"coordinates":"51.590431588532105,4.786756741648511",
"description":"4811HP Breda",
"imageUrl":"NULL"
},
{
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
"coordinates":" 51.59110835530862,4.784147222780912",
"description":"4811GK Breda",
"imageUrl":"NULL"
},
{
"name":"MEZZ Breda Keizerstraat 101",
"coordinates":"51.58394697737321,4.779757901349616",
"description":"4811HL Breda",
"imageUrl":"NULL"
},
{
"name":"Het Klooster Breda Schorsmolenstraat 13",
"coordinates":"51.58775443759389,4.765568874365066",
"description":"4811VN Breda",
"imageUrl":"NULL"
}
],
"totalDistance": 2.3434,
"totalTime": 342342
}
]

View File

@@ -2,39 +2,75 @@
{
"name": "rondje stad",
"locations": [
{
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
"coordinates":"51.59096518753322, 4.783727736123234",
"description":"4811GK Breda",
"imageUrl":"NULL"
},
{
"name":"Prison Escape Kloosterlaan 168",
"coordinates":"51.59073795635181,4.784917104321059",
"coordinates":"51.59058740778487, 4.784723144974098",
"description":"4811EE Breda",
"imageUrl":"NULL"
},
{
"name":"De Koepel - FutureDome Events Nassausingel 26",
"coordinates":"51.590431588532105,4.786756741648511",
"coordinates":"51.59025697138579, 4.787354025225596",
"description":"4811HP Breda",
"imageUrl":"NULL"
},
{
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
"coordinates":" 51.59110835530862,4.784147222780912",
"description":"4811GK Breda",
"imageUrl":"NULL"
},
{
"name":"MEZZ Breda Keizerstraat 101",
"coordinates":"51.58394697737321,4.779757901349616",
"coordinates":"51.5837840024532, 4.779037836841554",
"description":"4811HL Breda",
"imageUrl":"NULL"
},
{
"name":"Het Klooster Breda Schorsmolenstraat 13",
"coordinates":"51.58775443759389,4.765568874365066",
"coordinates":"51.58765659148822, 4.764801414019652",
"description":"4811VN Breda",
"imageUrl":"NULL"
}
],
"totalDistance": 2.3434,
"totalDistance": 1073.0,
"totalTime": 342342
},
{
"name": "Obesi Route",
"locations": [
{
"name": "McDonald's Breda Karnemelkstraat",
"coordinates": "51.586062613842245, 4.777606887874218",
"description": "Wist je dat McDonalds de grootste restaurantketen ter wereld is? Hierdoor hebben we een indrukwekkende geschiedenis. Maar wij kijken liever naar onze toekomst. Nieuwe restaurants, betere producten en duurzaam ondernemen. Wil je meer weten over McDonalds? Lees verder op: https://www.mcdonalds.com/nl/nl-nl/over-ons.html!"
},
{
"name": "Kees Kroket Houtmarkt 9",
"coordinates": "51.58628401688983, 4.77579695141302",
"description": "lekkere patatjes"
},
{
"name": "Wok To Go Halstraat 40",
"coordinates": "51.586464146477574, 4.777606887874218",
"description": "Bij Wok To Go houden we van snelle, gezonde en smaakvolle maaltijden. Sinds 2003 ontwikkelen onze chef-koks de lekkerste wokgerechten met verse ingrediënten. We doen dit vól overgave onder het motto “Making people happy through food”. Door het roerbakken met een kleine hoeveelheid olie op grote hitte, blijven de smaak en gezonde voedingsstoffen bewaard. We kiezen voor gezonde en unieke ingrediënten en bereiden uitgebalanceerde gerechten in een Wokki box voor een gezonde levensstijl."
},
{
"name": "The Tosti Club Breda A4, Vlaszak 2",
"coordinates": "51.588922458012384, 4.7804923888638",
"description": "Je kunt bij al onze vestigingen de hele dag terecht, want bij The Tosti Club eet je het klokje rond. Dus kom gezellig ontbijten, lunchen of voor een snelle hap aan het einde van de dag (wat dacht je van onze The Tosti Slice, onze variant op pizza!). Even geen zin in brood? Dan kunnen we je ook verblijden met onder andere acaï smoothiebowls, pancakes, granolas / yoghurt of gewoon een lekkere warme drank met gebak. Mogen we je de Red Velvet fudge cake aanraden?"
},
{
"name": "Gauchos Grote Markt 33",
"coordinates": "51.588449106286255, 4.77604936398091",
"description": "De middeleeuwse Grote Markt is een historische plek in het Bourgondische hart van Breda, ooit in handen van de Spaanse bezetter. Gauchos Grill-Restaurant combineert daar Brabantse gemoedelijkheid met professionele gastvrijheid. In onze Latijnse keuken bereiden wij op uw aanwijzing een malse Argentijnse steak of een smakelijk visgerecht van de grill."
},
{
"name": "De Boterhal Grote Markt 19",
"coordinates": "51.58798747205394, 4.776265846483903",
"description": "De Boterhal in Breda is een internationaal tapasrestaurant, speciaalbiercafé en wijnbar. Men kan gezellig bij ons lunchen, borrelen en dineren. Wij hebben een uitgebreide menukaart met een hele hoop bieren, wijnen, zowel per glas als per fles te verkrijgen, lunch en tapasgerechtjes. Naast het eten wat wij serveren hebben we ook een hoop bieren en wijnen. Naast de bieren op de kaart hebben wij wisselende bieren; vijf ketelbieren en vijf seizoensbieren."
}
],
"totalDistance": 955.0,
"totalTime": 342342
}
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

View File

@@ -24,7 +24,6 @@ import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
public class FileIO<T> {
private final String TAG = FileIO.class.getCanonicalName();
@@ -35,14 +34,8 @@ public class FileIO<T> {
AssetManager am = context.getAssets();
T res = null;
StringBuilder sb = new StringBuilder();
InputStream is = null;
try {
if (Arrays.asList(context.getResources().getAssets().list("")).contains(fileName)) {
is = am.open(fileName);
Log.d(TAG, "Opening file: " + fileName);
} else {
is = am.open(fileName.substring(0, fileName.length() - 8) + ".json");
}
InputStream is = am.open(fileName);
InputStreamReader inputStreamReader = new InputStreamReader(is);
BufferedReader reader = new BufferedReader(inputStreamReader);
String line;

View File

@@ -112,15 +112,6 @@ public class Location implements Parcelable {
return long1 + "," + lat1;
}
/**
* calculates the distance to the other location.
* @param other the other location
* @return the distance between the locations in meters
*/
public double getDistance(Location other) {
return getDistance(this.getLat(),this.getLong(),other.getLat(),other.getLong());
}
/**
* calculates the distance between two coordinates
* @param lat1 the first latitude
@@ -130,6 +121,11 @@ public class Location implements Parcelable {
* @return the distance between the coordinates in meters
*/
public static double getDistance(double lat1, double lon1, double lat2, double lon2) {
lat1 = Math.toRadians(lat1);
lat2 = Math.toRadians(lat2);
lon1 = Math.toRadians(lon1);
lon2 = Math.toRadians(lon2);
double dlon = lon2 - lon1;
double dlat = lat2 - lat1;
double a = Math.pow(Math.sin(dlat / 2), 2)
@@ -140,11 +136,16 @@ public class Location implements Parcelable {
// Radius of earth in kilometers. Use 3956
// for miles
double r = 6371;
// if(miles) {
// double r = 3956;
// }
// else {
double r = 6371;
// }
// calculate the result
double distance = c * r;
distance *= 1000;
return Math.floor(distance);
}

View File

@@ -66,7 +66,6 @@ public class Route implements Parcelable {
}
public float getTotalDistance() {
//TODO calculate total distance according to all locations in list
return totalDistance;
}

View File

@@ -28,6 +28,10 @@ public enum RouteHandler {
this.routeFinishedListener = routeFinishedListener;
}
public RouteFinishedListener getRouteFinishedListener() {
return routeFinishedListener;
}
public int getStepCount() {
return stepCount;
}
@@ -46,6 +50,9 @@ public enum RouteHandler {
}
public void followRoute(Route route) {
if (isFollowingRoute) {
StaticData.INSTANCE.addTimeWalked(System.currentTimeMillis()-startedTime);
}
this.currentRoute = route;
setFollowingRoute(true);
startedTime = System.currentTimeMillis();

View File

@@ -1,7 +1,5 @@
package com.a1.nextlocation.data;
import org.osmdroid.views.overlay.Polyline;
import java.util.ArrayList;
/**
@@ -11,7 +9,16 @@ public enum StaticData {
INSTANCE;
private double distanceTraveled = 0;
private int locationsVisited = 0;
private long timeWalkedRoute = 0;
private long timeWalked = 0;
private double zoom = 0;
public double getZoom() {
return zoom;
}
public void setZoom(double zoom) {
this.zoom = zoom;
}
private ArrayList<String> visitedNames = new ArrayList<>();
@@ -19,12 +26,12 @@ public enum StaticData {
distanceTraveled += d;
}
public long getTimeWalkedRoute() {
return timeWalkedRoute;
public long getTimeWalked() {
return timeWalked;
}
public void addTimeWalked(long time) {
timeWalkedRoute += time;
timeWalked += time;
}

View File

@@ -2,6 +2,7 @@ package com.a1.nextlocation.fragments;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
@@ -11,6 +12,7 @@ import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
@@ -34,6 +36,7 @@ import com.a1.nextlocation.recyclerview.LocationListManager;
import org.osmdroid.api.IMapController;
import org.osmdroid.config.Configuration;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.CustomZoomButtonsController;
import org.osmdroid.views.MapView;
import org.osmdroid.views.overlay.ItemizedIconOverlay;
import org.osmdroid.views.overlay.Overlay;
@@ -49,13 +52,14 @@ import java.util.List;
public class HomeFragment extends Fragment implements LocationListener {
private final String userAgent = "com.ai.nextlocation.fragments";
public final static String MAPQUEST_API_KEY = "vuyXjqnAADpjeL9QwtgWGleIk95e36My";
private ImageButton imageButton;
private ImageButton stopButton;
private MapView mapView;
private final int REQUEST_PERMISSIONS_REQUEST_CODE = 1;
private final String TAG = HomeFragment.class.getCanonicalName();
// private RoadManager roadManager;
private Polyline roadOverlay;
private int color;
private Location currentLocation;
@@ -89,25 +93,36 @@ public class HomeFragment extends Fragment implements LocationListener {
// set up the route stop button
stopButton = view.findViewById(R.id.home_stop_route_button);
stopButton.setOnClickListener(v -> {
RouteHandler.INSTANCE.finishRoute();
stopButton.setVisibility(View.GONE);
Toast.makeText(requireContext(), getResources().getString(R.string.route_stop_toast), Toast.LENGTH_SHORT).show();
mapView.getOverlays().remove(roadOverlay);
mapView.getOverlays().remove(allLocationsOverlay);
addLocations();
mapView.invalidate();
roadOverlay = null;
stopRoute();
});
// show or hide the stop route button based on if we are following a route
if (RouteHandler.INSTANCE.isFollowingRoute()) {
stopButton.setVisibility(View.VISIBLE);
} else {
stopButton.setVisibility(View.GONE);
}
//register as a listener for a result of the API
ApiHandler.INSTANCE.addListener(this::onDirectionsAvailable);
return view;
}
/**
* stops the current route
*/
private void stopRoute() {
Log.d(TAG, "stopRoute: STOPPING ROUTE" );
RouteHandler.INSTANCE.finishRoute();
stopButton.setVisibility(View.GONE);
Toast.makeText(requireContext(), getResources().getString(R.string.route_stop_toast), Toast.LENGTH_SHORT).show();
mapView.getOverlays().remove(roadOverlay);
mapView.getOverlays().remove(allLocationsOverlay);
addLocations();
mapView.invalidate();
roadOverlay = null;
}
/**
* callback method that gets called when there are new directions available in the form of a {@link DirectionsResult} object.
*
@@ -120,7 +135,7 @@ public class HomeFragment extends Fragment implements LocationListener {
roadOverlay.setPoints(geoPoints);
roadOverlay.setColor(color);
// pass the line to the route handler
RouteHandler.INSTANCE.setCurrentRouteLine(roadOverlay);
Log.d(TAG, "onDirectionsAvailable: successfully added road!");
@@ -166,7 +181,10 @@ public class HomeFragment extends Fragment implements LocationListener {
// add the zoom controller
IMapController mapController = mapView.getController();
mapController.setZoom(15.0);
if (StaticData.INSTANCE.getZoom() == 0) {
StaticData.INSTANCE.setZoom(15.0);
}
mapController.setZoom(StaticData.INSTANCE.getZoom());
// add location manager and set the start point
LocationManager locationManager = (LocationManager) requireActivity().getSystemService(Context.LOCATION_SERVICE);
@@ -330,14 +348,25 @@ public class HomeFragment extends Fragment implements LocationListener {
//new thread because we don't want the main thread to hang, this method gets called a lot
Thread t = new Thread(() -> {
com.a1.nextlocation.data.Location last = null;
if (RouteHandler.INSTANCE.isFollowingRoute()) {
List<com.a1.nextlocation.data.Location> locs = RouteHandler.INSTANCE.getCurrentRoute().getLocations();
last = locs.get(locs.size()-1);
}
for (com.a1.nextlocation.data.Location l : LocationListManager.INSTANCE.getLocationList()) {
if (com.a1.nextlocation.data.Location.getDistance(currentLocation.getLatitude(), currentLocation.getLongitude(), l.getLat(), l.getLong()) < 10) {
// mark the location visited if we are less than 20 meters away
if (com.a1.nextlocation.data.Location.getDistance(currentLocation.getLatitude(), currentLocation.getLongitude(), l.getLat(), l.getLong()) < 20) {
StaticData.INSTANCE.visitLocation(l);
if (l.equals(last)) stopRoute();
}
}
StaticData.INSTANCE.setZoom(mapView.getZoomLevelDouble());
});
t.start();
}
// empty override methods for the LocationListener

View File

@@ -1,5 +1,6 @@
package com.a1.nextlocation.fragments;
import android.annotation.SuppressLint;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
@@ -14,15 +15,20 @@ import android.widget.TextView;
import android.widget.Toast;
import com.a1.nextlocation.R;
import com.a1.nextlocation.data.Location;
import com.a1.nextlocation.data.Route;
import com.a1.nextlocation.data.RouteHandler;
import com.a1.nextlocation.network.ApiHandler;
import java.util.ArrayList;
import java.util.List;
public class RouteDetailFragment extends Fragment {
private Route route;
private TextView routeDetailText;
private TextView routeName;
private TextView totalDistance;
private ImageButton imageButton;
@Override
@@ -31,6 +37,7 @@ public class RouteDetailFragment extends Fragment {
}
@SuppressLint("SetTextI18n")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_route_detail, container, false);
@@ -44,6 +51,10 @@ public class RouteDetailFragment extends Fragment {
this.routeDetailText = view.findViewById(R.id.reoute_detail_tekst);
this.routeDetailText.setText(this.route.getDescription());
this.totalDistance = view.findViewById(R.id.total_distance);
String distance_tekst = getResources().getString(R.string.total_distance_route);
this.totalDistance.setText(distance_tekst + " " + calculateRoute(this.route.getLocations()) + "m");
this.imageButton = view.findViewById(R.id.route_detail_back_button);
this.imageButton.setOnClickListener(v -> {
RouteFragment routeFragment = new RouteFragment();
@@ -53,7 +64,6 @@ public class RouteDetailFragment extends Fragment {
Button startButton = view.findViewById(R.id.start_route_button);
startButton.setOnClickListener(this::startRoute);
return view;
}
@@ -66,6 +76,29 @@ public class RouteDetailFragment extends Fragment {
RouteHandler.INSTANCE.followRoute(route);
Toast.makeText(requireContext(),"Route started!",Toast.LENGTH_SHORT).show();
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).addToBackStack(null).commit();
}
/**
* Calculates the distance between points
* @param route the route that is calculated
* @return the total distance of a route
*/
public double calculateRoute(List<Location> route){
ArrayList<Location> routeArraylist = new ArrayList<>(route);
double totalDistance = 0;
Location firstLocation;
Location secondLocation;
System.out.println("Total locations: " + routeArraylist.size());
//Cycles through the arraylist
for(int i = 0; i < routeArraylist.size() - 1; i++) {
firstLocation = routeArraylist.get(i);
secondLocation = routeArraylist.get(i+1);
System.out.println("locations distance calculated: " + (i+1) + " and " + (i+2) + "\nThe added distance is: " + Location.getDistance(firstLocation.getLat(), firstLocation.getLong(), secondLocation.getLat(), secondLocation.getLong()));
//Calculates the distance between points
totalDistance += Location.getDistance(firstLocation.getLat(), firstLocation.getLong(), secondLocation.getLat(), secondLocation.getLong());
}
System.out.println("Total Distance: " + totalDistance);
return totalDistance;
}
}

View File

@@ -5,14 +5,12 @@ import android.os.Bundle;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.a1.nextlocation.R;
import com.a1.nextlocation.data.Coupon;
@@ -44,7 +42,13 @@ public class StatisticFragment extends Fragment {
double dist = StaticData.INSTANCE.getDistanceTraveled()/1000;
distance.setText("" + String.format("%.1f",dist) + " km");
locs.setText("" + StaticData.INSTANCE.getLocationsVisited());
timeText.setText("" + StaticData.INSTANCE.getTimeWalkedRoute());
long seconds = StaticData.INSTANCE.getTimeWalked() / 1000;
long p1 = seconds % 60;
long p2 = seconds / 60;
long p3 = p2 % 60;
p2 = p2 / 60;
timeText.setText(p2 + ":" + p3 + ":" + p1);
this.couponList = CouponListManager.INSTANCE.getCouponList();

View File

@@ -101,31 +101,7 @@ public class DirectionsResult {
JsonArray segments = properties.getAsJsonArray("segments");
for (JsonElement element : segments) {
JsonObject segment = element.getAsJsonObject();
setDistance(segment.get("distance").getAsDouble());
setDuration(segment.get("duration").getAsDouble());
JsonArray steps = segment.getAsJsonArray("steps");
for (JsonElement j : steps) {
DirectionsStep step = gson.fromJson(j, DirectionsStep.class);
double lat;
double longl;
// kinda stinky but it works
for (int i = 0; i < 2; i++) {
lat = this.wayPointCoordinates[step.getWay_points().get(i)][0];
longl = this.wayPointCoordinates[step.getWay_points().get(i)][1];
step.getWaypoints()[i] = new GeoPoint(lat, longl);
}
addStep(step);
Log.d(TAG, "parse: added step" + step);
}
}
parseSegments(segments,gson);
startAndEndPoint[0] = this.getSteps().get(0).getWaypoints()[0];
startAndEndPoint[1] = this.getSteps().get(this.getSteps().size()-1).getWaypoints()[1];
@@ -133,8 +109,8 @@ public class DirectionsResult {
}
/**
* parses the given json string into this object. This method is used for when you want to
* @param json
* parses the given json string into this object. This method is used for when you have requested directions from the API for a {@link com.a1.nextlocation.data.Route route object}
* @param json the json string
*/
public void parseRoute(String json) {
@@ -162,33 +138,54 @@ public class DirectionsResult {
JsonArray segments = route.getAsJsonArray("segments");
for (JsonElement e : segments) {
JsonObject segment = e.getAsJsonObject();
parseSegments(segments,gson);
setDistance(segment.get("distance").getAsDouble());
setDuration(segment.get("duration").getAsDouble());
JsonArray steps = segment.getAsJsonArray("steps");
for (JsonElement j : steps) {
DirectionsStep step = gson.fromJson(j, DirectionsStep.class);
double lat;
double longl;
// kinda stinky but it works
for (int i = 0; i < 2; i++) {
lat = this.wayPointCoordinates[step.getWay_points().get(i)][0];
longl = this.wayPointCoordinates[step.getWay_points().get(i)][1];
step.getWaypoints()[i] = new GeoPoint(lat, longl);
}
addStep(step);
Log.d(TAG, "parse: added step" + step);
}
}
}
}
/**
* parses different segments, and the steps in it using {@link DirectionsResult#parseSteps(JsonArray, Gson) the method for parsing steps}
* @param segments the segments to parse
* @param gson the gson object to use
*/
private void parseSegments(JsonArray segments, Gson gson) {
//unfold the individual segments
for (JsonElement e : segments) {
JsonObject segment = e.getAsJsonObject();
setDistance(segment.get("distance").getAsDouble());
setDuration(segment.get("duration").getAsDouble());
JsonArray steps = segment.getAsJsonArray("steps");
parseSteps(steps,gson);
}
}
/**
* parses the given steps into this object, transforms them into a {@link DirectionsStep} object.
* @param steps the steps to parse
* @param gson the gson object to use
*/
private void parseSteps(JsonArray steps, Gson gson) {
for (JsonElement j : steps) {
// parse everything into a directionsstep
DirectionsStep step = gson.fromJson(j, DirectionsStep.class);
double lat;
double longl;
// kinda stinky but it works
for (int i = 0; i < 2; i++) {
lat = this.wayPointCoordinates[step.getWay_points().get(i)][0];
longl = this.wayPointCoordinates[step.getWay_points().get(i)][1];
step.getWaypoints()[i] = new GeoPoint(lat, longl);
}
addStep(step);
Log.d(TAG, "parse: added step" + step);
}
}
}

View File

@@ -21,14 +21,7 @@ public class CouponLoader implements Loader<List<Coupon>> {
@Override
public ArrayList<Coupon> load() {
FileIO<ArrayList<Coupon>> fileIO = new FileIO<>();
String selectedLanguage = context.getSharedPreferences("Settings", Context.MODE_PRIVATE).getString("Language", "nl");
String fileName = "locations";
// choose the coupon.json based of the selected language
if (!selectedLanguage.equals("en")) {
fileName += "-" + selectedLanguage;
}
ArrayList<Coupon> res = fileIO.readFileData(context, fileName + ".json", new TypeToken<ArrayList<Coupon>>(){}.getType());
ArrayList<Coupon> res = fileIO.readFileData(context, "coupons.json",new TypeToken<ArrayList<Coupon>>(){}.getType());
Log.d(TAG, "load: " + res);
return res == null ? new ArrayList<>() : res;

View File

@@ -21,14 +21,7 @@ public class LocationLoader implements Loader<List<Location>> {
public ArrayList<Location> load() {
FileIO<ArrayList<Location>> fileIO = new FileIO<>();
String selectedLanguage = context.getSharedPreferences("Settings", Context.MODE_PRIVATE).getString("Language", "nl");
String fileName = "locations";
// choose the locations.json based of the selected language
if (!selectedLanguage.equals("en")) {
fileName += "-" + selectedLanguage;
}
ArrayList<Location> res = fileIO.readFileData(context,fileName + ".json",new TypeToken<ArrayList<Location>>(){}.getType());
ArrayList<Location> res = fileIO.readFileData(context,"locations.json",new TypeToken<ArrayList<Location>>(){}.getType());
return res == null ? new ArrayList<>() : res;
}

View File

@@ -22,15 +22,7 @@ public class RouteLoader implements Loader<List<Route>> {
public ArrayList<Route> load() {
FileIO<ArrayList<Route>> fileIO = new FileIO<>();
String selectedLanguage = context.getSharedPreferences("Settings", Context.MODE_PRIVATE).getString("Language", "nl");
String fileName = "routes";
// choose the routes.json based of the selected language
if (!selectedLanguage.equals("en")) {
fileName += "-" + selectedLanguage;
}
ArrayList<Route> res = fileIO.readFileData(context, fileName + ".json",new TypeToken<ArrayList<Route>>(){}.getType());
ArrayList<Route> res = fileIO.readFileData(context, "routes.json",new TypeToken<ArrayList<Route>>(){}.getType());
return res == null ? new ArrayList<>() : res;
}

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -38,9 +38,7 @@
app:layout_constraintTop_toBottomOf="@id/route_detail_back_button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/reoute_detail_tekst"
/>
app:layout_constraintBottom_toTopOf="@id/reoute_detail_tekst" />
<TextView
android:id="@+id/reoute_detail_tekst"
@@ -57,14 +55,29 @@
android:id="@+id/start_route_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/start_route"
android:layout_marginBottom="30dp"
android:backgroundTint="@color/secondaryColour"
android:text="@string/start_route"
android:textColor="@color/buttonColour"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/total_distance" />
<TextView
android:id="@+id/total_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="141dp"
android:layout_marginBottom="19dp"
android:text="@string/total_distance"
android:background="@color/secondaryColour"
android:textColor="@color/buttonColour"
app:layout_constraintBottom_toTopOf="@+id/start_route_button"
app:layout_constraintTop_toBottomOf="@+id/reoute_detail_tekst"
app:layout_constraintVertical_bias="0.671" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:layout_editor_absoluteX="169dp" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/icon_background"/>
<foreground android:drawable="@mipmap/icon_foreground"/>
</adaptive-icon>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/icon_background"/>
<foreground android:drawable="@mipmap/icon_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -19,6 +19,7 @@
<string name="activate_question">Weet je zeker dat je deze coupon wilt activeren?</string>
<string name="activate">activeren</string>
<string name="done">Klaar</string>
<string name="total_distance_route">De totale afstand van de route is: </string>
<string name="cancel">annuleren</string>
<string name="English">Engels</string>
<string name="Dutch">Nederlands</string>

View File

@@ -18,6 +18,7 @@
<string name="activate">activate</string>
<string name="done">Done</string>
<string name="cancel">cancel</string>
<string name="total_distance_route">The total distance of the route is:</string>
<string name="route_stop_toast">Route stopped!</string>
<string name="Dutch">Dutch</string>
<string name="English">English</string>

View File

@@ -1,5 +1,7 @@
package com.a1.nextlocation;
import android.graphics.Point;
import com.a1.nextlocation.data.Location;
import org.junit.Before;
@@ -66,8 +68,8 @@ public class LocationTest {
@Test
public void coordinateDoublesTest(){
double[] testDoubles = new double[2];
testDoubles[0] = 15.4;
testDoubles[1] = 27.5;
testDoubles[0] = 27.5;
testDoubles[1] = 15.4;
double [] expectedCoordAsDouble = testDoubles;
String expectedStringFromDouble = "15.4,27.5";
@@ -94,4 +96,13 @@ public class LocationTest {
assertNotNull(alternateTestLocation);
}
@Test
public void calculatingDistance(){
double expected2 = 1054.66;
assertEquals(expected2, Location.getDistance(51.578810244278344, 4.804990650154528, 51.57696163247576, 4.789331956851824), 100);
}
}

View File

@@ -0,0 +1,67 @@
package com.a1.nextlocation;
import com.a1.nextlocation.data.Route;
import com.a1.nextlocation.data.RouteHandler;
import org.junit.Before;
import org.junit.Test;
import org.osmdroid.views.overlay.Polyline;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.mock;
public class RouteHandlerTest {
private RouteHandler routeHandler;
@Before
public void init(){
routeHandler = RouteHandler.INSTANCE;
}
@Test
public void testRouteLine(){
Polyline mPol = mock(Polyline.class);
routeHandler.setCurrentRouteLine(mPol);
assertEquals(mPol, routeHandler.getCurrentRouteLine());
}
@Test
public void testStepCount(){
int expected = 0;
for (int i = 0; i < 100; i++) {
routeHandler.addStep();
expected++;
}
assertEquals(expected, routeHandler.getStepCount());
expected += 10;
assertNotEquals(expected, routeHandler.getStepCount());
}
@Test
public void testRouteFollowing(){
Route testRoute = new Route("");
routeHandler.followRoute(testRoute);
boolean expected = true;
assertEquals(expected, routeHandler.isFollowingRoute(testRoute));
assertEquals(expected, routeHandler.isFollowingRoute());
assertEquals(testRoute, routeHandler.getCurrentRoute());
routeHandler.finishRoute();
assertNull(routeHandler.getCurrentRoute());
routeHandler.followRoute(new Route("FALSEROUTENAME"));
assertNotEquals(expected, routeHandler.isFollowingRoute(testRoute));
}
@Test
public void test(){
routeHandler.setRouteFinishedListener(() -> {
System.out.println("TEST");
});
assertNotNull(routeHandler.getRouteFinishedListener());
}
}

View File

@@ -90,4 +90,13 @@ public class RouteTest {
assertEquals(expectedAfter, route.getTotalTime());
}
@Test
public void testDescription(){
route.setDescription("TEST");
String expected = "TEST";
assertEquals(expected, route.getDescription());
route.setDescription("FALSETEST");
assertNotEquals(expected, route.getDescription());
}
}

View File

@@ -0,0 +1,49 @@
package com.a1.nextlocation;
import com.a1.nextlocation.data.Location;
import com.a1.nextlocation.data.StaticData;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotSame;
public class StaticDataTest {
private StaticData staticData;
@Before
public void init(){
staticData = StaticData.INSTANCE;
}
@Test
public void testDistance(){
staticData.addDistance(2356.234);
double expected = 2356.234;
assertEquals(expected, staticData.getDistanceTraveled(), 0.01);
staticData.addDistance(234342.1);
assertNotEquals(expected, staticData.getDistanceTraveled());
}
@Test
public void testTimeWalked(){
staticData.addTimeWalked(3456);
long expected = 3456;
assertEquals(expected, staticData.getTimeWalked());
staticData.addTimeWalked(3445);
assertNotEquals(expected, staticData.getTimeWalked());
}
@Test
public void testVisitedLocation(){
Location testLocation = new Location("test", "test", "test", "test");
staticData.visitLocation(testLocation);
int expected = 1;
assertEquals(expected, staticData.getLocationsVisited());
staticData.visitLocation(new Location("TESTFORFALSE", "TESTFORFALSE", "TESTFORFALSE", "TESTFORFALSE"));
assertNotEquals(expected, staticData.getLocationsVisited());
}
}