kopia lustrzana https://github.com/SP8EBC/MeteoSystem
Do not wait for network I/O to complete during activity creation (#3)
* downloading available params and summary refactored to separate thread * downloading available parameters only when they are required instead of all at once during startup * magic numbers extracted to separate static and final ints * displaying loading prompt in values row on favourites list * application renamedfeat/search-view-in-all-stations-activity
rodzic
57fe1bfbfd
commit
ea23e7b5fb
|
@ -4,6 +4,7 @@
|
||||||
<option name="filePathToZoomLevelMap">
|
<option name="filePathToZoomLevelMap">
|
||||||
<map>
|
<map>
|
||||||
<entry key="../../../../../layout/custom_preview.xml" value="0.2171875" />
|
<entry key="../../../../../layout/custom_preview.xml" value="0.2171875" />
|
||||||
|
<entry key="app/src/main/res/drawable/button_border.xml" value="0.38125" />
|
||||||
<entry key="app/src/main/res/layout/activity_all_stations.xml" value="0.3651041666666667" />
|
<entry key="app/src/main/res/layout/activity_all_stations.xml" value="0.3651041666666667" />
|
||||||
<entry key="app/src/main/res/layout/activity_all_stations_linear_layout.xml" value="0.3651041666666667" />
|
<entry key="app/src/main/res/layout/activity_all_stations_linear_layout.xml" value="0.3651041666666667" />
|
||||||
<entry key="app/src/main/res/layout/activity_export_data.xml" value="0.25" />
|
<entry key="app/src/main/res/layout/activity_export_data.xml" value="0.25" />
|
||||||
|
@ -11,12 +12,16 @@
|
||||||
<entry key="app/src/main/res/layout/activity_favourites_empty.xml" value="0.3651041666666667" />
|
<entry key="app/src/main/res/layout/activity_favourites_empty.xml" value="0.3651041666666667" />
|
||||||
<entry key="app/src/main/res/layout/activity_favourites_linear_layout.xml" value="0.3651041666666667" />
|
<entry key="app/src/main/res/layout/activity_favourites_linear_layout.xml" value="0.3651041666666667" />
|
||||||
<entry key="app/src/main/res/layout/activity_favourites_linear_layout_data.xml" value="0.5" />
|
<entry key="app/src/main/res/layout/activity_favourites_linear_layout_data.xml" value="0.5" />
|
||||||
<entry key="app/src/main/res/layout/activity_main.xml" value="0.3651041666666667" />
|
<entry key="app/src/main/res/layout/activity_main.xml" value="0.5451010886469674" />
|
||||||
<entry key="app/src/main/res/layout/activity_settings.xml" value="0.67" />
|
<entry key="app/src/main/res/layout/activity_settings.xml" value="0.67" />
|
||||||
<entry key="app/src/main/res/layout/activity_station_details.xml" value="0.3651041666666667" />
|
<entry key="app/src/main/res/layout/activity_station_details.xml" value="0.33" />
|
||||||
<entry key="app/src/main/res/layout/activity_station_details_plots.xml" value="0.3651041666666667" />
|
<entry key="app/src/main/res/layout/activity_station_details_plots.xml" value="0.3651041666666667" />
|
||||||
<entry key="app/src/main/res/layout/activity_station_details_summary.xml" value="0.3651041666666667" />
|
<entry key="app/src/main/res/layout/activity_station_details_summary.xml" value="0.3651041666666667" />
|
||||||
<entry key="app/src/main/res/layout/activity_station_details_wind_rose.xml" value="0.5" />
|
<entry key="app/src/main/res/layout/activity_station_details_wind_rose.xml" value="0.5" />
|
||||||
|
<entry key="app/src/main/res/layout/activity_trend.xml" value="0.3645833333333333" />
|
||||||
|
<entry key="app/src/main/res/layout/fragment_pressure.xml" value="0.3645833333333333" />
|
||||||
|
<entry key="app/src/main/res/layout/fragment_temperature.xml" value="0.3645833333333333" />
|
||||||
|
<entry key="app/src/main/res/layout/fragment_wind.xml" value="0.3645833333333333" />
|
||||||
<entry key="app/src/main/res/layout/spinner_item.xml" value="0.28306159420289856" />
|
<entry key="app/src/main/res/layout/spinner_item.xml" value="0.28306159420289856" />
|
||||||
<entry key="app/src/main/res/menu/main_activity_menu.xml" value="0.3651041666666667" />
|
<entry key="app/src/main/res/menu/main_activity_menu.xml" value="0.3651041666666667" />
|
||||||
</map>
|
</map>
|
||||||
|
|
|
@ -18,14 +18,14 @@ import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cc.pogoda.mobile.meteosystem.activity.updater.FavouritesStationSummaryUpdater;
|
import cc.pogoda.mobile.meteosystem.activity.updater.thread.FavouritesStationSummaryUpdaterThread;
|
||||||
|
|
||||||
import cc.pogoda.mobile.meteosystem.dao.AllStationsDao;
|
|
||||||
import cc.pogoda.mobile.meteosystem.file.ConfigurationFile;
|
import cc.pogoda.mobile.meteosystem.file.ConfigurationFile;
|
||||||
import cc.pogoda.mobile.meteosystem.file.FavouritiesFile;
|
import cc.pogoda.mobile.meteosystem.file.FavouritiesFile;
|
||||||
import cc.pogoda.mobile.meteosystem.file.FileNames;
|
import cc.pogoda.mobile.meteosystem.file.FileNames;
|
||||||
import cc.pogoda.mobile.meteosystem.service.GetAllStationsService;
|
import cc.pogoda.mobile.meteosystem.service.GetAllStationsService;
|
||||||
import cc.pogoda.mobile.meteosystem.type.AllStationsReceivedEvent;
|
import cc.pogoda.mobile.meteosystem.type.AllStationsReceivedEvent;
|
||||||
|
import cc.pogoda.mobile.meteosystem.type.AvailableParameters;
|
||||||
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
|
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
|
||||||
import cc.pogoda.mobile.meteosystem.type.WeatherStationListEvent;
|
import cc.pogoda.mobile.meteosystem.type.WeatherStationListEvent;
|
||||||
import cc.pogoda.mobile.meteosystem.type.web.Summary;
|
import cc.pogoda.mobile.meteosystem.type.web.Summary;
|
||||||
|
@ -65,12 +65,17 @@ public class Main extends Application {
|
||||||
* This download summary for all stations stored on favourites list and stores results
|
* This download summary for all stations stored on favourites list and stores results
|
||||||
* in 'HashMap<String, Summary> stationSystemNameToSummary'
|
* in 'HashMap<String, Summary> stationSystemNameToSummary'
|
||||||
*/
|
*/
|
||||||
private FavouritesStationSummaryUpdater favsSummaryUpdater = null;
|
private FavouritesStationSummaryUpdaterThread favsSummaryUpdater = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This map stores summary for all favourites station
|
* This map stores summary for all favourites station
|
||||||
*/
|
*/
|
||||||
private HashMap<String, Summary> hashmapStationSystemNameToSummary = null;
|
private HashMap<String, Summary> hashmapFavStationSystemNameToSummary = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This hash map stores available parameters for all stations defined in the system
|
||||||
|
*/
|
||||||
|
private HashMap<String, AvailableParameters> hashmapAllStationSystemNameToAvailParameters = null;
|
||||||
|
|
||||||
public File getDirectory() {
|
public File getDirectory() {
|
||||||
return directory;
|
return directory;
|
||||||
|
@ -84,8 +89,12 @@ public class Main extends Application {
|
||||||
return confFile;
|
return confFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, Summary> getHashmapStationSystemNameToSummary() {
|
public HashMap<String, Summary> getHashmapFavStationSystemNameToSummary() {
|
||||||
return hashmapStationSystemNameToSummary;
|
return hashmapFavStationSystemNameToSummary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HashMap<String, AvailableParameters> getHashmapAllStationSystemNameToAvailParameters() {
|
||||||
|
return hashmapAllStationSystemNameToAvailParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -121,7 +130,9 @@ public class Main extends Application {
|
||||||
|
|
||||||
confFile.restoreFromFile();
|
confFile.restoreFromFile();
|
||||||
|
|
||||||
hashmapStationSystemNameToSummary = new HashMap<>();
|
hashmapFavStationSystemNameToSummary = new HashMap<>();
|
||||||
|
|
||||||
|
hashmapAllStationSystemNameToAvailParameters = new HashMap<>();
|
||||||
|
|
||||||
fileNames = new FileNames(ctx);
|
fileNames = new FileNames(ctx);
|
||||||
|
|
||||||
|
@ -134,7 +145,7 @@ public class Main extends Application {
|
||||||
// recreate list of favorites
|
// recreate list of favorites
|
||||||
recreateListOfFavs();
|
recreateListOfFavs();
|
||||||
|
|
||||||
favsSummaryUpdater = new FavouritesStationSummaryUpdater(hashmapStationSystemNameToSummary);
|
favsSummaryUpdater = new FavouritesStationSummaryUpdaterThread(hashmapFavStationSystemNameToSummary, hashmapAllStationSystemNameToAvailParameters);
|
||||||
|
|
||||||
favsSummaryUpdater.start(100);
|
favsSummaryUpdater.start(100);
|
||||||
|
|
||||||
|
@ -160,7 +171,7 @@ public class Main extends Application {
|
||||||
private void recreateListOfFavs() {
|
private void recreateListOfFavs() {
|
||||||
|
|
||||||
if(listOfAllStations == null) {
|
if(listOfAllStations == null) {
|
||||||
Logger.info("[recreateListOfFavs]listOfAllStations=null]");
|
Logger.info("[listOfAllStations=null]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +218,7 @@ public class Main extends Application {
|
||||||
// as a list does not make a copy of the object. It (ArrayList) keeps
|
// as a list does not make a copy of the object. It (ArrayList) keeps
|
||||||
// only a reference to an object
|
// only a reference to an object
|
||||||
|
|
||||||
hashmapStationSystemNameToSummary.put(fromAllStations.getSystemName(), null);
|
hashmapFavStationSystemNameToSummary.put(fromAllStations.getSystemName(), null);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,7 +226,7 @@ public class Main extends Application {
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void weatherStationListHandler(WeatherStationListEvent serviceEvent) {
|
public void weatherStationListHandler(WeatherStationListEvent serviceEvent) {
|
||||||
Logger.info("[Main][weatherStationListHandler][serviceEvent = " + serviceEvent + "]");
|
Logger.info("[serviceEvent = " + serviceEvent + "]");
|
||||||
|
|
||||||
switch (serviceEvent.getEventReason()) {
|
switch (serviceEvent.getEventReason()) {
|
||||||
|
|
||||||
|
@ -258,7 +269,7 @@ public class Main extends Application {
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.BACKGROUND)
|
@Subscribe(threadMode = ThreadMode.BACKGROUND)
|
||||||
public void allStationsEventHandler(@NonNull AllStationsReceivedEvent event) {
|
public void allStationsEventHandler(@NonNull AllStationsReceivedEvent event) {
|
||||||
Logger.info("[allStationsEventHandler][event = " + event.toString() +"]");
|
Logger.info("[event = " + event.toString() +"]");
|
||||||
this.listOfAllStations = event.getStations();
|
this.listOfAllStations = event.getStations();
|
||||||
recreateListOfFavs();
|
recreateListOfFavs();
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class FavouritesActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
Logger.debug("[FavouritesActivity][onResume]");
|
Logger.debug("[onResume]");
|
||||||
|
|
||||||
super.onResume();
|
super.onResume();
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
|
@ -156,7 +156,7 @@ public class FavouritesActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void allStationsEventHandler(@NonNull AllStationsReceivedEvent event) {
|
public void allStationsEventHandler(@NonNull AllStationsReceivedEvent event) {
|
||||||
Logger.info("[allStationsEventHandler][event = " + event.toString() +"]");
|
Logger.info("[event = " + event.toString() +"]");
|
||||||
updateStationList();
|
updateStationList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class MainActivity extends AppCompatActivity {
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
Logger.info("[MainActivity][onDestroy]");
|
Logger.info("[onDestroy]");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,7 +52,7 @@ public class MainActivity extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
Logger.info("[MainActivity][onResume]");
|
Logger.info("[onResume]");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,19 +60,19 @@ public class MainActivity extends AppCompatActivity {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
Logger.info("[MainActivity][onCreate]");
|
Logger.info("[onCreate]");
|
||||||
|
|
||||||
main = (Main) getApplication();
|
main = (Main) getApplication();
|
||||||
|
|
||||||
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default")) {
|
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default")) {
|
||||||
Logger.debug("[MainActivity][onCreate][AppConfiguration.locale = "
|
Logger.debug("[AppConfiguration.locale = "
|
||||||
+ AppConfiguration.locale + "]");
|
+ AppConfiguration.locale + "]");
|
||||||
Locale locale = new Locale(AppConfiguration.locale);
|
Locale locale = new Locale(AppConfiguration.locale);
|
||||||
Locale.setDefault(locale);
|
Locale.setDefault(locale);
|
||||||
Resources resources = this.getResources();
|
Resources resources = this.getResources();
|
||||||
Configuration config = resources.getConfiguration();
|
Configuration config = resources.getConfiguration();
|
||||||
config.setLocale(locale);
|
config.setLocale(locale);
|
||||||
Logger.debug("[MainActivity][onCreate][locale = " + locale.toLanguageTag() + "]");
|
Logger.debug("[locale = " + locale.toLanguageTag() + "]");
|
||||||
resources.updateConfiguration(config, resources.getDisplayMetrics());
|
resources.updateConfiguration(config, resources.getDisplayMetrics());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class MainActivity extends AppCompatActivity {
|
||||||
if (requestCode == 123 && resultCode == RESULT_OK) {
|
if (requestCode == 123 && resultCode == RESULT_OK) {
|
||||||
Uri uri = data.getData();
|
Uri uri = data.getData();
|
||||||
|
|
||||||
Logger.debug("[MainActivity][onActivityResult][requestCode = 123][uri.getPath() = "
|
Logger.debug("[requestCode = 123][uri.getPath() = "
|
||||||
+ uri.getPath() + "]");
|
+ uri.getPath() + "]");
|
||||||
|
|
||||||
grantUriPermission(getPackageName(), uri,
|
grantUriPermission(getPackageName(), uri,
|
||||||
|
@ -115,7 +115,7 @@ public class MainActivity extends AppCompatActivity {
|
||||||
CopyLog.forDay(main.getFileNames(), LocalDateTime.now(),
|
CopyLog.forDay(main.getFileNames(), LocalDateTime.now(),
|
||||||
getContentResolver().openOutputStream(uri));
|
getContentResolver().openOutputStream(uri));
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
Logger.error("[MainActivity][onActivityResult][FileNotFoundException]");
|
Logger.error("[FileNotFoundException][e = " + e.toString() +"]");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class SettingsActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private static String languageNameFromShort(String shortName) {
|
private static String languageNameFromShort(String shortName) {
|
||||||
|
|
||||||
Logger.info("[SettingsActivity][languageNameFromShort][shortName = " + shortName +"]");
|
Logger.info("[shortName = " + shortName +"]");
|
||||||
|
|
||||||
switch (shortName) {
|
switch (shortName) {
|
||||||
case "en-rUS": return "English";
|
case "en-rUS": return "English";
|
||||||
|
@ -70,7 +70,7 @@ public class SettingsActivity extends AppCompatActivity {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_settings);
|
setContentView(R.layout.activity_settings);
|
||||||
|
|
||||||
Logger.info("[SettingsActivity][onCreate]");
|
Logger.info("[onCreate]");
|
||||||
|
|
||||||
confFile = new ConfigurationFile(getBaseContext());
|
confFile = new ConfigurationFile(getBaseContext());
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ public class SettingsActivity extends AppCompatActivity {
|
||||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||||
String languageSelected = adapterView.getItemAtPosition(i).toString();
|
String languageSelected = adapterView.getItemAtPosition(i).toString();
|
||||||
|
|
||||||
Logger.debug("[SettingsActivity][onCreate][AdapterView.OnItemSelectedListener()][languageSelected = " + languageSelected +"]");
|
Logger.debug("[AdapterView.OnItemSelectedListener()][languageSelected = " + languageSelected +"]");
|
||||||
|
|
||||||
switch (languageSelected) {
|
switch (languageSelected) {
|
||||||
case "English": AppConfiguration.locale = "en-rUS"; break;
|
case "English": AppConfiguration.locale = "en-rUS"; break;
|
||||||
|
|
|
@ -167,10 +167,10 @@ public class StationDetailsActivity extends AppCompatActivity {
|
||||||
act = this;
|
act = this;
|
||||||
station = (WeatherStation) getIntent().getSerializableExtra("station");
|
station = (WeatherStation) getIntent().getSerializableExtra("station");
|
||||||
|
|
||||||
Logger.info("[StationDetailsActivity][onCreate][station.getSystemName() = " + station.getSystemName() +"]");
|
Logger.info("[station.getSystemName() = " + station.getSystemName() +"]");
|
||||||
|
|
||||||
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
||||||
Logger.debug("[StationDetailsActivity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
Logger.debug("[AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
||||||
Locale locale = new Locale(AppConfiguration.locale);
|
Locale locale = new Locale(AppConfiguration.locale);
|
||||||
Locale.setDefault(locale);
|
Locale.setDefault(locale);
|
||||||
Resources resources = this.getResources();
|
Resources resources = this.getResources();
|
||||||
|
|
|
@ -132,10 +132,10 @@ public class StationDetailsPlotsDirection extends AppCompatActivity implements S
|
||||||
|
|
||||||
station = (WeatherStation) getIntent().getSerializableExtra("station");
|
station = (WeatherStation) getIntent().getSerializableExtra("station");
|
||||||
|
|
||||||
Logger.info("[StationDetailsPlotsDirection][onCreate][station.getSystemName() = " + station.getSystemName() +"][dataLn = " + dataLn +"]");
|
Logger.info("[station.getSystemName() = " + station.getSystemName() +"][dataLn = " + dataLn +"]");
|
||||||
|
|
||||||
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
||||||
Logger.debug("[StationDetailsActivity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
Logger.debug("[AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
||||||
Locale locale = new Locale(AppConfiguration.locale);
|
Locale locale = new Locale(AppConfiguration.locale);
|
||||||
Locale.setDefault(locale);
|
Locale.setDefault(locale);
|
||||||
Resources resources = this.getResources();
|
Resources resources = this.getResources();
|
||||||
|
@ -342,7 +342,7 @@ public class StationDetailsPlotsDirection extends AppCompatActivity implements S
|
||||||
// utc timestamp
|
// utc timestamp
|
||||||
long utcTimestamp = utcTime.toEpochSecond();
|
long utcTimestamp = utcTime.toEpochSecond();
|
||||||
|
|
||||||
Logger.debug("[StationDetailsPlotsDirection][downloadDataFromWebservice][station.getSystemName() = " + station.getSystemName() +"]");
|
Logger.debug("[station.getSystemName() = " + station.getSystemName() +"]");
|
||||||
|
|
||||||
if (this.dataLn < 0 || this.dataLn > 2) {
|
if (this.dataLn < 0 || this.dataLn > 2) {
|
||||||
// last 2000 points of data, regardless the timescale
|
// last 2000 points of data, regardless the timescale
|
||||||
|
@ -365,7 +365,7 @@ public class StationDetailsPlotsDirection extends AppCompatActivity implements S
|
||||||
|
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
|
|
||||||
Logger.debug("[StationDetailsPlotsDirection][downloadDataFromWebservice][data.list_of_station_data.length = " + data.list_of_station_data.length +"]");
|
Logger.debug("[data.list_of_station_data.length = " + data.list_of_station_data.length +"]");
|
||||||
|
|
||||||
for (StationData d : data.list_of_station_data) {
|
for (StationData d : data.list_of_station_data) {
|
||||||
valuesWindDirection.add(new Entry(d.epoch * 1000, d.winddir));
|
valuesWindDirection.add(new Entry(d.epoch * 1000, d.winddir));
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class StationDetailsPlotsHumidity extends AppCompatActivity implements Se
|
||||||
dataLn = (int)getIntent().getExtras().get("data_ln");
|
dataLn = (int)getIntent().getExtras().get("data_ln");
|
||||||
|
|
||||||
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
||||||
Logger.debug("[StationDetailsPlotsHumidity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
Logger.debug("[AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
||||||
Locale locale = new Locale(AppConfiguration.locale);
|
Locale locale = new Locale(AppConfiguration.locale);
|
||||||
Locale.setDefault(locale);
|
Locale.setDefault(locale);
|
||||||
Resources resources = this.getResources();
|
Resources resources = this.getResources();
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class StationDetailsPlotsTemperature extends AppCompatActivity implements
|
||||||
// utc timestamp
|
// utc timestamp
|
||||||
long utcTimestamp = utcTime.toEpochSecond();
|
long utcTimestamp = utcTime.toEpochSecond();
|
||||||
|
|
||||||
Logger.debug("[StationDetailsPlotsTemperature][downloadDataFromWebservice][station.getSystemName() = " + station.getSystemName() +"]");
|
Logger.debug("[station.getSystemName() = " + station.getSystemName() +"]");
|
||||||
|
|
||||||
if (this.dataLn < 0 || this.dataLn > 2) {
|
if (this.dataLn < 0 || this.dataLn > 2) {
|
||||||
// last 2000 points of data, regardless the timescale
|
// last 2000 points of data, regardless the timescale
|
||||||
|
@ -117,7 +117,7 @@ public class StationDetailsPlotsTemperature extends AppCompatActivity implements
|
||||||
|
|
||||||
if (data instanceof ListOfStationData) {
|
if (data instanceof ListOfStationData) {
|
||||||
|
|
||||||
Logger.debug("[StationDetailsPlotsTemperature][downloadDataFromWebservice][data.list_of_station_data.length = " + data.list_of_station_data.length +"]");
|
Logger.debug("[data.list_of_station_data.length = " + data.list_of_station_data.length +"]");
|
||||||
|
|
||||||
for (StationData d : data.list_of_station_data) {
|
for (StationData d : data.list_of_station_data) {
|
||||||
valuesTemperature.add(new Entry(d.epoch * 1000, d.temperature));
|
valuesTemperature.add(new Entry(d.epoch * 1000, d.temperature));
|
||||||
|
|
|
@ -105,10 +105,10 @@ public class StationDetailsPlotsWind extends AppCompatActivity implements SeekBa
|
||||||
|
|
||||||
station = (WeatherStation) getIntent().getSerializableExtra("station");
|
station = (WeatherStation) getIntent().getSerializableExtra("station");
|
||||||
|
|
||||||
Logger.info("[StationDetailsPlotsWind][onCreate][station.getSystemName() = " + station.getSystemName() +"][dataLn = " + dataLn +"]");
|
Logger.info("[station.getSystemName() = " + station.getSystemName() +"][dataLn = " + dataLn +"]");
|
||||||
|
|
||||||
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
||||||
Logger.debug("[StationDetailsPlotsHumidity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
Logger.debug("[AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
||||||
Locale locale = new Locale(AppConfiguration.locale);
|
Locale locale = new Locale(AppConfiguration.locale);
|
||||||
Locale.setDefault(locale);
|
Locale.setDefault(locale);
|
||||||
Resources resources = this.getResources();
|
Resources resources = this.getResources();
|
||||||
|
@ -218,7 +218,7 @@ public class StationDetailsPlotsWind extends AppCompatActivity implements SeekBa
|
||||||
// utc timestamp
|
// utc timestamp
|
||||||
long utcTimestamp = utcTime.toEpochSecond();
|
long utcTimestamp = utcTime.toEpochSecond();
|
||||||
|
|
||||||
Logger.debug("[StationDetailsPlotsWind][downloadDataFromWebservice][station.getSystemName() = " + station.getSystemName() +"]");
|
Logger.debug("[station.getSystemName() = " + station.getSystemName() +"]");
|
||||||
|
|
||||||
if (this.dataLn < 0 || this.dataLn > 2) {
|
if (this.dataLn < 0 || this.dataLn > 2) {
|
||||||
// last 2000 points of data, regardless the timescale
|
// last 2000 points of data, regardless the timescale
|
||||||
|
@ -242,7 +242,7 @@ public class StationDetailsPlotsWind extends AppCompatActivity implements SeekBa
|
||||||
|
|
||||||
if (data instanceof ListOfStationData) {
|
if (data instanceof ListOfStationData) {
|
||||||
|
|
||||||
Logger.debug("[StationDetailsPlotsWind][downloadDataFromWebservice][data.list_of_station_data.length = " + data.list_of_station_data.length +"]");
|
Logger.debug("[data.list_of_station_data.length = " + data.list_of_station_data.length +"]");
|
||||||
|
|
||||||
for (StationData d : data.list_of_station_data) {
|
for (StationData d : data.list_of_station_data) {
|
||||||
valuesWindSpeed.add(new Entry(d.epoch * 1000, d.windspeed));
|
valuesWindSpeed.add(new Entry(d.epoch * 1000, d.windspeed));
|
||||||
|
|
|
@ -16,8 +16,9 @@ import java.util.Locale;
|
||||||
|
|
||||||
import cc.pogoda.mobile.meteosystem.Main;
|
import cc.pogoda.mobile.meteosystem.Main;
|
||||||
import cc.pogoda.mobile.meteosystem.R;
|
import cc.pogoda.mobile.meteosystem.R;
|
||||||
import cc.pogoda.mobile.meteosystem.activity.updater.StationDetailsValuesOnActivityFromSummaryUpdater;
|
import cc.pogoda.mobile.meteosystem.activity.updater.StationDetailsValuesOnActivityFromFavsUpdater;
|
||||||
import cc.pogoda.mobile.meteosystem.activity.updater.StationDetailsValuesOnActivityUpdater;
|
import cc.pogoda.mobile.meteosystem.activity.updater.StationDetailsValuesOnActivityUpdater;
|
||||||
|
import cc.pogoda.mobile.meteosystem.activity.updater.thread.StationSummaryUpdaterThread;
|
||||||
import cc.pogoda.mobile.meteosystem.config.AppConfiguration;
|
import cc.pogoda.mobile.meteosystem.config.AppConfiguration;
|
||||||
import cc.pogoda.mobile.meteosystem.dao.SummaryDao;
|
import cc.pogoda.mobile.meteosystem.dao.SummaryDao;
|
||||||
import cc.pogoda.mobile.meteosystem.type.StationSummaryActElements;
|
import cc.pogoda.mobile.meteosystem.type.StationSummaryActElements;
|
||||||
|
@ -30,9 +31,11 @@ public class StationDetailsSummaryActivity extends AppCompatActivity {
|
||||||
|
|
||||||
WeatherStation station = null;
|
WeatherStation station = null;
|
||||||
|
|
||||||
|
StationSummaryUpdaterThread updaterThread = null;
|
||||||
|
|
||||||
StationDetailsValuesOnActivityUpdater valuesOnActUpdater = null;
|
StationDetailsValuesOnActivityUpdater valuesOnActUpdater = null;
|
||||||
|
|
||||||
StationDetailsValuesOnActivityFromSummaryUpdater valuesFromSummaryUpdater = null;
|
StationDetailsValuesOnActivityFromFavsUpdater valuesFromFavsSummaryUpdater = null;
|
||||||
|
|
||||||
Handler handler = null;
|
Handler handler = null;
|
||||||
|
|
||||||
|
@ -54,10 +57,10 @@ public class StationDetailsSummaryActivity extends AppCompatActivity {
|
||||||
|
|
||||||
station = (WeatherStation) getIntent().getSerializableExtra("station");
|
station = (WeatherStation) getIntent().getSerializableExtra("station");
|
||||||
|
|
||||||
Logger.info("[StationDetailsSummaryActivity][onCreate][station.getSystemName() = " + station.getSystemName() +"]");
|
Logger.info("[station.getSystemName() = " + station.getSystemName() +"]");
|
||||||
|
|
||||||
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
||||||
Logger.debug("[StationDetailsPlotsHumidity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
Logger.debug("[AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
||||||
Locale locale = new Locale(AppConfiguration.locale);
|
Locale locale = new Locale(AppConfiguration.locale);
|
||||||
Locale.setDefault(locale);
|
Locale.setDefault(locale);
|
||||||
Resources resources = this.getResources();
|
Resources resources = this.getResources();
|
||||||
|
@ -89,11 +92,6 @@ public class StationDetailsSummaryActivity extends AppCompatActivity {
|
||||||
elems.goodColor = color;
|
elems.goodColor = color;
|
||||||
elems.badColor = Color.RED;
|
elems.badColor = Color.RED;
|
||||||
|
|
||||||
// get the summary data for this station
|
|
||||||
summary = summary_dao.getStationSummary(station.getSystemName());
|
|
||||||
|
|
||||||
elems.updateFromSummary(summary, station.getAvailableParameters());
|
|
||||||
|
|
||||||
// create a handler to update station data in background
|
// create a handler to update station data in background
|
||||||
handler = new Handler();
|
handler = new Handler();
|
||||||
|
|
||||||
|
@ -101,24 +99,42 @@ public class StationDetailsSummaryActivity extends AppCompatActivity {
|
||||||
boolean onFavs = main.checkIsOnFavsList(station.getSystemName());
|
boolean onFavs = main.checkIsOnFavsList(station.getSystemName());
|
||||||
|
|
||||||
if (onFavs) {
|
if (onFavs) {
|
||||||
valuesFromSummaryUpdater = new StationDetailsValuesOnActivityFromSummaryUpdater(elems, handler, station, main.getHashmapStationSystemNameToSummary());
|
valuesFromFavsSummaryUpdater = new StationDetailsValuesOnActivityFromFavsUpdater(elems, handler, station, main.getHashmapFavStationSystemNameToSummary());
|
||||||
|
|
||||||
if (handler != null && valuesFromSummaryUpdater != null) {
|
if (handler != null && valuesFromFavsSummaryUpdater != null) {
|
||||||
handler.post(valuesFromSummaryUpdater);
|
handler.post(valuesFromFavsSummaryUpdater);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
updaterThread = new StationSummaryUpdaterThread(station.getSystemName());
|
||||||
|
|
||||||
// create a copy of updater class for this station
|
// create a copy of updater class for this station
|
||||||
valuesOnActUpdater = new StationDetailsValuesOnActivityUpdater(elems, handler, station.getSystemName(), station);
|
valuesOnActUpdater = new StationDetailsValuesOnActivityUpdater(elems, handler, updaterThread, station);
|
||||||
|
|
||||||
if (handler != null && valuesOnActUpdater != null) {
|
if (handler != null && valuesOnActUpdater != null) {
|
||||||
handler.post(valuesOnActUpdater);
|
updaterThread.start(50);
|
||||||
|
|
||||||
|
handler.postDelayed(valuesOnActUpdater, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
|
||||||
|
if (updaterThread != null) {
|
||||||
|
updaterThread.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
if (updaterThread != null) {
|
||||||
|
updaterThread.start(50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -128,6 +144,20 @@ public class StationDetailsSummaryActivity extends AppCompatActivity {
|
||||||
handler.removeCallbacks(valuesOnActUpdater);
|
handler.removeCallbacks(valuesOnActUpdater);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (updaterThread != null) {
|
||||||
|
updaterThread.stop();
|
||||||
|
}
|
||||||
|
|
||||||
super.onStop();
|
super.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
|
||||||
|
if (updaterThread != null) {
|
||||||
|
updaterThread.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -9,8 +9,9 @@ import org.tinylog.Logger;
|
||||||
|
|
||||||
import cc.pogoda.mobile.meteosystem.Main;
|
import cc.pogoda.mobile.meteosystem.Main;
|
||||||
import cc.pogoda.mobile.meteosystem.R;
|
import cc.pogoda.mobile.meteosystem.R;
|
||||||
import cc.pogoda.mobile.meteosystem.activity.updater.StationDetailsValuesOnActivityFromSummaryUpdater;
|
import cc.pogoda.mobile.meteosystem.activity.updater.StationDetailsValuesOnActivityFromFavsUpdater;
|
||||||
import cc.pogoda.mobile.meteosystem.activity.updater.StationDetailsValuesOnActivityUpdater;
|
import cc.pogoda.mobile.meteosystem.activity.updater.StationDetailsValuesOnActivityUpdater;
|
||||||
|
import cc.pogoda.mobile.meteosystem.activity.updater.thread.StationSummaryUpdaterThread;
|
||||||
import cc.pogoda.mobile.meteosystem.dao.SummaryDao;
|
import cc.pogoda.mobile.meteosystem.dao.SummaryDao;
|
||||||
import cc.pogoda.mobile.meteosystem.type.StationWindRoseActElements;
|
import cc.pogoda.mobile.meteosystem.type.StationWindRoseActElements;
|
||||||
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
|
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
|
||||||
|
@ -22,9 +23,11 @@ public class StationDetailsWindRoseActivity extends AppCompatActivity {
|
||||||
|
|
||||||
Summary summary;
|
Summary summary;
|
||||||
|
|
||||||
|
StationSummaryUpdaterThread updaterThread = null;
|
||||||
|
|
||||||
StationDetailsValuesOnActivityUpdater onActivityUpdater = null;
|
StationDetailsValuesOnActivityUpdater onActivityUpdater = null;
|
||||||
|
|
||||||
StationDetailsValuesOnActivityFromSummaryUpdater fromSummaryUpdater = null;
|
StationDetailsValuesOnActivityFromFavsUpdater fromSummaryUpdater = null;
|
||||||
|
|
||||||
Handler handler = null;
|
Handler handler = null;
|
||||||
|
|
||||||
|
@ -43,7 +46,7 @@ public class StationDetailsWindRoseActivity extends AppCompatActivity {
|
||||||
|
|
||||||
station = (WeatherStation) getIntent().getSerializableExtra("station");
|
station = (WeatherStation) getIntent().getSerializableExtra("station");
|
||||||
|
|
||||||
Logger.info("[StationDetailsWindRoseActivity][onCreate][station.getSystemName() = " + station.getSystemName() +"]");
|
Logger.info("[station.getSystemName() = " + station.getSystemName() +"]");
|
||||||
|
|
||||||
main = (Main)getApplication();
|
main = (Main)getApplication();
|
||||||
|
|
||||||
|
@ -64,11 +67,11 @@ public class StationDetailsWindRoseActivity extends AppCompatActivity {
|
||||||
|
|
||||||
SummaryDao summary_dao = new SummaryDao();
|
SummaryDao summary_dao = new SummaryDao();
|
||||||
|
|
||||||
// get the set of current values to preconfigure all elements on this activity
|
// // get the set of current values to preconfigure all elements on this activity
|
||||||
summary = summary_dao.getStationSummary(station.getSystemName());
|
// summary = summary_dao.getStationSummary(station.getSystemName());
|
||||||
|
//
|
||||||
// update parameters (like turn the wind direction arrow)
|
// // update parameters (like turn the wind direction arrow)
|
||||||
elements.updateFromSummary(summary, station.getAvailableParameters());
|
// elements.updateFromSummary(summary, station.getAvailableParameters());
|
||||||
|
|
||||||
handler = new Handler();
|
handler = new Handler();
|
||||||
|
|
||||||
|
@ -76,24 +79,46 @@ public class StationDetailsWindRoseActivity extends AppCompatActivity {
|
||||||
boolean onFavs = main.checkIsOnFavsList(station.getSystemName());
|
boolean onFavs = main.checkIsOnFavsList(station.getSystemName());
|
||||||
|
|
||||||
if (onFavs) {
|
if (onFavs) {
|
||||||
fromSummaryUpdater = new StationDetailsValuesOnActivityFromSummaryUpdater(elements, handler, station, main.getHashmapStationSystemNameToSummary());
|
fromSummaryUpdater = new StationDetailsValuesOnActivityFromFavsUpdater(elements, handler, station, main.getHashmapFavStationSystemNameToSummary());
|
||||||
|
|
||||||
if (handler != null && fromSummaryUpdater != null) {
|
if (handler != null && fromSummaryUpdater != null) {
|
||||||
handler.post(fromSummaryUpdater);
|
handler.post(fromSummaryUpdater);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
onActivityUpdater = new StationDetailsValuesOnActivityUpdater(elements, handler, station.getSystemName(), station);
|
updaterThread = new StationSummaryUpdaterThread(station.getSystemName());
|
||||||
|
|
||||||
|
onActivityUpdater = new StationDetailsValuesOnActivityUpdater(elements, handler, updaterThread, station);
|
||||||
|
|
||||||
if (handler != null && onActivityUpdater != null) {
|
if (handler != null && onActivityUpdater != null) {
|
||||||
|
updaterThread.start(50);
|
||||||
|
|
||||||
// start the handler to update the wind rose activity in background
|
// start the handler to update the wind rose activity in background
|
||||||
handler.post(onActivityUpdater);
|
handler.postDelayed(onActivityUpdater, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
|
||||||
|
if (updaterThread != null) {
|
||||||
|
updaterThread.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
if (updaterThread != null && updaterThread.isEnabled() == false) {
|
||||||
|
updaterThread.start(50);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
|
|
||||||
|
@ -102,6 +127,19 @@ public class StationDetailsWindRoseActivity extends AppCompatActivity {
|
||||||
handler.removeCallbacks(onActivityUpdater);
|
handler.removeCallbacks(onActivityUpdater);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (updaterThread != null) {
|
||||||
|
updaterThread.stop();
|
||||||
|
}
|
||||||
|
|
||||||
super.onStop();
|
super.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
if (updaterThread != null) {
|
||||||
|
updaterThread.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -38,7 +38,7 @@ public class TrendActivity extends AppCompatActivity {
|
||||||
String stationName = (String)getIntent().getExtras().get("station");
|
String stationName = (String)getIntent().getExtras().get("station");
|
||||||
|
|
||||||
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
|
||||||
Logger.debug("[StationDetailsPlotsHumidity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
Logger.debug("[AppConfiguration.locale = " + AppConfiguration.locale + "]");
|
||||||
Locale locale = new Locale(AppConfiguration.locale);
|
Locale locale = new Locale(AppConfiguration.locale);
|
||||||
Locale.setDefault(locale);
|
Locale.setDefault(locale);
|
||||||
Resources resources = this.getResources();
|
Resources resources = this.getResources();
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class MainActImageButtonExportClickEvent implements View.OnClickListener{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
Logger.info("[MainActImageButtonExportClickEvent][onClick]");
|
Logger.info("[onClick]");
|
||||||
|
|
||||||
parent.startActivity(intent);
|
parent.startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package cc.pogoda.mobile.meteosystem.activity.updater;
|
package cc.pogoda.mobile.meteosystem.activity.updater;
|
||||||
|
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.ConstAppConfiguration.DETAILS_ON_FAVS_LIST_DEFAULT_UPDATE;
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.ConstAppConfiguration.DETAILS_ON_FAVS_LIST_REUPDATE;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
@ -12,15 +15,16 @@ import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import cc.pogoda.mobile.meteosystem.activity.updater.thread.FavouritesStationSummaryUpdaterThread;
|
||||||
import cc.pogoda.mobile.meteosystem.dao.AvailableParametersDao;
|
import cc.pogoda.mobile.meteosystem.dao.AvailableParametersDao;
|
||||||
import cc.pogoda.mobile.meteosystem.dao.SummaryDao;
|
import cc.pogoda.mobile.meteosystem.type.AvailableParameters;
|
||||||
import cc.pogoda.mobile.meteosystem.type.web.AvailableParametersWeb;
|
import cc.pogoda.mobile.meteosystem.type.web.AvailableParametersWeb;
|
||||||
import cc.pogoda.mobile.meteosystem.type.web.QualityFactor;
|
import cc.pogoda.mobile.meteosystem.type.web.QualityFactor;
|
||||||
import cc.pogoda.mobile.meteosystem.type.web.Summary;
|
import cc.pogoda.mobile.meteosystem.type.web.Summary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is used to update entries (TextView) on Favourites list using HashMap
|
* This class is used to update entries (TextView) on Favourites list using HashMap
|
||||||
* which is updated by {@link FavouritesStationSummaryUpdater}
|
* which is updated by {@link FavouritesStationSummaryUpdaterThread}
|
||||||
*/
|
*/
|
||||||
public class FavouritesStationDetailsOnListUpdater implements Runnable {
|
public class FavouritesStationDetailsOnListUpdater implements Runnable {
|
||||||
|
|
||||||
|
@ -38,10 +42,11 @@ public class FavouritesStationDetailsOnListUpdater implements Runnable {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private AvailableParametersDao availableParametersDao = null;
|
//private AvailableParametersDao availableParametersDao = null;
|
||||||
|
private HashMap<String, AvailableParameters> availParams;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This map comes from 'Main' class and it is shared with @link{{@link FavouritesStationSummaryUpdater}}
|
* This map comes from 'Main' class and it is shared with @link{{@link FavouritesStationSummaryUpdaterThread}}
|
||||||
*/
|
*/
|
||||||
HashMap<String, Summary> stationNameSummary = null;
|
HashMap<String, Summary> stationNameSummary = null;
|
||||||
|
|
||||||
|
@ -51,10 +56,10 @@ public class FavouritesStationDetailsOnListUpdater implements Runnable {
|
||||||
*/
|
*/
|
||||||
private boolean enabled;
|
private boolean enabled;
|
||||||
|
|
||||||
public FavouritesStationDetailsOnListUpdater(Handler _handler, HashMap<String, Summary> _station_system_name_to_summary) {
|
public FavouritesStationDetailsOnListUpdater(Handler _handler, HashMap<String, Summary> _station_system_name_to_summary, HashMap<String, AvailableParameters> _avail_params) {
|
||||||
handler = _handler;
|
handler = _handler;
|
||||||
stationsToUpdate = new HashMap<>();
|
stationsToUpdate = new HashMap<>();
|
||||||
availableParametersDao = new AvailableParametersDao();
|
availParams = _avail_params;
|
||||||
stationNameSummary = _station_system_name_to_summary;
|
stationNameSummary = _station_system_name_to_summary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +79,7 @@ public class FavouritesStationDetailsOnListUpdater implements Runnable {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
int nextExecutionDelay = 45000;
|
int nextExecutionDelay = DETAILS_ON_FAVS_LIST_DEFAULT_UPDATE;
|
||||||
|
|
||||||
if (stationNameSummary != null && enabled && stationsToUpdate != null && stationsToUpdate.size() > 0) {
|
if (stationNameSummary != null && enabled && stationsToUpdate != null && stationsToUpdate.size() > 0) {
|
||||||
|
|
||||||
|
@ -95,23 +100,19 @@ public class FavouritesStationDetailsOnListUpdater implements Runnable {
|
||||||
Summary summary = stationNameSummary.get(stationSystemName);
|
Summary summary = stationNameSummary.get(stationSystemName);
|
||||||
|
|
||||||
// query for available parameters
|
// query for available parameters
|
||||||
AvailableParametersWeb params
|
AvailableParameters params = availParams.get(stationSystemName);
|
||||||
= availableParametersDao.getAvaliableParamsByStationName(stationSystemName);
|
|
||||||
|
|
||||||
// if data has been collected
|
// if data has been collected
|
||||||
if (summary != null && params != null) {
|
if (summary != null && params != null) {
|
||||||
Logger.debug("[FavouritesStationDetailsOnListUpdater][run][stationSystemName = " + stationSystemName +"][summary.last_timestamp = " + summary.last_timestamp +"]");
|
Logger.debug("[stationSystemName = " + stationSystemName +"][summary.last_timestamp = " + summary.last_timestamp +"]");
|
||||||
|
|
||||||
String str;
|
String str;
|
||||||
|
|
||||||
Logger.debug("[FavouritesStationDetailsOnListUpdater][run][stationSystemName = " +
|
|
||||||
"" + stationSystemName +"][summary.last_timestamp = " + summary.last_timestamp +"]");
|
|
||||||
|
|
||||||
// check if this station transmits wind information
|
// check if this station transmits wind information
|
||||||
if (params.hasWind) {
|
if (params.windSpeed) {
|
||||||
|
|
||||||
// check if station transmits humidity
|
// check if station transmits humidity
|
||||||
if (params.hasHumidity) {
|
if (params.humidity) {
|
||||||
str = String.format("%s %d%% %s %s max %s", summary.getTemperatureStr(false, true), summary.humidity, summary.getWindDirStr(), summary.getWindspeedStr(false), summary.getWindgustsStr(false));
|
str = String.format("%s %d%% %s %s max %s", summary.getTemperatureStr(false, true), summary.humidity, summary.getWindDirStr(), summary.getWindspeedStr(false), summary.getWindgustsStr(false));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -119,7 +120,7 @@ public class FavouritesStationDetailsOnListUpdater implements Runnable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (params.hasHumidity) {
|
if (params.humidity) {
|
||||||
str = String.format("%s %d%%", summary.getTemperatureStr(false, true), summary.humidity);
|
str = String.format("%s %d%%", summary.getTemperatureStr(false, true), summary.humidity);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -131,9 +132,9 @@ public class FavouritesStationDetailsOnListUpdater implements Runnable {
|
||||||
// update text view on the favourites list
|
// update text view on the favourites list
|
||||||
toUpdate.setText(str);
|
toUpdate.setText(str);
|
||||||
|
|
||||||
if ( (params.hasHumidity && summary.humidity_qf_native.equals(QualityFactor.NOT_AVALIABLE)) ||
|
if ( (params.humidity && summary.humidity_qf_native.equals(QualityFactor.NOT_AVALIABLE)) ||
|
||||||
(summary.temperature_qf_native.equals(QualityFactor.NOT_AVALIABLE)) ||
|
(summary.temperature_qf_native.equals(QualityFactor.NOT_AVALIABLE)) ||
|
||||||
(params.hasWind && summary.wind_qf_native.equals(QualityFactor.NOT_AVALIABLE)))
|
(params.windSpeed && summary.wind_qf_native.equals(QualityFactor.NOT_AVALIABLE)))
|
||||||
{
|
{
|
||||||
toUpdate.setTextColor(Color.RED);
|
toUpdate.setTextColor(Color.RED);
|
||||||
}
|
}
|
||||||
|
@ -142,8 +143,8 @@ public class FavouritesStationDetailsOnListUpdater implements Runnable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Logger.error("[FavouritesStationDetailsOnListUpdater][run][summary object is null!! Maybe the API responds exceptionally slow?]");
|
Logger.error("[stationSystemName = " + stationSystemName + "][summary object is null!! Maybe the API responds exceptionally slow?]");
|
||||||
nextExecutionDelay = 3000;
|
nextExecutionDelay = DETAILS_ON_FAVS_LIST_REUPDATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
package cc.pogoda.mobile.meteosystem.activity.updater;
|
||||||
|
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.ConstAppConfiguration.NORMAL_UPDATE_VALUES_ON_ACTIVITY;
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.ConstAppConfiguration.REUPDATE_VALUES_ON_ACTIVITY_ON_FAIL;
|
||||||
|
|
||||||
|
import android.os.Handler;
|
||||||
|
|
||||||
|
import org.tinylog.Logger;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import cc.pogoda.mobile.meteosystem.activity.updater.thread.FavouritesStationSummaryUpdaterThread;
|
||||||
|
import cc.pogoda.mobile.meteosystem.type.StationActivityElements;
|
||||||
|
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
|
||||||
|
import cc.pogoda.mobile.meteosystem.type.web.Summary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class uses external HashMap updated by @link{{@link FavouritesStationSummaryUpdaterThread}}
|
||||||
|
*/
|
||||||
|
public class StationDetailsValuesOnActivityFromFavsUpdater implements Runnable {
|
||||||
|
|
||||||
|
HashMap<String, Summary> mapWithSummary;
|
||||||
|
|
||||||
|
StationActivityElements elementsToUpdate;
|
||||||
|
|
||||||
|
Handler handler;
|
||||||
|
|
||||||
|
WeatherStation stationToUpdate;
|
||||||
|
|
||||||
|
public StationDetailsValuesOnActivityFromFavsUpdater(StationActivityElements elems, Handler h, WeatherStation station, HashMap<String, Summary> _map_with_summary_data) {
|
||||||
|
stationToUpdate = station;
|
||||||
|
handler = h;
|
||||||
|
elementsToUpdate = elems;
|
||||||
|
mapWithSummary = _map_with_summary_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
if (mapWithSummary != null && elementsToUpdate != null) {
|
||||||
|
|
||||||
|
Logger.info("[stationToUpdate.getSystemName() = " + stationToUpdate.getSystemName() +"]");
|
||||||
|
|
||||||
|
Summary summary = mapWithSummary.get(stationToUpdate.getSystemName());
|
||||||
|
|
||||||
|
if (summary != null) {
|
||||||
|
elementsToUpdate.updateFromSummary(summary, stationToUpdate.getAvailableParameters());
|
||||||
|
handler.postDelayed(this, NORMAL_UPDATE_VALUES_ON_ACTIVITY);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
handler.postDelayed(this, REUPDATE_VALUES_ON_ACTIVITY_ON_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,45 +0,0 @@
|
||||||
package cc.pogoda.mobile.meteosystem.activity.updater;
|
|
||||||
|
|
||||||
import android.os.Handler;
|
|
||||||
|
|
||||||
import org.tinylog.Logger;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import cc.pogoda.mobile.meteosystem.type.StationActivityElements;
|
|
||||||
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
|
|
||||||
import cc.pogoda.mobile.meteosystem.type.web.Summary;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class uses external HashMap updated by @link{{@link FavouritesStationSummaryUpdater}}
|
|
||||||
*/
|
|
||||||
public class StationDetailsValuesOnActivityFromSummaryUpdater implements Runnable {
|
|
||||||
|
|
||||||
HashMap<String, Summary> mapWithSummary;
|
|
||||||
|
|
||||||
StationActivityElements elementsToUpdate;
|
|
||||||
|
|
||||||
Handler handler;
|
|
||||||
|
|
||||||
WeatherStation stationToUpdate;
|
|
||||||
|
|
||||||
public StationDetailsValuesOnActivityFromSummaryUpdater(StationActivityElements elems, Handler h, WeatherStation station, HashMap<String, Summary> _map_with_summary_data) {
|
|
||||||
stationToUpdate = station;
|
|
||||||
handler = h;
|
|
||||||
elementsToUpdate = elems;
|
|
||||||
mapWithSummary = _map_with_summary_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
|
|
||||||
if (mapWithSummary != null && elementsToUpdate != null) {
|
|
||||||
|
|
||||||
Logger.info("[StationDetailsValuesOnActivityFromSummaryUpdater][run][stationToUpdate.getSystemName() = " + stationToUpdate.getSystemName() +"]");
|
|
||||||
|
|
||||||
elementsToUpdate.updateFromSummary(mapWithSummary.get(stationToUpdate.getSystemName()), stationToUpdate.getAvailableParameters());
|
|
||||||
|
|
||||||
handler.postDelayed(this, 90000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +1,13 @@
|
||||||
package cc.pogoda.mobile.meteosystem.activity.updater;
|
package cc.pogoda.mobile.meteosystem.activity.updater;
|
||||||
|
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.ConstAppConfiguration.NORMAL_UPDATE_VALUES_ON_ACTIVITY;
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.ConstAppConfiguration.REUPDATE_VALUES_ON_ACTIVITY_ON_FAIL;
|
||||||
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
|
||||||
import org.tinylog.Logger;
|
import org.tinylog.Logger;
|
||||||
|
|
||||||
|
import cc.pogoda.mobile.meteosystem.activity.updater.thread.StationSummaryUpdaterThread;
|
||||||
import cc.pogoda.mobile.meteosystem.dao.SummaryDao;
|
import cc.pogoda.mobile.meteosystem.dao.SummaryDao;
|
||||||
import cc.pogoda.mobile.meteosystem.type.StationActivityElements;
|
import cc.pogoda.mobile.meteosystem.type.StationActivityElements;
|
||||||
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
|
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
|
||||||
|
@ -23,16 +27,19 @@ public class StationDetailsValuesOnActivityUpdater implements Runnable {
|
||||||
|
|
||||||
SummaryDao dao = null;
|
SummaryDao dao = null;
|
||||||
|
|
||||||
|
StationSummaryUpdaterThread updater_thread;
|
||||||
|
|
||||||
Summary station_summary = null;
|
Summary station_summary = null;
|
||||||
|
|
||||||
String station_name;
|
String station_name;
|
||||||
|
|
||||||
WeatherStation station;
|
WeatherStation station;
|
||||||
|
|
||||||
public StationDetailsValuesOnActivityUpdater(StationActivityElements elems, Handler h, String station_name, WeatherStation station) {
|
public StationDetailsValuesOnActivityUpdater(StationActivityElements elems, Handler h, StationSummaryUpdaterThread updaterThread, WeatherStation station) {
|
||||||
elements = elems;
|
elements = elems;
|
||||||
handler = h;
|
handler = h;
|
||||||
this.station_name = station_name;
|
updater_thread = updaterThread;
|
||||||
|
this.station_name = station.getSystemName();
|
||||||
this.station = station;
|
this.station = station;
|
||||||
|
|
||||||
dao = new SummaryDao();
|
dao = new SummaryDao();
|
||||||
|
@ -42,19 +49,26 @@ public class StationDetailsValuesOnActivityUpdater implements Runnable {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
if (elements == null) {
|
if (elements == null || updater_thread == null) {
|
||||||
|
Logger.error("[something is null even if it shouldn't!!!!]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// get the current data from the Web Service
|
// get the current data from the Web Service
|
||||||
station_summary = dao.getStationSummary(station_name);
|
station_summary = updater_thread.getSummary();
|
||||||
|
|
||||||
Logger.debug("[StationDetailsValuesOnActivityUpdater][run][station_name = " + station_name +"]");
|
Logger.debug("[station_name = " + station_name +"]");
|
||||||
|
|
||||||
// null check is done inside this call
|
if (station_summary != null) {
|
||||||
elements.updateFromSummary(station_summary, station.getAvailableParameters());
|
// null check is done inside this call
|
||||||
|
elements.updateFromSummary(station_summary, station.getAvailableParameters());
|
||||||
handler.postDelayed(this, 90000);
|
handler.postDelayed(this, NORMAL_UPDATE_VALUES_ON_ACTIVITY);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 'station_summary' might be null if internet connection is poor and background
|
||||||
|
// thread wasn't able to download a summary on time
|
||||||
|
handler.postDelayed(this, REUPDATE_VALUES_ON_ACTIVITY_ON_FAIL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
package cc.pogoda.mobile.meteosystem.activity.updater;
|
package cc.pogoda.mobile.meteosystem.activity.updater.thread;
|
||||||
|
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.ConstAppConfiguration.REUPDATE_VALUES_ON_ACTIVITY_ON_FAIL;
|
||||||
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
|
@ -15,19 +17,26 @@ import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import cc.pogoda.mobile.meteosystem.dao.AvailableParametersDao;
|
||||||
import cc.pogoda.mobile.meteosystem.dao.SummaryDao;
|
import cc.pogoda.mobile.meteosystem.dao.SummaryDao;
|
||||||
|
import cc.pogoda.mobile.meteosystem.type.AvailableParameters;
|
||||||
|
import cc.pogoda.mobile.meteosystem.type.web.AvailableParametersWeb;
|
||||||
import cc.pogoda.mobile.meteosystem.type.web.Summary;
|
import cc.pogoda.mobile.meteosystem.type.web.Summary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is a runnable executed from background Thread by ScheduledExecuter
|
* This class is a runnable executed from background Thread by ScheduledExecuter
|
||||||
* which periodically download current Summary for all stations stored on favourites list
|
* which periodically download current Summary for all stations stored on favourites list
|
||||||
*/
|
*/
|
||||||
public class FavouritesStationSummaryUpdater implements Runnable {
|
public class FavouritesStationSummaryUpdaterThread implements Runnable {
|
||||||
|
|
||||||
private HashMap<String, Summary> map;
|
private HashMap<String, Summary> map;
|
||||||
|
|
||||||
|
private HashMap<String, AvailableParameters> availableParametersHashMap;
|
||||||
|
|
||||||
private SummaryDao summaryDao;
|
private SummaryDao summaryDao;
|
||||||
|
|
||||||
|
private AvailableParametersDao availableParametersDao;
|
||||||
|
|
||||||
private ScheduledExecutorService executor;
|
private ScheduledExecutorService executor;
|
||||||
|
|
||||||
private ScheduledFuture scheduledTask;
|
private ScheduledFuture scheduledTask;
|
||||||
|
@ -39,9 +48,12 @@ public class FavouritesStationSummaryUpdater implements Runnable {
|
||||||
*/
|
*/
|
||||||
private boolean forceUpdate = false;
|
private boolean forceUpdate = false;
|
||||||
|
|
||||||
public FavouritesStationSummaryUpdater(HashMap<String, Summary> _out_map) {
|
public FavouritesStationSummaryUpdaterThread(HashMap<String, Summary> _out_map, HashMap<String, AvailableParameters> _avail_params_map) {
|
||||||
map = _out_map;
|
map = _out_map;
|
||||||
|
availableParametersHashMap = _avail_params_map;
|
||||||
|
|
||||||
summaryDao = new SummaryDao();
|
summaryDao = new SummaryDao();
|
||||||
|
availableParametersDao = new AvailableParametersDao();
|
||||||
|
|
||||||
executor = Executors.newScheduledThreadPool(5);
|
executor = Executors.newScheduledThreadPool(5);
|
||||||
}
|
}
|
||||||
|
@ -51,7 +63,7 @@ public class FavouritesStationSummaryUpdater implements Runnable {
|
||||||
// check if map was set so something
|
// check if map was set so something
|
||||||
if (map != null && map.size() > 0) {
|
if (map != null && map.size() > 0) {
|
||||||
|
|
||||||
Logger.info("[FavouritesStationSummaryUpdater][run][map.size() = " + map.size() +"]");
|
Logger.info("[map.size() = " + map.size() +"]");
|
||||||
|
|
||||||
// get a set of all stations from favourites
|
// get a set of all stations from favourites
|
||||||
Set<Map.Entry<String, Summary>> _set_of_stations_names = map.entrySet();
|
Set<Map.Entry<String, Summary>> _set_of_stations_names = map.entrySet();
|
||||||
|
@ -70,11 +82,17 @@ public class FavouritesStationSummaryUpdater implements Runnable {
|
||||||
|
|
||||||
// check if summary was returned (as it will not in case on HTTP 500 or something else)
|
// check if summary was returned (as it will not in case on HTTP 500 or something else)
|
||||||
if (summary != null) {
|
if (summary != null) {
|
||||||
Logger.info("[FavouritesStationSummaryUpdater][run][station_name = " + station_name + "][summary.last_timestamp = " + summary.last_timestamp + "]");
|
Logger.info("[station_name = " + station_name + "][summary.last_timestamp = " + summary.last_timestamp + "]");
|
||||||
|
|
||||||
// put the summary back into the map
|
// put the summary back into the map
|
||||||
map.put(station_name, summary);
|
map.put(station_name, summary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AvailableParameters parameters = AvailableParameters.fromWebData(availableParametersDao.getAvaliableParamsByStationName(station_name));
|
||||||
|
|
||||||
|
if (parameters != null) {
|
||||||
|
availableParametersHashMap.put(station_name, parameters);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,10 +101,10 @@ public class FavouritesStationSummaryUpdater implements Runnable {
|
||||||
// no station to update may be caused by two reasons
|
// no station to update may be caused by two reasons
|
||||||
// 1. there is no weather station to update
|
// 1. there is no weather station to update
|
||||||
// 2. API responds very slow or there is a problem with internet connection
|
// 2. API responds very slow or there is a problem with internet connection
|
||||||
Logger.info("[FavouritesStationSummaryUpdater][run][no station to update]");
|
Logger.info("[no station to update]");
|
||||||
|
|
||||||
stop();
|
stop();
|
||||||
start(5000);
|
start(REUPDATE_VALUES_ON_ACTIVITY_ON_FAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (forceUpdate) {
|
if (forceUpdate) {
|
||||||
|
@ -106,7 +124,7 @@ public class FavouritesStationSummaryUpdater implements Runnable {
|
||||||
|
|
||||||
public void start(int _initial_delay) {
|
public void start(int _initial_delay) {
|
||||||
|
|
||||||
Logger.debug("[FavouritesStationSummaryUpdater][start][_initial_delay = " + _initial_delay +"]");
|
Logger.debug("[_initial_delay = " + _initial_delay +"]");
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
stop();
|
stop();
|
|
@ -0,0 +1,89 @@
|
||||||
|
package cc.pogoda.mobile.meteosystem.activity.updater.thread;
|
||||||
|
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.ConstAppConfiguration.REUPDATE_VALUES_ON_ACTIVITY_ON_FAIL;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import org.tinylog.Logger;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import cc.pogoda.mobile.meteosystem.dao.SummaryDao;
|
||||||
|
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
|
||||||
|
import cc.pogoda.mobile.meteosystem.type.web.Summary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is simmilar to {@link FavouritesStationSummaryUpdaterThread}, but it
|
||||||
|
* downloads summary data for any defined weather station
|
||||||
|
*/
|
||||||
|
public class StationSummaryUpdaterThread implements Runnable {
|
||||||
|
|
||||||
|
public boolean isEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean enabled = false;
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
String systemName;
|
||||||
|
|
||||||
|
ScheduledExecutorService executorService;
|
||||||
|
|
||||||
|
ScheduledFuture scheduledTask;
|
||||||
|
|
||||||
|
Summary summary = null;
|
||||||
|
|
||||||
|
public Summary getSummary() {
|
||||||
|
return summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StationSummaryUpdaterThread(@NonNull String stationSystemName) {
|
||||||
|
systemName = stationSystemName;
|
||||||
|
|
||||||
|
executorService = Executors.newScheduledThreadPool(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (systemName != null) {
|
||||||
|
Logger.info("[StationSummaryUpdaterThread][run][systemName = " + systemName +"]");
|
||||||
|
|
||||||
|
SummaryDao summaryDao = new SummaryDao();
|
||||||
|
|
||||||
|
summary = summaryDao.getStationSummary(systemName);
|
||||||
|
|
||||||
|
if (summary == null) {
|
||||||
|
// no ssummary data may be caused by two reasons
|
||||||
|
// 1. there is no weather station to update
|
||||||
|
// 2. API responds very slow or there is a problem with internet connection
|
||||||
|
Logger.info("[no station to update]");
|
||||||
|
|
||||||
|
stop();
|
||||||
|
start(REUPDATE_VALUES_ON_ACTIVITY_ON_FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start(int _initial_delay) {
|
||||||
|
|
||||||
|
Logger.info("[_initial_delay = " + _initial_delay +"]");
|
||||||
|
|
||||||
|
if (enabled) {
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
scheduledTask = executorService.scheduleAtFixedRate(this, _initial_delay, 60000, TimeUnit.MILLISECONDS);
|
||||||
|
enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stop() {
|
||||||
|
if (enabled) {
|
||||||
|
Logger.info("[systemName = " + systemName +"]");
|
||||||
|
scheduledTask.cancel(true);
|
||||||
|
enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -34,10 +34,6 @@ public class WeatherStationRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
||||||
|
|
||||||
ParceableFavsCallReason.Reason reason;
|
ParceableFavsCallReason.Reason reason;
|
||||||
|
|
||||||
SummaryDao summaryDao;
|
|
||||||
|
|
||||||
AvailableParametersDao paramsDao;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This updater takes data stored in the hashmap and then updates TextViews on View Holders on
|
* This updater takes data stored in the hashmap and then updates TextViews on View Holders on
|
||||||
* Favourites list
|
* Favourites list
|
||||||
|
@ -61,8 +57,6 @@ public class WeatherStationRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
||||||
this.stations = stations;
|
this.stations = stations;
|
||||||
this.activity = parentActivity;
|
this.activity = parentActivity;
|
||||||
this.reason = callReason;
|
this.reason = callReason;
|
||||||
this.summaryDao = new SummaryDao();
|
|
||||||
this.paramsDao = new AvailableParametersDao();
|
|
||||||
this.main = (Main) parentActivity.getApplication();
|
this.main = (Main) parentActivity.getApplication();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,7 +159,7 @@ public class WeatherStationRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
||||||
}
|
}
|
||||||
|
|
||||||
handler = new Handler(Looper.getMainLooper());
|
handler = new Handler(Looper.getMainLooper());
|
||||||
favsUpdater = new FavouritesStationDetailsOnListUpdater(handler, main.getHashmapStationSystemNameToSummary());
|
favsUpdater = new FavouritesStationDetailsOnListUpdater(handler, main.getHashmapFavStationSystemNameToSummary(), main.getHashmapAllStationSystemNameToAvailParameters());
|
||||||
|
|
||||||
handler.postDelayed(favsUpdater, 100);
|
handler.postDelayed(favsUpdater, 100);
|
||||||
favsUpdater.setEnabled(true);
|
favsUpdater.setEnabled(true);
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package cc.pogoda.mobile.meteosystem.config;
|
||||||
|
|
||||||
|
public class ConstAppConfiguration {
|
||||||
|
|
||||||
|
public static final int REUPDATE_VALUES_ON_ACTIVITY_ON_FAIL = 3000;
|
||||||
|
|
||||||
|
public static final int NORMAL_UPDATE_VALUES_ON_ACTIVITY = 60000;
|
||||||
|
|
||||||
|
public static final int DETAILS_ON_FAVS_LIST_REUPDATE = 500;
|
||||||
|
|
||||||
|
public static final int DETAILS_ON_FAVS_LIST_DEFAULT_UPDATE = 45000;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
package cc.pogoda.mobile.meteosystem.config;
|
||||||
|
|
||||||
|
public class WebIoConfig {
|
||||||
|
|
||||||
|
public static final int TIMEOUT_SECOND = 20;
|
||||||
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
package cc.pogoda.mobile.meteosystem.dao;
|
package cc.pogoda.mobile.meteosystem.dao;
|
||||||
|
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.WebIoConfig.TIMEOUT_SECOND;
|
||||||
|
|
||||||
import org.tinylog.Logger;
|
import org.tinylog.Logger;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
@ -32,7 +34,7 @@ public class AllStationsDao {
|
||||||
try {
|
try {
|
||||||
resp = consumer.getAllStations().execute();
|
resp = consumer.getAllStations().execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error("[AllStationsDao][Worker][Exception][e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[Exception][e = " + e.getLocalizedMessage() +"]");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package cc.pogoda.mobile.meteosystem.dao;
|
package cc.pogoda.mobile.meteosystem.dao;
|
||||||
|
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.WebIoConfig.TIMEOUT_SECOND;
|
||||||
|
|
||||||
import org.tinylog.Logger;
|
import org.tinylog.Logger;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -28,25 +30,25 @@ public class AvailableParametersDao {
|
||||||
try {
|
try {
|
||||||
response = consumer.getParametersForStation(stationName).execute();
|
response = consumer.getParametersForStation(stationName).execute();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Logger.error("[AvailableParametersDao][Worker][IOException][e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[IOException][e = " + e.getLocalizedMessage() +"]");
|
||||||
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
Logger.error("[AvailableParametersDao][Worker][RuntimeException][e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[RuntimeException][e = " + e.getLocalizedMessage() +"]");
|
||||||
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
Logger.error("[AvailableParametersDao][Worker][Exception][e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[Exception][e = " + e.getLocalizedMessage() +"]");
|
||||||
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response == null) {
|
if (response == null) {
|
||||||
Logger.error("[AvailableParametersDao][Worker][worker is done, response is null]");
|
Logger.error("[worker is done, response is null]");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Logger.info("[AvailableParametersDao][Worker][worker is done][response.code() = " + response.code() +"]");
|
Logger.info("[worker is done][response.code() = " + response.code() +"]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package cc.pogoda.mobile.meteosystem.dao;
|
package cc.pogoda.mobile.meteosystem.dao;
|
||||||
|
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.WebIoConfig.TIMEOUT_SECOND;
|
||||||
|
|
||||||
import org.tinylog.Logger;
|
import org.tinylog.Logger;
|
||||||
|
|
||||||
import cc.pogoda.mobile.meteosystem.type.web.ListOfStationData;
|
import cc.pogoda.mobile.meteosystem.type.web.ListOfStationData;
|
||||||
|
@ -25,7 +27,7 @@ public class LastStationDataDao {
|
||||||
try {
|
try {
|
||||||
response = consumer.getLastDataForStation(station, true, true).execute();
|
response = consumer.getLastDataForStation(station, true, true).execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error("[LastStationDataDao][Worker][Exception][e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[Exception][e = " + e.getLocalizedMessage() +"]");
|
||||||
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class StationDataDao {
|
||||||
try {
|
try {
|
||||||
response = consumer.getDataForStation(station, from, to).execute();
|
response = consumer.getDataForStation(station, from, to).execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error("[StationDataDao][Worker][Exception][e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[Exception][e = " + e.getLocalizedMessage() +"]");
|
||||||
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,9 @@ public class StationDataDao {
|
||||||
thread.start();
|
thread.start();
|
||||||
thread.join();
|
thread.join();
|
||||||
|
|
||||||
out = response.body();
|
if (response != null) {
|
||||||
|
out = response.body();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (InterruptedException ex) {
|
catch (InterruptedException ex) {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package cc.pogoda.mobile.meteosystem.dao;
|
package cc.pogoda.mobile.meteosystem.dao;
|
||||||
|
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.WebIoConfig.TIMEOUT_SECOND;
|
||||||
|
|
||||||
import org.tinylog.Logger;
|
import org.tinylog.Logger;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -32,29 +34,29 @@ public class SummaryDao {
|
||||||
SummaryConsumer consumer = restClient.getWeatherStationClient().create(SummaryConsumer.class);
|
SummaryConsumer consumer = restClient.getWeatherStationClient().create(SummaryConsumer.class);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Logger.info("[SummaryDao][Worker][station = " + station +"]");
|
Logger.info("[station = " + station +"]");
|
||||||
|
|
||||||
response = consumer.getSummaryForStation(station).execute();
|
response = consumer.getSummaryForStation(station).execute();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Logger.error("[SummaryDao][Worker][IOException][e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[station = " + station + "][IOException][e = " + e.getLocalizedMessage() +"]");
|
||||||
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
Logger.error("[SummaryDao][Worker][RuntimeException][e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[station = " + station + "][RuntimeException][e = " + e.getLocalizedMessage() +"]");
|
||||||
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
Logger.error("[SummaryDao][Worker][Exception][e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[station = " + station + "][Exception][e = " + e.getLocalizedMessage() +"]");
|
||||||
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response == null) {
|
if (response == null) {
|
||||||
Logger.error("[SummaryDao][Worker][worker is done, response is null]");
|
Logger.error("[station = " + station + "][worker is done, response is null]");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Logger.info("[SummaryDao][Worker][worker is done][response.code() = " + response.code() +"]");
|
Logger.info("[station = " + station + "][worker is done][response.code() = " + response.code() +"]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +73,7 @@ public class SummaryDao {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// wait for the web service response
|
// wait for the web service response
|
||||||
worker.join(11000);
|
worker.join();
|
||||||
|
|
||||||
// check if web service returned anything
|
// check if web service returned anything
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
|
@ -86,16 +88,16 @@ public class SummaryDao {
|
||||||
out.qnh_qf_native = QualityFactor.valueOf(out.qnh_qf);
|
out.qnh_qf_native = QualityFactor.valueOf(out.qnh_qf);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Logger.error("[SummaryDao][getStationSummary][station = " + station +"][response.code() = " + response.code() +"][response body is nulll, probably HTTP error" +
|
Logger.error("[station = " + station +"][response.code() = " + response.code() +"][response body is nulll, probably HTTP error" +
|
||||||
"]");
|
"]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Logger.error("[SummaryDao][getStationSummary][station = " + station +"][response is null!!]");
|
Logger.error("[station = " + station +"][response is null!!]");
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Logger.error("[SummaryDao][getStationSummary][station = " + station +"][InterruptedException]");
|
Logger.error("[station = " + station +"][InterruptedException]");
|
||||||
}
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package cc.pogoda.mobile.meteosystem.dao;
|
package cc.pogoda.mobile.meteosystem.dao;
|
||||||
|
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.WebIoConfig.TIMEOUT_SECOND;
|
||||||
|
|
||||||
import org.tinylog.Logger;
|
import org.tinylog.Logger;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -48,7 +50,9 @@ public class TrendDao {
|
||||||
try {
|
try {
|
||||||
thread.join();
|
thread.join();
|
||||||
|
|
||||||
out = trend.body();
|
if (trend != null) {
|
||||||
|
out = trend.body();
|
||||||
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class ConfigurationFile {
|
||||||
} catch (IOException | JSONException e) {
|
} catch (IOException | JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
||||||
Logger.error("[ConfigurationFile][restoreFromFile][e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[e = " + e.getLocalizedMessage() +"]");
|
||||||
|
|
||||||
AppConfiguration.locale = "default";
|
AppConfiguration.locale = "default";
|
||||||
AppConfiguration.replaceMsWithKnots = false;
|
AppConfiguration.replaceMsWithKnots = false;
|
||||||
|
|
|
@ -39,10 +39,10 @@ public class CopyLog {
|
||||||
streamWriter.flush();
|
streamWriter.flush();
|
||||||
streamWriter.close();
|
streamWriter.close();
|
||||||
|
|
||||||
Logger.info("[CopyLog][CopyLogRunner][run][log file copied succesfully]");
|
Logger.info("[log file copied succesfully]");
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
Logger.error("[CopyLog][CopyLogRunner][run][IOException e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[IOException e = " + e.getLocalizedMessage() +"]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ public class CopyLog {
|
||||||
|
|
||||||
File logfile = new File(baseDir.getAbsolutePath() + "/logs/log_" + _date.format(formatter) + ".txt");
|
File logfile = new File(baseDir.getAbsolutePath() + "/logs/log_" + _date.format(formatter) + ".txt");
|
||||||
|
|
||||||
Logger.debug("[CopyLog][forDay][logfile.getAbsolutePath() = " + logfile.getAbsolutePath() +"][logfile.length() = " + logfile.length() +"]");
|
Logger.debug("[logfile.getAbsolutePath() = " + logfile.getAbsolutePath() +"][logfile.length() = " + logfile.length() +"]");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// create an input stream to load log file
|
// create an input stream to load log file
|
||||||
|
@ -74,7 +74,7 @@ public class CopyLog {
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
Logger.error("[CopyLog][forDay][IOException e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[IOException e = " + e.getLocalizedMessage() +"]");
|
||||||
}
|
}
|
||||||
|
|
||||||
// log_{date:yyyy-MM-dd}.txt
|
// log_{date:yyyy-MM-dd}.txt
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class FavouritiesFile {
|
||||||
|
|
||||||
File file = fileNames.getFavJsonFile();
|
File file = fileNames.getFavJsonFile();
|
||||||
|
|
||||||
Logger.info("[FavouritiesFile][loadFavourites][file = " + file + "]");
|
Logger.info("[file = " + file + "]");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// create an input stream to load file content
|
// create an input stream to load file content
|
||||||
|
@ -60,7 +60,7 @@ public class FavouritiesFile {
|
||||||
|
|
||||||
out.add(station);
|
out.add(station);
|
||||||
|
|
||||||
Logger.debug("[FavouritiesFile][loadFavourites][i = " + i +"][station.getSystemName() = " + station.getSystemName() + "]");
|
Logger.debug("[i = " + i +"][station.getSystemName() = " + station.getSystemName() + "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -86,7 +86,7 @@ public class FavouritiesFile {
|
||||||
// main array for all stations
|
// main array for all stations
|
||||||
JSONArray mainArray = new JSONArray();
|
JSONArray mainArray = new JSONArray();
|
||||||
|
|
||||||
Logger.info("[FavouritiesFile][persistFavourities][favourites.size() = " + favourites.size() + "]");
|
Logger.info("[favourites.size() = " + favourites.size() + "]");
|
||||||
|
|
||||||
for (WeatherStation wx : favourites) {
|
for (WeatherStation wx : favourites) {
|
||||||
JSONObject obj = new JSONObject();
|
JSONObject obj = new JSONObject();
|
||||||
|
@ -103,7 +103,7 @@ public class FavouritiesFile {
|
||||||
|
|
||||||
mainArray.put(obj);
|
mainArray.put(obj);
|
||||||
|
|
||||||
Logger.debug("[FavouritiesFile][persistFavourities][wx.getSystemName() = " + wx.getSystemName() + "]");
|
Logger.debug("[wx.getSystemName() = " + wx.getSystemName() + "]");
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,13 @@ import androidx.core.app.JobIntentService;
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.tinylog.Logger;
|
import org.tinylog.Logger;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cc.pogoda.mobile.meteosystem.dao.AllStationsDao;
|
import cc.pogoda.mobile.meteosystem.dao.AllStationsDao;
|
||||||
|
import cc.pogoda.mobile.meteosystem.dao.AvailableParametersDao;
|
||||||
import cc.pogoda.mobile.meteosystem.type.AllStationsReceivedEvent;
|
import cc.pogoda.mobile.meteosystem.type.AllStationsReceivedEvent;
|
||||||
|
import cc.pogoda.mobile.meteosystem.type.AvailableParameters;
|
||||||
import cc.pogoda.mobile.meteosystem.type.StartStationsRefreshEvent;
|
import cc.pogoda.mobile.meteosystem.type.StartStationsRefreshEvent;
|
||||||
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
|
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
|
||||||
|
|
||||||
|
@ -26,8 +29,11 @@ public class GetAllStationsService extends JobIntentService {
|
||||||
@Override
|
@Override
|
||||||
protected void onHandleWork(@NonNull Intent intent) {
|
protected void onHandleWork(@NonNull Intent intent) {
|
||||||
EventBus.getDefault().post(new StartStationsRefreshEvent());
|
EventBus.getDefault().post(new StartStationsRefreshEvent());
|
||||||
|
|
||||||
|
// download all stations
|
||||||
List<WeatherStation> allStations = new AllStationsDao().getAllStations();
|
List<WeatherStation> allStations = new AllStationsDao().getAllStations();
|
||||||
if (allStations != null){
|
if (allStations != null){
|
||||||
|
|
||||||
EventBus.getDefault().post(new AllStationsReceivedEvent(allStations));
|
EventBus.getDefault().post(new AllStationsReceivedEvent(allStations));
|
||||||
Logger.debug("onHandleWork done. allStations size:" + allStations.size());
|
Logger.debug("onHandleWork done. allStations size:" + allStations.size());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package cc.pogoda.mobile.meteosystem.type;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class AllStationsReceivedEvent {
|
public class AllStationsReceivedEvent {
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class StationSummaryActElements implements StationActivityElements {
|
||||||
|
|
||||||
long minutes_difference = last_station_data.until(current, ChronoUnit.MINUTES);
|
long minutes_difference = last_station_data.until(current, ChronoUnit.MINUTES);
|
||||||
|
|
||||||
Logger.debug("[StationSummaryActElements][updateFromSummary][last_station_data = " + last_station_data.format(DateTimeFormatter. ISO_LOCAL_DATE_TIME) +"]");
|
Logger.debug("[last_station_data = " + last_station_data.format(DateTimeFormatter. ISO_LOCAL_DATE_TIME) +"]");
|
||||||
|
|
||||||
// calculate the duration between
|
// calculate the duration between
|
||||||
Duration duration = Duration.between(last_station_data, current);
|
Duration duration = Duration.between(last_station_data, current);
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class StationWindRoseActElements implements StationActivityElements {
|
||||||
// current date and time (in current time zone set in system configuration)
|
// current date and time (in current time zone set in system configuration)
|
||||||
LocalDateTime current = LocalDateTime.now();
|
LocalDateTime current = LocalDateTime.now();
|
||||||
|
|
||||||
Logger.debug("[StationWindRoseActElements][updateFromSummary][last_station_data = " + last_station_data.format(DateTimeFormatter. ISO_LOCAL_DATE_TIME) +"]");
|
Logger.debug("[last_station_data = " + last_station_data.format(DateTimeFormatter. ISO_LOCAL_DATE_TIME) +"]");
|
||||||
|
|
||||||
// calculate the duration between
|
// calculate the duration between
|
||||||
Duration duration = Duration.between(last_station_data, current);
|
Duration duration = Duration.between(last_station_data, current);
|
||||||
|
@ -98,7 +98,7 @@ public class StationWindRoseActElements implements StationActivityElements {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.debug("[StationWindRoseActElements][updateFromSummary][no_data = " + no_data +"][old_data = " + old_data+"]");
|
Logger.debug("[no_data = " + no_data +"][old_data = " + old_data+"]");
|
||||||
|
|
||||||
// create strings with wind speed, gusts etc
|
// create strings with wind speed, gusts etc
|
||||||
String average_speed = String.format("%s", data.getWindspeedStr(true));
|
String average_speed = String.format("%s", data.getWindspeedStr(true));
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package cc.pogoda.mobile.meteosystem.web;
|
package cc.pogoda.mobile.meteosystem.web;
|
||||||
|
|
||||||
|
import static cc.pogoda.mobile.meteosystem.config.WebIoConfig.TIMEOUT_SECOND;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
|
||||||
|
@ -21,10 +23,10 @@ public class RestClientConfig {
|
||||||
|
|
||||||
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||||
|
|
||||||
builder.readTimeout(20, TimeUnit.SECONDS);
|
builder.readTimeout(TIMEOUT_SECOND, TimeUnit.SECONDS);
|
||||||
builder.writeTimeout(20, TimeUnit.SECONDS);
|
builder.writeTimeout(TIMEOUT_SECOND, TimeUnit.SECONDS);
|
||||||
builder.connectTimeout(20, TimeUnit.SECONDS);
|
builder.connectTimeout(TIMEOUT_SECOND, TimeUnit.SECONDS);
|
||||||
builder.callTimeout(20, TimeUnit.SECONDS);
|
builder.callTimeout(TIMEOUT_SECOND, TimeUnit.SECONDS);
|
||||||
|
|
||||||
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
|
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
|
||||||
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS);
|
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS);
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class StationBackgroundDownloader implements Runnable {
|
||||||
try {
|
try {
|
||||||
URL url = new java.net.URL(station.getImageUrl());
|
URL url = new java.net.URL(station.getImageUrl());
|
||||||
|
|
||||||
Logger.debug("[StationBackgroundDownloader][run][url = " + url.toString() +"]");
|
Logger.debug("[url = " + url.toString() +"]");
|
||||||
|
|
||||||
in = url.openStream();
|
in = url.openStream();
|
||||||
bitmap = BitmapFactory.decodeStream(in);
|
bitmap = BitmapFactory.decodeStream(in);
|
||||||
|
@ -41,7 +41,7 @@ public class StationBackgroundDownloader implements Runnable {
|
||||||
in.close();
|
in.close();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Logger.error("[StationBackgroundDownloader][run][IOException][e = " + e.getLocalizedMessage() +"]");
|
Logger.error("[IOException][e = " + e.getLocalizedMessage() +"]");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
bitmap = null;
|
bitmap = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
|
android:text="@string/loading"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/station_button_fav"
|
app:layout_constraintBottom_toBottomOf="@+id/station_button_fav"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/station_button_fav"
|
app:layout_constraintEnd_toStartOf="@+id/station_button_fav"
|
||||||
|
|
|
@ -300,7 +300,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:fontFamily="@font/alegreya_sans_sc_medium"
|
android:fontFamily="@font/alegreya_sans_sc_medium"
|
||||||
android:text="Rafał Woloszyn"
|
android:text="@string/credits_2_rafal"
|
||||||
android:textSize="28sp"
|
android:textSize="28sp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/textViewCredits3"
|
app:layout_constraintBottom_toTopOf="@+id/textViewCredits3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
android:id="@+id/textViewTemperatureValue"
|
android:id="@+id/textViewTemperatureValue"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="TextView"
|
android:text="@string/please_wait"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="50sp"
|
android:textSize="50sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:text="TextView"
|
android:text="---"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="50sp"
|
android:textSize="50sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:text="TextView"
|
android:text="---"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="50sp"
|
android:textSize="50sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
@ -118,7 +118,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:text="TextView"
|
android:text="---"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="50sp"
|
android:textSize="50sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
@ -145,7 +145,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:text="TextView"
|
android:text="---"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="50sp"
|
android:textSize="50sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
@ -172,7 +172,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:text="TextView"
|
android:text="---"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="50sp"
|
android:textSize="50sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
|
|
||||||
<string name="select_station">VYBRAT</string>
|
<string name="select_station">VYBRAT</string>
|
||||||
|
|
||||||
|
@ -187,5 +186,10 @@
|
||||||
<string name="export_decimation">Decimace eskportovaných údajov</string>
|
<string name="export_decimation">Decimace eskportovaných údajov</string>
|
||||||
<string name="export_decimation_minutes">Minimální krok v minutách</string>
|
<string name="export_decimation_minutes">Minimální krok v minutách</string>
|
||||||
<string name="www_link">URL pro více informací</string>
|
<string name="www_link">URL pro více informací</string>
|
||||||
|
<string name="please_wait">Please Wait</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Načítání...</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
|
|
||||||
<string name="select_station">VYBRAT</string>
|
<string name="select_station">VYBRAT</string>
|
||||||
|
|
||||||
|
@ -187,5 +186,10 @@
|
||||||
<string name="export_decimation">Decimace eskportovaných údajov</string>
|
<string name="export_decimation">Decimace eskportovaných údajov</string>
|
||||||
<string name="export_decimation_minutes">Minimální krok v minutách</string>
|
<string name="export_decimation_minutes">Minimální krok v minutách</string>
|
||||||
<string name="www_link">URL pro více informací</string>
|
<string name="www_link">URL pro více informací</string>
|
||||||
|
<string name="please_wait">Please Wait</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Načítání...</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
<string name="select_station">Auswählen</string>
|
||||||
<string name="select_station">Auswählen</string>
|
|
||||||
<string name="all_stations">Alle Stationen</string>
|
<string name="all_stations">Alle Stationen</string>
|
||||||
<string name="fav_stations">Favoriten </string>
|
<string name="fav_stations">Favoriten </string>
|
||||||
<string name="station_summary">Akutelle Werte</string>
|
<string name="station_summary">Akutelle Werte</string>
|
||||||
|
@ -116,6 +115,11 @@
|
||||||
<string name="export_decimation">Dezimierung exportierten Dateien </string>
|
<string name="export_decimation">Dezimierung exportierten Dateien </string>
|
||||||
<string name="export_decimation_minutes">Minimaler Schritt in Minuten </string>
|
<string name="export_decimation_minutes">Minimaler Schritt in Minuten </string>
|
||||||
<string name="www_link">URL to more information</string>
|
<string name="www_link">URL to more information</string>
|
||||||
|
<string name="please_wait">Warten Sie bitte</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Wird geladen...</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
<string name="select_station">Auswählen</string>
|
||||||
<string name="select_station">Auswählen</string>
|
|
||||||
<string name="all_stations">Alle Stationen</string>
|
<string name="all_stations">Alle Stationen</string>
|
||||||
<string name="fav_stations">Favoriten </string>
|
<string name="fav_stations">Favoriten </string>
|
||||||
<string name="station_summary">Akutelle Werte</string>
|
<string name="station_summary">Akutelle Werte</string>
|
||||||
|
@ -116,6 +115,11 @@
|
||||||
<string name="export_decimation">Dezimierung exportierten Dateien </string>
|
<string name="export_decimation">Dezimierung exportierten Dateien </string>
|
||||||
<string name="export_decimation_minutes">Minimaler Schritt in Minuten </string>
|
<string name="export_decimation_minutes">Minimaler Schritt in Minuten </string>
|
||||||
<string name="www_link">URL to more information</string>
|
<string name="www_link">URL to more information</string>
|
||||||
|
<string name="please_wait">Warten Sie bitte</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Wird geladen...</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
<string name="select_station">Auswählen</string>
|
||||||
<string name="select_station">Auswählen</string>
|
|
||||||
<string name="all_stations">Alle Stationen</string>
|
<string name="all_stations">Alle Stationen</string>
|
||||||
<string name="fav_stations">Favoriten </string>
|
<string name="fav_stations">Favoriten </string>
|
||||||
<string name="station_summary">Akutelle Werte</string>
|
<string name="station_summary">Akutelle Werte</string>
|
||||||
|
@ -116,6 +115,11 @@
|
||||||
<string name="export_decimation">Dezimierung exportierten Dateien </string>
|
<string name="export_decimation">Dezimierung exportierten Dateien </string>
|
||||||
<string name="export_decimation_minutes">Minimaler Schritt in Minuten </string>
|
<string name="export_decimation_minutes">Minimaler Schritt in Minuten </string>
|
||||||
<string name="www_link">URL to more information</string>
|
<string name="www_link">URL to more information</string>
|
||||||
|
<string name="please_wait">Warten Sie bitte</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Wird geladen...</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
<string name="select_station">SELECT</string>
|
<string name="select_station">SELECT</string>
|
||||||
<string name="all_stations">All Stations</string>
|
<string name="all_stations">All Stations</string>
|
||||||
<string name="fav_stations">Favourities</string>
|
<string name="fav_stations">Favourities</string>
|
||||||
|
@ -115,5 +114,9 @@
|
||||||
<string name="export_decimation_minutes">Minimum time resolution</string>
|
<string name="export_decimation_minutes">Minimum time resolution</string>
|
||||||
<string name="www_link">URL to more information</string>
|
<string name="www_link">URL to more information</string>
|
||||||
<string name="refreshing_station_list">Refreshing station list</string>
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="please_wait">Please Wait</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Loading...</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
<string name="select_station">ATLASĪT</string>
|
<string name="select_station">ATLASĪT</string>
|
||||||
<string name="all_stations">Visas stacijas</string>
|
<string name="all_stations">Visas stacijas</string>
|
||||||
<string name="fav_stations">Izlase</string>
|
<string name="fav_stations">Izlase</string>
|
||||||
|
@ -114,4 +113,9 @@
|
||||||
<string name="export_decimation">Export data decimation</string>
|
<string name="export_decimation">Export data decimation</string>
|
||||||
<string name="export_decimation_minutes">Minimum time resolution</string>
|
<string name="export_decimation_minutes">Minimum time resolution</string>
|
||||||
<string name="www_link">URL to more information</string>
|
<string name="www_link">URL to more information</string>
|
||||||
|
<string name="please_wait">Please Wait</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Loading...</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
<string name="select_station">ATLASĪT</string>
|
<string name="select_station">ATLASĪT</string>
|
||||||
<string name="all_stations">Visas stacijas</string>
|
<string name="all_stations">Visas stacijas</string>
|
||||||
<string name="fav_stations">Izlase</string>
|
<string name="fav_stations">Izlase</string>
|
||||||
|
@ -114,4 +113,9 @@
|
||||||
<string name="export_decimation">Export data decimation</string>
|
<string name="export_decimation">Export data decimation</string>
|
||||||
<string name="export_decimation_minutes">Minimum time resolution</string>
|
<string name="export_decimation_minutes">Minimum time resolution</string>
|
||||||
<string name="www_link">URL to more information</string>
|
<string name="www_link">URL to more information</string>
|
||||||
|
<string name="please_wait">Please Wait</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Loading...</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
<string name="select_station">WYBIERZ</string>
|
<string name="select_station">WYBIERZ</string>
|
||||||
<string name="all_stations">Wszystkie Stacje</string>
|
<string name="all_stations">Wszystkie Stacje</string>
|
||||||
<string name="fav_stations">Ulubione</string>
|
<string name="fav_stations">Ulubione</string>
|
||||||
|
@ -117,4 +116,6 @@
|
||||||
<string name="refreshing_station_list">Odświeżanie listy stacji</string>
|
<string name="refreshing_station_list">Odświeżanie listy stacji</string>
|
||||||
<string name="all_stations_empty_list1">Brak stacji na liście.</string>
|
<string name="all_stations_empty_list1">Brak stacji na liście.</string>
|
||||||
<string name="all_station_empty_list2">Proszę poczekać lub pociągnąć w dół aby odświeżyć.</string>
|
<string name="all_station_empty_list2">Proszę poczekać lub pociągnąć w dół aby odświeżyć.</string>
|
||||||
|
<string name="please_wait">Proszę czekać</string>
|
||||||
|
<string name="loading">Ładowanie...</string>
|
||||||
</resources>
|
</resources>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
<string name="select_station">WYBIERZ</string>
|
<string name="select_station">WYBIERZ</string>
|
||||||
<string name="all_stations">Wszystkie Stacje</string>
|
<string name="all_stations">Wszystkie Stacje</string>
|
||||||
<string name="fav_stations">Ulubione</string>
|
<string name="fav_stations">Ulubione</string>
|
||||||
|
@ -114,4 +113,9 @@
|
||||||
<string name="export_decimation">Decymacja eskportowanych danych</string>
|
<string name="export_decimation">Decymacja eskportowanych danych</string>
|
||||||
<string name="export_decimation_minutes">Minimalny krok w minutach</string>
|
<string name="export_decimation_minutes">Minimalny krok w minutach</string>
|
||||||
<string name="www_link">Więcej informacji</string>
|
<string name="www_link">Więcej informacji</string>
|
||||||
|
<string name="please_wait">Proszę czekać</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Ładowanie...</string>
|
||||||
</resources>
|
</resources>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
<string name="select_station">Выбрать</string>
|
<string name="select_station">Выбрать</string>
|
||||||
<string name="all_stations">Все станции</string>
|
<string name="all_stations">Все станции</string>
|
||||||
<string name="fav_stations">Избранные</string>
|
<string name="fav_stations">Избранные</string>
|
||||||
|
@ -114,4 +113,9 @@
|
||||||
<string name="export_decimation">Децимация экспортируемых данных</string>
|
<string name="export_decimation">Децимация экспортируемых данных</string>
|
||||||
<string name="export_decimation_minutes">Минимальный шаг в минутах</string>
|
<string name="export_decimation_minutes">Минимальный шаг в минутах</string>
|
||||||
<string name="www_link">URL to more information</string>
|
<string name="www_link">URL to more information</string>
|
||||||
|
<string name="please_wait">Proszę czekać</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Loading...</string>
|
||||||
</resources>
|
</resources>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
<string name="select_station">Выбрать</string>
|
<string name="select_station">Выбрать</string>
|
||||||
<string name="all_stations">Все станции</string>
|
<string name="all_stations">Все станции</string>
|
||||||
<string name="fav_stations">Избранные</string>
|
<string name="fav_stations">Избранные</string>
|
||||||
|
@ -114,4 +113,9 @@
|
||||||
<string name="export_decimation">Децимация экспортируемых данных</string>
|
<string name="export_decimation">Децимация экспортируемых данных</string>
|
||||||
<string name="export_decimation_minutes">Минимальный шаг в минутах</string>
|
<string name="export_decimation_minutes">Минимальный шаг в минутах</string>
|
||||||
<string name="www_link">URL to more information</string>
|
<string name="www_link">URL to more information</string>
|
||||||
|
<string name="please_wait">Proszę czekać</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Loading...</string>
|
||||||
</resources>
|
</resources>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
<string name="select_station">Выбрать</string>
|
<string name="select_station">Выбрать</string>
|
||||||
<string name="all_stations">Все станции</string>
|
<string name="all_stations">Все станции</string>
|
||||||
<string name="fav_stations">Избранные</string>
|
<string name="fav_stations">Избранные</string>
|
||||||
|
@ -114,4 +113,9 @@
|
||||||
<string name="export_decimation">Децимация экспортируемых данных</string>
|
<string name="export_decimation">Децимация экспортируемых данных</string>
|
||||||
<string name="export_decimation_minutes">Минимальный шаг в минутах</string>
|
<string name="export_decimation_minutes">Минимальный шаг в минутах</string>
|
||||||
<string name="www_link">URL to more information</string>
|
<string name="www_link">URL to more information</string>
|
||||||
|
<string name="please_wait">Proszę czekać</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Loading...</string>
|
||||||
</resources>
|
</resources>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
<string name="select_station">Вибрати</string>
|
<string name="select_station">Вибрати</string>
|
||||||
<string name="all_stations">Усі станції</string>
|
<string name="all_stations">Усі станції</string>
|
||||||
<string name="fav_stations">Улюблені</string>
|
<string name="fav_stations">Улюблені</string>
|
||||||
|
@ -114,4 +113,8 @@
|
||||||
<string name="export_decimation">Децимація експортованих даних</string>
|
<string name="export_decimation">Децимація експортованих даних</string>
|
||||||
<string name="export_decimation_minutes">Мінімальний крок у хвилинах</string>
|
<string name="export_decimation_minutes">Мінімальний крок у хвилинах</string>
|
||||||
<string name="www_link">URL to more information</string>
|
<string name="www_link">URL to more information</string>
|
||||||
|
<string name="please_wait">Proszę czekać</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="loading">Loading...</string>
|
||||||
</resources>
|
</resources>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
|
||||||
<string name="select_station">Вибрати</string>
|
<string name="select_station">Вибрати</string>
|
||||||
<string name="all_stations">Усі станції</string>
|
<string name="all_stations">Усі станції</string>
|
||||||
<string name="fav_stations">Улюблені</string>
|
<string name="fav_stations">Улюблені</string>
|
||||||
|
@ -114,4 +113,9 @@
|
||||||
<string name="export_decimation">Децимація експортованих даних</string>
|
<string name="export_decimation">Децимація експортованих даних</string>
|
||||||
<string name="export_decimation_minutes">Мінімальний крок у хвилинах</string>
|
<string name="export_decimation_minutes">Мінімальний крок у хвилинах</string>
|
||||||
<string name="www_link">URL to more information</string>
|
<string name="www_link">URL to more information</string>
|
||||||
|
<string name="please_wait">Proszę czekać</string>
|
||||||
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="loading">Loading...</string>
|
||||||
</resources>
|
</resources>
|
|
@ -1,5 +1,5 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MeteoSystem</string>
|
<string name="app_name" translatable="false">Meteo System</string>
|
||||||
<string name="select_station">SELECT</string>
|
<string name="select_station">SELECT</string>
|
||||||
<string name="all_stations">All Stations</string>
|
<string name="all_stations">All Stations</string>
|
||||||
<string name="fav_stations">Favourities</string>
|
<string name="fav_stations">Favourities</string>
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
<string name="test_warning">Warning! This is a test version of the application!</string>
|
<string name="test_warning">Warning! This is a test version of the application!</string>
|
||||||
<string name="credits_1">Developed by:</string>
|
<string name="credits_1">Developed by:</string>
|
||||||
<string name="credits_2" translatable="false">Mateusz Lubecki</string>
|
<string name="credits_2" translatable="false">Mateusz Lubecki</string>
|
||||||
<string name="credits_3" translatable="false">Bielsko - Biała 2020, 2021</string>
|
<string name="credits_3" translatable="false">Bielsko - Biała 2020, 2021, 2022</string>
|
||||||
<string name="credits_4" translatable="false">sp8ebc@gmail.com</string>
|
<string name="credits_4" translatable="false">sp8ebc@gmail.com</string>
|
||||||
<string name="credits_5" translatable="false">tel: +48 660 43 44 46</string>
|
<string name="credits_5" translatable="false">tel: +48 660 43 44 46</string>
|
||||||
<string name="camera">Online Camera</string>
|
<string name="camera">Online Camera</string>
|
||||||
|
@ -147,4 +147,7 @@
|
||||||
<string name="refreshing_station_list">Refreshing station list</string>
|
<string name="refreshing_station_list">Refreshing station list</string>
|
||||||
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
<string name="all_stations_empty_list1">There are no stations on this list.</string>
|
||||||
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
<string name="all_station_empty_list2">Please wait or pull down to refresh list.</string>
|
||||||
|
<string name="please_wait">Please Wait</string>
|
||||||
|
<string name="loading">Loading...</string>
|
||||||
|
<string name="credits_2_rafal" translatable="false">Rafał Woloszyn</string>
|
||||||
</resources>
|
</resources>
|
Ładowanie…
Reference in New Issue