Git Product home page Git Product logo

android-bridge-app's Introduction

Android-Bridge-App

What is this?

The Android Bridge App allows efficient development of Android applications.

Many DJI products require the Android device to be connected directly through USB to a remote controller, which means the Android device can only be connected to the PC through WiFi debugging. While workable, development is slow as resource intensive tasks such as profiling or transferring a new build to the mobile device can take a long time. In addition, the Android Studio emulator cannot be used to do any development.

The Android bridge app runs on an Android device connected to the remote controller and accepts a network connection from another Android device running an SDK based application. It acts as a bridge between the remote controller and the Android device running the SDK based application.

This means:

  • The Android device running the SDK based application can connect with USB to the PC, while connecting over WiFi to the bridge app
  • Or the Android Studio emulator can be used on the PC and connect to the bridge app over WiFi

This makes it easier develop, debug, setup CI environments, share devices in a team, or even do remote development with devices.

Compatibility

  • The Bridge App is compatible with the Android DJI Mobile SDK v4.0 and above.
  • The Bridge App is compatible with all DJI RC

Setup

When using the bridge app, two Android devices are used (or one device with the bridge app and the emulator):

  1. An Android device with the BridgeApp apk that is connected directly to the remote controller
  2. An Android device running an SDK based application

Both devices must be able to resolve each other's IP address - and should be used on the same network. Only wi-fi and ethernet connections have been tested to work.

The steps to make the bridge app work are:

  • Device 1:

    • Start the bridge app
    • Connect the Android device to remote controller
    • Grant USB access to the bridge app
    • Make sure the red light in the top left corner of the screen turns green - this shows the bridge app is connected with the DJI product
    • There will be an IP address in the middle of the screen - which is used with the second device.
  • Device 2:

    • Device 2 should be running a DJI Mobile SDK based application.
    • The IP address of Device 1 should be passed to enableBridgeModeWithBridgeAppIP in SDKManager to connect with Device 1. enableBridgeModeWithBridgeAppIP must be called after the sdk has registered.
new DJISDKManager.SDKManagerCallback() {

        @Override
        public void onRegister(DJIError error) {
            isRegistrationInProgress.set(false);
            if (error == DJISDKError.REGISTRATION_SUCCESS) {
                // ...
                // ADD CALL HERE
                DJISDKManager.getInstance().enableBridgeModeWithBridgeAppIP("YOUR IP");
            } else {
            	// ...
            }
        }
        @Override
        public void onProductDisconnect() {
        	// ...
        }

        @Override
        public void onProductConnect(BaseProduct product) {
        	// ...
        }

        @Override
        public void onComponentChange(BaseProduct.ComponentKey key,
                                      BaseComponent oldComponent,
                                      BaseComponent newComponent) {
          	// ...
        }
    };
  • Make sure the red light in the top left corner of Device 2's screen turns green - this shows Device 2 is connected with Device 1.
  • The application can now be run remotely.

App Features

  • Layout:

    alt text

  • RC indicator:

    • alt text No USB device connected to BridgeApp
    • alt text Connected device is not supported or not working properly
    • alt text DJI RC is connected
  • Connection indicator

    • alt text No SDK Application is connected to Bridge
    • alt text There is at least one SDK Application connected to BridgeApp
  • Host IP Address: This is the address of the BridgeApp. To connect to it, pass in the displayed ip value to enableBridgeModeWithBridgeAppIP method in SDKManager.

  • App Version: Displays the current version of the BridgeApp. This is not the version of the DJI SDK.

  • Functionalities:

    • BridgeApp supports conntection via Wifi or Eithernet ( using USB Adapter and CrystalSky)
    • BirdgeApp acceptes multiple simultinous connections. This is helpful to share one Aircraft with many developers.

Feedback

This is a beta version of the Bridge App. Please provide feedback in areas you think it could be improved or is unstable.

Please use Github Issue or email [email protected] when you meet any problems of using this project. At a minimum please let us know:

  • Which DJI Product you are using?
  • Which Android Device and Android System version you are using?
  • Which Android Studio version you are using?
  • A short description of your problem includes debugging logs or screenshots.
  • Any bugs or typos you come across.

License

Android-Bridge-App is available under the MIT license. Please see the LICENSE file for more info.

Join Us

DJI is looking for all kinds of Software Engineers to continue building the Future of Possible. Available positions in Shenzhen, China and around the world. If you are interested, please send your resume to [email protected]. For more details, and list of all our global offices, please check https://we.dji.com/jobs_en.html.

DJI 招软件工程师啦,based在深圳,如果你想和我们一起把DJI产品做得更好,请发送简历到 [email protected]. 详情请浏览 https://we.dji.com/zh-CN/recruitment.

