Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotspot mode #62

Open
dhanar10 opened this issue Jun 4, 2018 · 5 comments
Open

Hotspot mode #62

dhanar10 opened this issue Jun 4, 2018 · 5 comments

Comments

@dhanar10
Copy link

dhanar10 commented Jun 4, 2018

Hi,

Is it possible to make the app working when the android is in hotspot mode? I get a message that i need to turn on wifi on my phone.

Thank you

@ohmae
Copy link
Owner

ohmae commented Jun 4, 2018

In the wifi hotspot, I think that this app will not work because there are restrictions on network by security. (e.g. perhaps multicast does not allowed...🤔)
And I think that it is meaningless even if this app works because there is no DLNA server...

@dhanar10
Copy link
Author

dhanar10 commented Jun 5, 2018

Well, it is possible that the client which connect to the hotspot actually has DLNA server running on it (yes, i know this is a weird case)

I just found out that DMS Player as it is on Lenovo K4 Note can run in hotspot mode normally :D but it does not work on Xiaomi Redmi 4X.

According to https://stackoverflow.com/questions/15388300/wifi-hotspot-multicast-broadcast , it seems like hotspot probably has support for multicast.

The simplest way to test it is probably in AndroidLan.java, change

public boolean hasAvailableInterface() {
        final NetworkInfo ni = mConnectivityManager.getActiveNetworkInfo();
        return ni != null && ni.isConnected()
                && (ni.getType() == ConnectivityManager.TYPE_WIFI
                || ni.getType() == ConnectivityManager.TYPE_ETHERNET);
    }

to

public boolean hasAvailableInterface() {
        final NetworkInfo ni = mConnectivityManager.getActiveNetworkInfo();
        return ni != null && ni.isConnected();
    }

@ohmae
Copy link
Owner

ohmae commented Jun 5, 2018

Since I can not reproduce it in my environment, could you tell me the value of ni.getType() in that case?
The reason why I am checking ni.getType(), I want to check if there is a local network connection.
I want to avoid to send problematic packet to the global network.

@ohmae
Copy link
Owner

ohmae commented Jun 5, 2018

I just noticed...
NetworkInfo#getType() was deprecated in API level P. 😱

@dhanar10
Copy link
Author

dhanar10 commented Jun 6, 2018

I just noticed...
NetworkInfo#getType() was deprecated in API level P. 😱

Time to update the implementation then :D

could you tell me the value of ni.getType() in that case?

Let see what I can do to get it. I am a noob when it comes to android app development. :D

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

No branches or pull requests

2 participants