Skip to content

Fix: Inform user if there's no internet connection while trying to ac… - #448

Closed
balaji-ramavathu wants to merge 0 commit into
amahi:betafrom
balaji-ramavathu:no-internet
Closed

Fix: Inform user if there's no internet connection while trying to ac…#448
balaji-ramavathu wants to merge 0 commit into
amahi:betafrom
balaji-ramavathu:no-internet

Conversation

@balaji-ramavathu

@balaji-ramavathu balaji-ramavathu commented Mar 20, 2019

Copy link
Copy Markdown
Contributor

…cess media files

Fixes #447

Summary

  1. For all file types, a toast is displayed that there's no internet connection and goes back to files list page.
  2. For video files, if internet is disconnected while the video is playing, EndReached Event is fired and hence the check for internet connection is implemented there.

Please Add Screenshots If any UI changes.

For audio (same for all other types) :

amahi-audio

If internet goes off while playing video :

amahi-video

Comment thread src/main/java/org/amahi/anywhere/activity/ServerFileAudioActivity.java Outdated
@codedentwickler

codedentwickler commented Mar 25, 2019

Copy link
Copy Markdown
Member

Great idea. It is good to have such indicator messages on the app. Maybe we can do better with the messages and the checks though.

There is a possibility the user is running a local server which means he won't need to be connected to the internet to access his files. (Basically accessing files on a local server via a Wifi network.)

This messages might come up at the wrong time in this case. However there is still a good chance, the Wifi network gets disconnected and the files on the local server cant be access.

We will need to have appropriate checks and messages for these situations.

@balaji-ramavathu

Copy link
Copy Markdown
Contributor Author

hey @codedentwickler how do I check if the user is running a local server?

@codedentwickler

codedentwickler commented Mar 30, 2019

Copy link
Copy Markdown
Member

Yes, An easy way is to do a check like in the snippet below. You can understand how auto, remote and local connections is used by observing how this shared preference key preference_key_server_connection is modified.

private boolean isConnectionLocal() { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String preferenceConnection = preferences.getString(getString(R.string.preference_key_server_connection), null); return preferenceConnection.equals(getString(R.string.preference_key_server_connection_local)); }

@codedentwickler

codedentwickler commented Mar 30, 2019

Copy link
Copy Markdown
Member

@csoni111 @cpg what do you think about this feature.

@balaji-ramavathu

Copy link
Copy Markdown
Contributor Author

@codedentwickler thanks! I will add these checks :-)

@balaji-ramavathu

Copy link
Copy Markdown
Contributor Author

@codedentwickler I've added checks and messages for the local server case.
Can you have a look once? : )

@Akash-Ramjyothi

Copy link
Copy Markdown
Member

This is a really good feature and works fine on testing on both local as well as on remote connections, I recommend @cpg to Merge this PR.

@chirag-jn

Copy link
Copy Markdown
Member

Something wrong happened. Some issues while merging instead closed the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inform user if there's no internet connection while trying to access media files

5 participants