android-bridge-app's People

Contributors

alainpimentel avatar dji-dev avatar hoker1 avatar oliverou avatar siddutgikar avatar talobin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-bridge-app's Issues

Cannot connect to RC

Is the DJI mini SE remote control supported by the released APKs?
Are the APKs referencing dji's sdk version 4 or 5?

Is there any option to get more verbose logs or to debug the USB connection problem?

I tried on two different Android devices:

One kept displaying the red icon ("no device connected") even when dmesg was showing that the USB device got connected

And the other device was showing a purple icon.

Exception when making a connection.

The issue is resolved when using the new version of the DJI SDK (4.0.1)

When I try to create a connection between my emulator and bridge app, the app on my emulator crashes and show the following errors shown below. The bridge application shows that there is a connection for a brief moment, but disconnects quickly afterwards. Maybe this is a problem with the DJI SDK and not the bridge app though.

04-08 11:25:39.457 13179-13218/utwente.uav.uavdisasterprobev2 D/enableBridgeMode: ip: 192.168.2.4
04-08 11:25:39.458 13179-13218/utwente.uav.uavdisasterprobev2 E/DJIUsbAccessoryReceiver: start accessory receiver
                                                                                         
                                                                                         [ 04-08 11:25:39.466 13179:13218 E/         ]
                                                                                         stopDaemon AOA
04-08 11:25:39.467 13179-13218/utwente.uav.uavdisasterprobev2 E/d: djisocket destroy
04-08 11:25:39.467 13179-13218/utwente.uav.uavdisasterprobev2 E/daemon: destroy wifi 1
04-08 11:25:39.467 13179-13218/utwente.uav.uavdisasterprobev2 E/b: djisocket destroy
04-08 11:25:39.468 13179-13218/utwente.uav.uavdisasterprobev2 E/daemon: destroy wifi 2
04-08 11:25:39.469 13179-13218/utwente.uav.uavdisasterprobev2 E/c: udt destroy 1 9000
04-08 11:25:39.469 13179-13218/utwente.uav.uavdisasterprobev2 E/c: udt destroy 2 9000
04-08 11:25:39.469 13179-13218/utwente.uav.uavdisasterprobev2 E/daemon: destroy wifi 3
04-08 11:25:39.470 13179-13218/utwente.uav.uavdisasterprobev2 E/a: udt destroy 1 9001
04-08 11:25:39.470 13179-13218/utwente.uav.uavdisasterprobev2 E/a: udt destroy 2 9001
04-08 11:25:39.470 13179-13218/utwente.uav.uavdisasterprobev2 E/daemon: destroy wifi 4
04-08 11:25:39.470 13179-13218/utwente.uav.uavdisasterprobev2 E/daemon: destroy wifi 4
                                                                        
                                                                        [ 04-08 11:25:39.471 13179:13218 D/         ]
                                                                        ===DJIProductManager===[AOA]
                                                                        
                                                                        [ 04-08 11:25:39.472 13179:13218 D/         ]
                                                                        ===rcType bylink===[litchiX]
04-08 11:25:39.473 13179-13218/utwente.uav.uavdisasterprobev2 D/DJIComponentManager: Sat Apr 08 11:25:39 EDT 2017DJILinkType linkType
                                                                                     
                                                                                     [ 04-08 11:25:39.473 13179:13218 D/         ]
                                                                                     linkType=AOA
