Skip to content

Commit

Permalink
+ Теперь Android приложение совместимо с новым сервером
Browse files Browse the repository at this point in the history
  • Loading branch information
funcid committed Jan 5, 2020
1 parent 24b89a6 commit c38b50f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion AndroidClient/WeatherClient/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
LatLng startLocation = new LatLng(55.860408, 37.639443);
LatLng startLocation = new LatLng(55, 37);
markerList.add(mMap.addMarker(
new MarkerOptions()
.position(startLocation)
Expand Down Expand Up @@ -81,7 +81,7 @@ public void run() {
else if (secondsTemp == delayUpdate || waitUpdater > -3) {
secondsTemp = 1;
Request request = new Request.Builder()
.url("http://func-weather.herokuapp.com/?mobile=true")
.url("http://func-weather.herokuapp.com/mobile")
.build();
new OkHttpClient().newCall(request)
.enqueue(new Callback() {
Expand All @@ -90,11 +90,8 @@ public void onFailure(final Call call, IOException e) {
}

@Override
public void onResponse(Call call, final Response response) {
try {
lines = response.body().string().split("#");
} catch (Exception ignored) {
}
public void onResponse(Call call, final Response response) throws IOException{
lines = response.body().string().split("#");
}
});
for (Marker marker : markerList)
Expand All @@ -113,7 +110,7 @@ public void onResponse(Call call, final Response response) {
Float.parseFloat(cords[1])
);
nearData = splited[1]
.replace("temp=", "")
.replace("temperature=", "")
.replace(";pressure=", "C° ")
.replace(";humidity=", "torr ")
+ "%";
Expand Down

0 comments on commit c38b50f

Please sign in to comment.