Sfoglia il codice sorgente

增加了获取机器的IP地址并显示的功能

robbin 4 anni fa
parent
commit
a40172c65b

+ 1 - 1
.idea/misc.xml

@@ -29,7 +29,7 @@
       </value>
       </value>
     </option>
     </option>
   </component>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   </component>
   <component name="ProjectType">
   <component name="ProjectType">

+ 4 - 0
app/src/main/AndroidManifest.xml

@@ -101,4 +101,8 @@
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <!-- 从SDCard读取数据权限 -->
     <!-- 从SDCard读取数据权限 -->
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
+
+    <!-- 设置用户权限 -->
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
 </manifest>
 </manifest>

+ 48 - 0
app/src/main/java/com/example/administrator/wingcool_gt9_apk/GT9MainActivity.java

@@ -16,6 +16,10 @@ import android.hardware.usb.UsbDeviceConnection;
 import android.hardware.usb.UsbEndpoint;
 import android.hardware.usb.UsbEndpoint;
 import android.hardware.usb.UsbInterface;
 import android.hardware.usb.UsbInterface;
 import android.hardware.usb.UsbManager;
 import android.hardware.usb.UsbManager;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
 import android.os.Bundle;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Handler;
 import android.os.Message;
 import android.os.Message;
@@ -32,7 +36,12 @@ import android.widget.RadioGroup;
 import android.widget.TextView;
 import android.widget.TextView;
 import android.widget.Toast;
 import android.widget.Toast;
 
 
+import java.net.Inet4Address;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.SocketException;
 import java.util.Collection;
 import java.util.Collection;
+import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.List;
@@ -40,6 +49,8 @@ import java.util.Locale;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Executors;
 
 
+import static android.os.Build.VERSION_CODES.M;
+
 //===============================================================//
 //===============================================================//
 //=================================================================//
 //=================================================================//
 
 
@@ -68,6 +79,7 @@ public class GT9MainActivity extends AppCompatActivity
 
 
     private UsbInterface mUsbInterface;
     private UsbInterface mUsbInterface;
     private TextView mShow;
     private TextView mShow;
+    private TextView tvIPAddress;
     private Context mShowID;
     private Context mShowID;
     private Button btnExit;
     private Button btnExit;
 
 
@@ -105,6 +117,7 @@ public class GT9MainActivity extends AppCompatActivity
             }
             }
         }
         }
     };
     };
+
     //==========================================================================================//
     //==========================================================================================//
 
 
     @Override
     @Override
@@ -316,10 +329,14 @@ public class GT9MainActivity extends AppCompatActivity
         initView();
         initView();
         initData();
         initData();
         openDevices();
         openDevices();
+        //GetIPAddress();
     }
     }
 
 
     private void initView() {
     private void initView() {
         mShow = (TextView) findViewById(R.id.show);
         mShow = (TextView) findViewById(R.id.show);
+        tvIPAddress = (TextView) findViewById(R.id.ipaddressshow);
+
+        tvIPAddress.setText("IP Address : " + GetIPAddress());
     }
     }
 
 
     private void initData() {
     private void initData() {
@@ -521,6 +538,37 @@ public class GT9MainActivity extends AppCompatActivity
 
 
         System.exit(0);
         System.exit(0);
     }
     }