04-08 11:25:39.515 13179-13218/utwente.uav.uavdisasterprobev2 D/UsbAccessoryService: recvBufferThread.start
04-08 11:25:39.516 13179-13218/utwente.uav.uavdisasterprobev2 D/UsbAccessoryService: parseVideoFromCamThread.start
04-08 11:25:39.518 13179-13385/utwente.uav.uavdisasterprobev2 D/UsbAccessoryService: Camera ParseVideoRunnable false
04-08 11:25:39.518 13179-13385/utwente.uav.uavdisasterprobev2 D/UsbAccessoryService: ParseVideoRunnable.end
04-08 11:25:39.518 13179-13218/utwente.uav.uavdisasterprobev2 D/UsbAccessoryService: parseVideoFromFpvThread.start
04-08 11:25:39.518 13179-13218/utwente.uav.uavdisasterprobev2 D/enableBridgeMode: end
04-08 11:25:39.518 13179-13218/utwente.uav.uavdisasterprobev2 E/UAVDisasterProbeApplication: API Key successfully registered
04-08 11:25:39.518 13179-13386/utwente.uav.uavdisasterprobev2 D/UsbAccessoryService: Fpv ParseVideoRunnable false
04-08 11:25:39.518 13179-13386/utwente.uav.uavdisasterprobev2 D/UsbAccessoryService: ParseVideoRunnable.end
04-08 11:25:39.523 13179-13384/utwente.uav.uavdisasterprobev2 D/UsbAccessoryService: RecvOsdRunnable false
04-08 11:25:39.670 13179-13382/utwente.uav.uavdisasterprobev2 E/DJICrashHandler: uncaughtException 2
04-08 11:25:39.672 13179-13382/utwente.uav.uavdisasterprobev2 E/UsbAccessoryService: final destroy() 71
04-08 11:25:39.773 13179-13382/utwente.uav.uavdisasterprobev2 E/UsbAccessoryService: final destroy() 72
04-08 11:25:39.773 13179-13382/utwente.uav.uavdisasterprobev2 E/wm220: ****resetSwitchFromWifiFlag
04-08 11:25:39.773 13179-13382/utwente.uav.uavdisasterprobev2 E/DJIUsbAccessoryReceiver: receiver destroySession
04-08 11:25:39.773 13179-13382/utwente.uav.uavdisasterprobev2 E/UsbAccessoryService: final destroy() 73
04-08 11:25:39.773 13179-13382/utwente.uav.uavdisasterprobev2 E/UsbAccessoryService: final destroy() 75
04-08 11:25:39.773 13179-13382/utwente.uav.uavdisasterprobev2 E/UsbAccessoryService: final destroy() 76
04-08 11:25:39.773 13179-13382/utwente.uav.uavdisasterprobev2 E/DJICrashHandler: uncaughtException 3
04-08 11:25:39.805 13179-13179/utwente.uav.uavdisasterprobev2 D/DJIRemoteVersionInfo: UpgradeConfigInfo getFile for net success
04-08 11:25:39.973 13179-13382/utwente.uav.uavdisasterprobev2 E/DJICrashHandler: uncaughtException 4
04-08 11:25:39.973 13179-13382/utwente.uav.uavdisasterprobev2 E/AndroidRuntime: FATAL EXCEPTION: Thread-32
                                                                                Process: utwente.uav.uavdisasterprobev2, PID: 13179
                                                                                java.lang.AbstractMethodError: abstract method "void org.java_websocket.client.WebSocketClient.onOpen(org.java_websocket.handshake.ServerHandshake)"
                                                                                    at org.java_websocket.client.WebSocketClient.onWebsocketOpen(WebSocketClient.java:328)
                                                                                    at org.java_websocket.WebSocketImpl.open(WebSocketImpl.java:649)
                                                                                    at org.java_websocket.WebSocketImpl.decodeHandshake(WebSocketImpl.java:276)
                                                                                    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:159)
                                                                                    at org.java_websocket.client.WebSocketClient.interruptableRun(WebSocketClient.java:230)
                                                                                    at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:188)
                                                                                    at java.lang.Thread.run(Thread.java:761)
04-08 11:25:39.977 13179-13218/utwente.uav.uavdisasterprobev2 D/nfz: refresh db
04-08 11:25:39.978 13179-13218/utwente.uav.uavdisasterprobev2 D/nfz: DataFlycGetPushRequestLimitUpdate in, serialnumber: 
04-08 11:25:39.980 13179-13382/utwente.uav.uavdisasterprobev2 I/Process: Sending signal. PID: 13179 SIG: 9

Release APK is not available

Earlier releases provided an APK for easy installation on an android device. The APKs have been removed, requiring me to build these releases from scratch in order to update. Please provide a release APK rather than just the source files.

IP Address not correct

i have 2 Android phones (HTC 4.3 and Sony Z5 6.0.1) and both phone displayed a different IP address connected to identical WiFi spot.

HTC 172. 30.xxxx.xx identical to Speedtest by Ookla IP address displayed
Sony Z5 10.108.69.80 NOT identical to Speedtest by Ookla

May i know why ?
Android-Bridge-App version 1.2.4
Android Studio 3.1.3

iOS cross compatibility

Any chance this will be modified so that iOS devices can be connected wirelessly to the Android device acting as bridge?

Is this project open source?

Hey,

I would like to make some changes to the Android Bridge App, is there a github project somewhere with the source code?

Thanks!

Can't get this app to work

I'm calling the method DJISDKManager.getInstance().enableBridgeModeWithBridgeAppIP("192.168.1.126");
in the sdk app but there's no connection. I followed the guide in the readme.
I'm not quite sure what to do now. Can anyone help me out?

Video feed - FPV view - UI Widget

When using the UI library FPV widget - there is no video feed The screen is blank. The FPV widget works just fine without using the Android bridge app.
As an update, I'm working on a project to analyze the video feed. It would be very helpful to have the bridge work with the video feed. In this case I'm using the texture view/surface view and not the FPV widget to display the video.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.