Docking Debugging ============================== Access Switch Settings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ iMin devices allow third-party applications to be installed by default, and you can also restrict installation permissions through partners. Open installation permissions Partners can log in via https://kit.imin.sg to open or close third party APP installation permissions .. image:: ../images/Third-party-installation.png :width: 800 Open Developer Rights ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1. Enter Settings > About > Version .. image:: ../images/DockingDebugging/OpenDeveloperRights-01.png :width: 800 2. Click 5 times in a row to enter the developer mode 3. Return to the previous level and select the developer mode .. image:: ../images/DockingDebugging/OpenDeveloperRights-02.png :width: 800 4. Open USB debugging interface .. image:: ../images/DockingDebugging/OpenDeveloperRights-03.png :width: 800 .. image:: ../images/DockingDebugging/OpenDeveloperRights-04.png :width: 800 5.Finshed Debugging Devices ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You can debug after plugging in USB line to default iMin device. iMin has also provided the control function for device debugging permission. After the partner has enabled debugging permission control in the background (as shown in the following figure), it is necessary to obtain debugging permission via E-mail to debug this device. If you cannot directly debug, please check whether the partner backstage has enabled this permission. .. image:: ../images/DockingDebugging/1.png :width: 800 Note: the control of debugging permission takes effect only to the devices that have bound partners (channels). **How to debug device while the permission is on** If the partner has enabled “debugging permission control”, the developer need to obtain the debugging permission via E-mail on his/her own device to debug the device. The partner can add the E-mail of the debugging personnel (developer) on the iMin partner platform. Steps to obtain the device debugging permission as follows: 1.Add debugging personnel Before debugging the device, the developer is required to know the channel that the device belongs to. He/she can look for the management personnel relevant to his/her own company for inquiry. The management personnel needs to add the debugging personnel’s E-mail in iMin partner platform background. .. image:: ../images/DockingDebugging/2.png :width: 800 2. Plug in USB. Connect the device to the computer after confirming that you have your own E-mail for debugging permission. It is suggested that the developer debug under windows. .. image:: ../images/DockingDebugging/3.png :width: 800 3.Get the veification code .. image:: ../images/DockingDebugging/4.png :width: 800 Click the above “USB debuging” item, you will enter the step of permission verification via E-mail. Meanwhile, the USB debugging mode of the device will be enabled by 4. Verify the permission .. image:: ../images/DockingDebugging/5.png :width: 800 Click “Obtain the verification code” after entering the previously added E-mail. iMin will send the verification code to the E-mail. Fill in the verification code and click “Authorize and enable debugging” The verification code is valid and reusable within 30 minutes, and it can be used any number of times. **After the device restarts, USB Debugging is automatically closed** 5.Open the permission. After opening the permission, you can check whether there is output in logcat to judge if it’s OK to debug the device. Special Codes Description ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1. Get iMin device identification iMin recommends getting the following information to determine if it is an iMin equipment: 1.Brand name of the device(e.g. iMin) The brand name of iMin is unified as iMin 2.System model of the device(e.g. D2-401) The system model is composed of product model + hardware characteristics Among them, starting with M is a handheld device, starting with D, S is a horizontal screen device Download the `IminLibs.jar `_ package first, then reference it in the project, and obtain the specified value in the following way: The code to get the brand is: .. code-block:: java :linenos: :emphasize-lines: 1 String brand = SystemPropManager.getBrand(); The method to get the model is: .. code-block:: java :linenos: :emphasize-lines: 1 String model = SystemPropManager.getModel(); The code for obtaining the SN number is: .. code-block:: java :linenos: :emphasize-lines: 1 String sn = SystemPropManager.getSn(); 2. Hide and restore the bottom navigation bar .. note:: (Note: iMin has newly developed the Kiosk screen control mode. The APP does not need to be modified. The status bar and navigation bar can be hidden through cloud settings and cannot be called out by gestures. It is recommended that partners use iMin Kiosk screen control mode. Better experience) The Android system provides a way to hide the navigation bar of the system by default, but the support for Dialog is poor, which causes the navigation bar to pop up and then hide (splash screen) when the full screen dialog is opened. iMin OS has fixed this problem 1.Activity full screen ——Android default support .. code-block:: java :linenos: :emphasize-lines: 7 public class MainActivity extends AppCompatActivity { @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); SystemUIUtils.setStickFullScreen(getWindow().getDecorView()); } } .. code-block:: java :linenos: :emphasize-lines: 14 public class SystemUIUtils { public static void setStickFullScreen(View view) { int systemUiVisibility = view.getSystemUiVisibility(); int flags = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; systemUiVisibility |= flags; view.setSystemUiVisibility(systemUiVisibility); } } 2.Full screen of Dialog ——The AOSP bug in the native system will cause the navigation bar to pop up when the full-screen dialog is opened and then hide the navigation bar (splash screen). .. code-block:: java :linenos: :emphasize-lines: 10 public AlertDialog create(boolean fullscreen) { LayoutInflater inflater = LayoutInflater.from(context); final AlertDialog dialog = new AlertDialog(context, R.style.DialogStyle); if(fullscreen){ SystemUIUtils.setStickFullScreen(dialog.getWindow().getDecorView()); } } 3. How to avoid plugging in USB peripherals to cause app interface flicker In the AndroidManifest of the APP, add the following code .. image:: ../images/DockingDebugging/6.png :width: 198 .. code-block:: java :linenos: :emphasize-lines: 1 android:configChanges="navigation|keyboardHidden|keyboard" .. image:: ../images/DockingDebugging/7.png :width: 800 Wireless Debugging Guide ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Suitable Devices (M2-Max, D1 , D1 Pro, Falcon 1) 1. 1.From the main menu, go to settings>developer options> turn on USB debugging and wireless debugging .. image:: ../images/DockingDebugging/8.png :width: 800 2. Link the device and PC with USB cable, under normal circumstances, from the notification bar, “USB debugging connected” will be shown. If this notification is not shown, repeat Step 1 .. image:: ../images/DockingDebugging/9.png :width: 800 3. From your PC, go to cmd.exe, insert adb tcpip 5555 (settings tcpip 5555) .. image:: ../images/DockingDebugging/10.png :width: 800 Take note on during the first debugging, a popup will appear, click Allow to enable debugging. .. image:: ../images/DockingDebugging/11.png :width: 800 4. Continue to execute adb shell ifconfig wlan0, check the IP address of the WiFI, obtain the wlan0 value beside the IP address. .. image:: ../images/DockingDebugging/12.png :width: 800 5. Execute adb connect *IP* (IP address is obtained from step 4), remarks: IP address of wifi connected to device must be the same network with PC .. image:: ../images/DockingDebugging/13.png :width: 800 After connecting successfully, it will show as connected to *IP* 6. Remove USB cable, turn off USB debugging and Wireless debugging, Turn on WiFi debugging again, there will be a prompt to allow wireless debugging. .. image:: ../images/DockingDebugging/14.png :width: 800 After clicking “Allow” .. image:: ../images/DockingDebugging/15.png :width: 800 7. Settings are complete, execute adb shell to test the Wireless debugging result.