+
+    public static String GetIPAddress()
+    {
+       try {
+
+            for (Enumeration<NetworkInterface> enNetI = NetworkInterface.getNetworkInterfaces(); enNetI.hasMoreElements(); ) {
+
+                NetworkInterface netI = enNetI.nextElement();
+
+                for (Enumeration<InetAddress> enumIpAddr = netI.getInetAddresses(); enumIpAddr.hasMoreElements(); ) {
+
+                    InetAddress inetAddress = enumIpAddr.nextElement();
+
+                    if (inetAddress instanceof Inet4Address && !inetAddress.isLoopbackAddress()) {
+
+                        return inetAddress.getHostAddress();
+
+                    }
+
+                }
+
+            }
+
+        } catch (SocketException e) {
+
+            e.printStackTrace();
+
+        }
+
+        return "0.0.0.0";
+    }
 }
 }
 
 
 class OpenDevicesReceiver extends BroadcastReceiver {
 class OpenDevicesReceiver extends BroadcastReceiver {

+ 22 - 1
app/src/main/res/layout-hdpi/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -148,7 +169,7 @@
                         android:text="@string/portrait"
                         android:text="@string/portrait"
                         android:textSize="20dp"/>
                         android:textSize="20dp"/>
 
 
-                    
+
                 </RadioGroup>
                 </RadioGroup>
             </LinearLayout>
             </LinearLayout>
 
 

+ 22 - 1
app/src/main/res/layout-land-hdpi/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -148,7 +169,7 @@
                         android:text="@string/portrait"
                         android:text="@string/portrait"
                         android:textSize="20dp"/>
                         android:textSize="20dp"/>
 
 
-                    
+
                 </RadioGroup>
                 </RadioGroup>
             </LinearLayout>
             </LinearLayout>
 
 

+ 22 - 1
app/src/main/res/layout-land-mdpi/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -148,7 +169,7 @@
                         android:text="@string/portrait"
                         android:text="@string/portrait"
                         android:textSize="20dp"/>
                         android:textSize="20dp"/>
 
 
-                    
+
                 </RadioGroup>
                 </RadioGroup>
             </LinearLayout>
             </LinearLayout>
 
 

+ 22 - 1
app/src/main/res/layout-land-xhdpi/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -148,7 +169,7 @@
                         android:text="@string/portrait"
                         android:text="@string/portrait"
                         android:textSize="20dp"/>
                         android:textSize="20dp"/>
 
 
-                    
+
                 </RadioGroup>
                 </RadioGroup>
             </LinearLayout>
             </LinearLayout>
 
 

+ 22 - 1
app/src/main/res/layout-land-xxhdpi/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -148,7 +169,7 @@
                         android:text="@string/portrait"
                         android:text="@string/portrait"
                         android:textSize="20dp"/>
                         android:textSize="20dp"/>
 
 
-                    
+
                 </RadioGroup>
                 </RadioGroup>
             </LinearLayout>
             </LinearLayout>
 
 

+ 22 - 1
app/src/main/res/layout-land-xxxhdpi/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -148,7 +169,7 @@
                         android:text="@string/portrait"
                         android:text="@string/portrait"
                         android:textSize="20dp"/>
                         android:textSize="20dp"/>
 
 
-                    
+
                 </RadioGroup>
                 </RadioGroup>
             </LinearLayout>
             </LinearLayout>
 
 

+ 22 - 1
app/src/main/res/layout-land/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -148,7 +169,7 @@
                         android:text="@string/portrait"
                         android:text="@string/portrait"
                         android:textSize="20dp"/>
                         android:textSize="20dp"/>
 
 
-                    
+
                 </RadioGroup>
                 </RadioGroup>
             </LinearLayout>
             </LinearLayout>
 
 

+ 22 - 1
app/src/main/res/layout-mdpi/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -148,7 +169,7 @@
                         android:text="@string/portrait"
                         android:text="@string/portrait"
                         android:textSize="20dp"/>
                         android:textSize="20dp"/>
 
 
-                    
+
                 </RadioGroup>
                 </RadioGroup>
             </LinearLayout>
             </LinearLayout>
 
 

+ 22 - 1
app/src/main/res/layout-xhdpi/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -148,7 +169,7 @@
                         android:text="@string/portrait"
                         android:text="@string/portrait"
                         android:textSize="20dp"/>
                         android:textSize="20dp"/>
 
 
-                    
+
                 </RadioGroup>
                 </RadioGroup>
             </LinearLayout>
             </LinearLayout>
 
 

+ 22 - 1
app/src/main/res/layout-xxhdpi/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -148,7 +169,7 @@
                         android:text="@string/portrait"
                         android:text="@string/portrait"
                         android:textSize="20dp"/>
                         android:textSize="20dp"/>
 
 
-                    
+
                 </RadioGroup>
                 </RadioGroup>
             </LinearLayout>
             </LinearLayout>
 
 

+ 22 - 1
app/src/main/res/layout-xxxhdpi/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -148,7 +169,7 @@
                         android:text="@string/portrait"
                         android:text="@string/portrait"
                         android:textSize="20dp"/>
                         android:textSize="20dp"/>
 
 
-                    
+
                 </RadioGroup>
                 </RadioGroup>
             </LinearLayout>
             </LinearLayout>
 
 

+ 21 - 0
app/src/main/res/layout/activity_gt9_main.xml

@@ -79,6 +79,27 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.273" />
                 app:layout_constraintVertical_bias="0.273" />
 
 
+            <TextView
+                android:id="@+id/ipaddressshow"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:ems="10"
+                android:gravity="center"
+                android:textSize="20dp"
+                android:textColor="#FFFFFF"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.503"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.273" />
+
             <LinearLayout
             <LinearLayout
                 android:id="@+id/RadioLinearLayout"
                 android:id="@+id/RadioLinearLayout"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"