Captive Portal Inside Android Application

Can anyone tell me how to open a captive portal inside an Android application?

I went through the links below https://developer.android.com/reference/android/net/CaptivePortal.html Using ACTION_CAPTIVE_PORTAL_SIGN_IN

Can anyone have a complete guide on using the embedded portal inside an Android application?

+5
source share
3 answers

Following is a stream of pushing captives

enter image description here

Use the following Android document to program the part.

https://developer.android.com/reference/android/net/CaptivePortal.html

I think it will be useful

+5
source

WifiPortalAutoLog - ,

: :

  • Wi-Fi
  • SignInActivity
  • MainActivity

MainActivity , ConnectionManager.ACTION_CAPTIVE_PORTAL_SIGN_IN:

if (ConnectivityManager.ACTION_CAPTIVE_PORTAL_SIGN_IN.equals(intent.getAction())) {

captivePortal :

captivePortal = intent.getParcelableExtra(ConnectivityManager.EXTRA_CAPTIVE_PORTAL);

ConnectivityManager.EXTRA_NETWORK extra ( Network) (.. ):

net = intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK);

url WebView, :

<activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.net.conn.CAPTIVE_PORTAL" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
</activity>
+4

. . Samsung Android, , . Samsung, , Huawei, , , Oneplus, Mi, Htc , , , , .

<intent-filter>
  <action android:name="android.net.conn.CAPTIVE_PORTAL"/>
  <category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

, , :

https://community.arubanetworks.com/t5/Wireless-Access/Samsung-Captive-Portal-Detection/mp/405934#M78972

0

Source: https://habr.com/ru/post/1682213/


All Articles