diff options
-rw-r--r-- | TODO.md | 15 | ||||
-rw-r--r-- | app/build.gradle | 4 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java | 11 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java | 17 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java | 15 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 11 |
6 files changed, 45 insertions, 28 deletions
@@ -4,23 +4,20 @@ This list is not accurate. Instead, checkout the TODO list on the `dev` branch [ # TODO These are issues in Wiimmfi Watcher I am at least aware of. Please **DO NOT** submit a bug report on the Google Form or an issue here on GitHub if it is mentioned on this list, unless you found a way that the bug can crash the app. -## Completed For Next Release -* Lowered minimum SDK to 19 (Jelly Bean 4.4) - * originally lowered to 16 (Jelly Bean 4.1), but after adding Fragment animations this had to be changed. -* Created the dark mode -* Recent friend codes now scroll like they should -* The last player in the list no longer hides behind the refresh button, if the list is long enough +## Completed For Release 1.1.1 +* Made the user agent consistant across both Jsoup calls +* Added a new error if Jsoup throws an exception ## Working On -* Fixing lag when pressing the watch button - * Working with threads should fix this +* Providing translations for major languages (German, France, Spanish at the moment) ## Aware Of -* Fix the repeating recent friend codes * The about page causes part of the screen to get cut off as the animation plays * The navigation menu in Dark Mode is messed up * The selected player detail text and icon is black * The highlight color is barely visible +* Pressing the watch or refresh buttons cause the app to hang until refreshing is completed. + * Working with threads should fix this # Features I would like to add * The watcher activity does not refresh automatically like the official website does diff --git a/app/build.gradle b/app/build.gradle index 6d97081..5e43102 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "me.brysonsteck.wiimmfiwatcher" minSdkVersion 19 targetSdkVersion 30 - versionCode 2 - versionName "1.1" + versionCode 3 + versionName "1.1.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java index a0229ff..4624864 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java @@ -59,14 +59,9 @@ public class AboutFragment extends Fragment { TextView bugs = view.findViewById(R.id.bugs_text); TextView license = view.findViewById(R.id.license_text); - aboutWatcher.setText("Wiimmfi Watcher is an UNOFFICIAL application created for a school project that I have decided to turn into a full application. " + - "This application was made to provide an easy shortcut to the Wiimmfi website and display data in a mobile friendly way, since the official website doesn't have a mobile friendly version. " + - "Free and open source, you can watch your Wiimmfi matches on your phone in a quick and easy way. " + - ""); - - aboutMe.setText("Hi there! My name is Bryson Steck. I am a student studying Computer Science. This is my first official application that I'm maintaining. " + - "This whole \"application on the Google Play Store\" thing is new to me, so please be patient as I am learning how to maintain something like this. " + - "I hope you enjoy!"); + aboutWatcher.setText(R.string.about_watcher); + + aboutMe.setText(R.string.about_me); github.setClickable(true); github.setMovementMethod(LinkMovementMethod.getInstance()); diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java index 64afedc..60ad7df 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java @@ -8,24 +8,29 @@ import org.jsoup.select.Elements; import java.io.IOException; import java.util.ArrayList; +import me.brysonsteck.wiimmfiwatcher.BuildConfig; + public class RoomData { String roomHeader; String playerLink; String friendCode; + Exception error; ArrayList<Player> players = new ArrayList<>(); + String userAgent = "Wiimmfi Watcher for Android (https://github.com/brysonsteck/wiimmfi-watcher) Version " + BuildConfig.VERSION_NAME; public RoomData (ArrayList<Player> players, String friendCode) { this.friendCode = friendCode; - getPlayerLink(); + error = getPlayerLink(); Document doc = null; if (this.playerLink == null) { - System.out.println("The player link is null for some reason"); + System.out.println("The player link is null for some reason:"); + System.out.println(error); } else { try { doc = Jsoup.connect("https://wiimmfi.de/" + this.playerLink) - .userAgent("Wiimmfi Watcher for Android (https://github.com/brysonsteck/wiimmfi-watcher) (UNDER DEVELOPMENT)") + .userAgent(userAgent) .get(); } catch (IOException e) { e.printStackTrace(); @@ -89,10 +94,10 @@ public class RoomData { } } - public void getPlayerLink() { + public Exception getPlayerLink() { try { Document doc = Jsoup.connect("https://wiimmfi.de/stats/mkw") - .userAgent("Wiimmfi Watcher for Android (https://github.com/brysonsteck/wiimmfi-watcher)") + .userAgent(userAgent) .get(); Element table = doc.select("table").get(0); Elements rows = table.select("tr"); @@ -113,10 +118,12 @@ public class RoomData { } } } + return null; } catch (Exception e) { e.printStackTrace(); + return e; } } public ArrayList<Player> getPlayers() { return players; } diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java index 2c17476..ec2531a 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java @@ -14,7 +14,9 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.floatingactionbutton.FloatingActionButton; +import java.net.UnknownHostException; import java.util.ArrayList; +import java.util.Arrays; import me.brysonsteck.wiimmfiwatcher.R; @@ -44,6 +46,13 @@ public class RoomFragment extends Fragment { if (header == null) { header = "This player is not online, not inside a room or does not exist. Click the refresh button to try again, or click on the back button to enter a different friend code."; } + if (roomData.error != null) { + header = "Whoops! Wiimmfi Watcher was unable to connect to the Wiimmfi servers. This could be that you are not connected to the internet, but it could be something else. Here was the error:\n\n" + + roomData.error.getMessage() + "\n\n" + + "If the error is along the lines of \"Unable to resolve host\" or \"Timeout\", you are probably having internet issues. Make sure you are connected to the internet then click the refresh button or press back to watch a new friend code.\n\n" + + "If the error is something other than that or if the error persists, make sure that Wiimmfi's website is currently running. Otherwise, please screenshot this screen and submit a bug report by clicking the About icon on the main page."; + + } headerTextView.setText(header); RecyclerView recyclerView = view.findViewById(R.id.player_data_recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); @@ -59,6 +68,12 @@ public class RoomFragment extends Fragment { if (header == null) { header = "This player is not online, not inside a room or does not exist. Click the refresh button to try again, or click on the back button to enter a different friend code."; } + if (newRoomData.error instanceof java.net.SocketTimeoutException || newRoomData.error instanceof java.net.UnknownHostException) { + header = "Whoops! Wiimmfi Watcher was unable to connect to the Wiimmfi servers. This could be that you are not connected to the internet, but it could be something else. Here was the error:\n\n" + + roomData.error.getMessage() + "\n\n" + + "If the error is along the lines of \"Unable to resolve host\" or \"Timeout\", you are probably having internet issues. Make sure you are connected to the internet then click the refresh button or press back to watch a new friend code.\n\n" + + "If the error is something other than that or if the error persists, make sure that Wiimmfi's website is currently running. Otherwise, please screenshot this screen and submit a bug report by clicking the About icon on the main page."; + } recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); recyclerView.setAdapter(new RoomAdapter(display, playerLink, header, players, getContext())); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bb66ede..ec1de5a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,8 +1,11 @@ <resources> <string name="app_name">Wiimmfi</string> - <string name="github">All of the code in this project is open source on my GitHub repository <a href='https://github.com/brysonsteck/wiimmfi-watcher/tree/master'>here.</a> You are free to use this code and expand upon it under the GNU General Public License.</string> - <string name="bugs">Speaking of bugs, did you find a bug? First, make sure that the issue you found is not listed on my <a href='https://github.com/brysonsteck/wiimmfi-watcher/blob/master/TODO.md'>todo list.</a> It\'s possible I\'m already aware of it or working on it. If your issue is not addressed on the todo list, then you can create an issue on my GitHub repository <a href='https://github.com/brysonsteck/wiimmfi-watcher/issues'>here.</a> If you don\'t know how to use GitHub, you can fill out this <a href='https://docs.google.com/forms/d/e/1FAIpQLSd6qCONAP2tsbHPgzu_CdZcHVHL5nx7q0XFqrVfExEc84kqUQ/viewform?usp=sf_link'>Google Form</a> instead.</string> - <string name="license">© Copyright 2021 Bryson Steck\n\nWiimmfi Watcher is available under the GNU General Public License Version 3. You can view the license <a href='https://github.com/brysonsteck/wiimmfi-watcher/tree/dev/LICENSE'>here.</a>\n\nWiimmfi Watcher is free software: you can redistribute it and/or modify +<!-- About Fragment strings --> + <string name="about_me">Hi there! My name is Bryson Steck. I am a student studying Computer Science. This is my first official application that I\'m maintaining. This whole \"application on the Google Play Store\" thing is new to me, so please be patient as I am learning how to maintain something like this. I hope you enjoy!</string> + <string name="about_watcher">Wiimmfi Watcher is an UNOFFICIAL application created for a school project that I have decided to turn into a full application. This application was made to provide an easy shortcut to the Wiimmfi website and display data in a mobile friendly way, since the official website doesn\'t have a mobile friendly version. Free and open source, you can watch your Wiimmfi matches on your phone in a quick and easy way. </string> + <string name="github">All of the code in this project is open source on my GitHub repository <a href='https://github.com/brysonsteck/wiimmfi-watcher/tree/master'>here.</a> You are free to use this code and expand upon it under the <a href='https://github.com/brysonsteck/wiimmfi-watcher/tree/master/LICENSE'>GNU General Public License</a> (Version 3).</string> + <string name="bugs">Speaking of bugs, did you find a bug? Do you want to provide feedback on the app? I\'d love to hear it! First, make sure that the issue you found is not listed on my <a href='https://github.com/brysonsteck/wiimmfi-watcher/blob/master/TODO.md'>todo list.</a> It\'s possible I\'m already aware of it or working on it. If your issue is not addressed on the todo list, then you can create an issue on my GitHub repository <a href='https://github.com/brysonsteck/wiimmfi-watcher/issues'>here.</a> If you don\'t know how to use GitHub, you can fill out this <a href='https://docs.google.com/forms/d/e/1FAIpQLSd6qCONAP2tsbHPgzu_CdZcHVHL5nx7q0XFqrVfExEc84kqUQ/viewform?usp=sf_link'>Google Form</a> instead.</string> + <string name="license">© Copyright 2021 Bryson Steck\n\nWiimmfi Watcher is available under the GNU General Public License Version 3. You can view the license <a href='https://github.com/brysonsteck/wiimmfi-watcher/tree/master/LICENSE'>here.</a>\n\nWiimmfi Watcher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nWiimmfi Watcher is distributed in the hope that it will be useful, @@ -10,5 +13,5 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with Wiimmfi Watcher. If not, see <<a href='https://www.gnu.org/licenses/'>https://www.gnu.org/licenses/</a>>.</string> - <string name="contact">If you would like to get ahold of me for any reason unrelated to bug reports or this app in general, you can contact me through email at <a href='mailto:steck.bryson@gmail.com'>steck.bryson@gmail.com</a> or on Discord at bryzinga#9971.</string> + <string name="contact">If you would like to get a hold of me for any reason unrelated to bug reports or this app in general, you can contact me through email at <a href='mailto:steck.bryson@gmail.com'>steck.bryson@gmail.com</a> or on Discord at bryzinga#9971.</string> </resources>
\ No newline at end of file |