maxbbraun / mirror

Smart Mirror
https://medium.com/@maxbraun/my-bathroom-mirror-is-smarter-than-yours-94b21c6671ba#.81sljnn80
MIT License
578 stars 136 forks source link

Weather In Celcius #21

Closed parsons-owen closed 6 years ago

parsons-owen commented 6 years ago

Hi, so i live in the UK and we read our weather in celcius rather than Fahrenheit. ive never developed an android app before this is my first thing. Probably not the best idea but ive wanted to do this for ages. anyway, i got the weather api working perfectly im using the free trial of darksky. however, it shows the temperature in fahrenheit and not celcius. how do i change this? i had a look in a few places but couldnt work it out. am i being stupid or is it not possible XD

thanks

parsons-owen commented 6 years ago

oh i've done it! in case anyone else wants to do this within the weather part you just add this to the end of the url: ?units=si

so happy when i figured this out XD

so this: return String.format(Locale.US, "https://api.darksky.net/forecast/%s/%f,%f",

Becomes this: return String.format(Locale.US, "https://api.darksky.net/forecast/%s/%f,%f"+"?units=si",

screen shot 2018-05-18 at 12 54 49 am

and thats all there is too it!