dji-mobile-sdk-tutorials / android-fpvdemo Goto Github PK
View Code? Open in Web Editor NEWThis demo shows how to create a simple FPV view and how to take photo and record video using DJI Mobile SDK.
License: MIT License
This demo shows how to create a simple FPV view and how to take photo and record video using DJI Mobile SDK.
License: MIT License
设备为 精灵4 Pro,目前 SDK 的拍照功能不能使用,调用 captureAction
时都是 "Not Support";回退到之前的 SDK 版本(4.2.1)也还是不能,是否是因为设备固件升级所导致的问题?
Since my Phantom 4 is currently grounded, I tried to test this demo with a local setup of a controller connected via Lightbridge 2 to an A3 controller, with a Zenmuse X3 gimbal camera. The list here - http://developer.dji.com/mobile-sdk/documentation/introduction/product_introduction.html#supported-products - says this setup is supported.
I do get a Register Success
message. However when I move to the next screen , I only see the 4 buttons and no video feed. Any ideas what could be going wrong? Or should I stick to using this with an able drone only?
Trying to run the FPVDemo on Samsung S7 virtual device (with API 28).
DJI SDK 4.8.1.
Tried on APIs 22, 28, 25
DJI Mavic AIR
Samsung S7
Android Studio 3.2.1
App configuration:
compileSdkVersion 26
buildToolsVersion '28.0.3'
...
minSdkVersion 19
targetSdkVersion 26
Error:
I/zygote: Background concurrent copying GC freed 53(37KB) AllocSpace objects, 0(0B) LOS objects, 46% free, 6MB/12MB, paused 40.461ms total 62.732ms
V/sdk: DexInstall end
I/InstantRun: starting instant run server: is main process
E/linker: "/data/app/com.dji.FPVDemo-cadEFrFcw-riA0rfxKrxAA==/lib/x86/libffmpeg.so" has text relocations
W/System.err: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.dji.FPVDemo-cadEFrFcw-riA0rfxKrxAA==/lib/x86/libffmpeg.so" has text relocations
W/System.err: at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1657)
at dji.midware.natives.SDKRelativeJNI.<clinit>(Unknown Source:2)
at dji.midware.natives.SDKRelativeJNI.native_getXXXX(Native Method)
at com.dji.g.a.a.c.b(Unknown Source:22)
at dji.midware.d.b(Unknown Source:2)
at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source:2)
at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)
at com.dji.FPVDemo.FPVDemoApplication.onCreate(FPVDemoApplication.java:150)
at com.dji.FPVDemo.MApplication.onCreate(MApplication.java:25)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5791)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)
at android.os.Handler.dispatchMessage(Handler.java:105)
W/System.err: at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
D/SDKRelativeJNI: Couldn't load lib
E/zygote: No implementation found for byte[] dji.midware.natives.SDKRelativeJNI.native_getXXXX(java.lang.String) (tried Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX and Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX__Ljava_lang_String_2)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.dji.FPVDemo, PID: 12282
java.lang.UnsatisfiedLinkError: No implementation found for byte[] dji.midware.natives.SDKRelativeJNI.native_getXXXX(java.lang.String) (tried Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX and Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX__Ljava_lang_String_2)
at dji.midware.natives.SDKRelativeJNI.native_getXXXX(Native Method)
at com.dji.g.a.a.c.b(Unknown Source:22)
at dji.midware.d.b(Unknown Source:2)
at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source:2)
at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)
at com.dji.FPVDemo.FPVDemoApplication.onCreate(FPVDemoApplication.java:150)
at com.dji.FPVDemo.MApplication.onCreate(MApplication.java:25)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5791)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
I/Process: Sending signal. PID: 12282 SIG: 9
Disconnected from the target VM, address: 'localhost:8677', transport: 'socket'
Tried to rerun with sdk 22 as some answer suggested, without any luck (Too many errors with the project)
I would appreciate help.
Thanks.
比如我想使传回的视频流的分辨率为320x320,应如何实现
Hi,
I am trying to apply this tutorial with a Matrice 210.
The RC well connects to the UAV, but on the view of the activity ConnectionActivity
, no video is showing. After debugging, I noticed that the function FPVDemoApplication.getCameraInstance()
returns null
. It means that the method getCamera()
called on mProduct
in the class FPVDemoApplication
returns null
.
I don't understand why, and I therefore hope that you could help me.
Thanks for your help,
Gabriel
when I run the demo,why there is a problem in application? says that:
Error:(48, 115) 错误: <匿名com.example.myapp.FPVTutorialApplication$1>不是抽象的, 并且未覆盖DJISDKManagerCallback中的抽象方法onGetRegisteredResult(DJIError)
Can you explain it?
Attempting to compile and install this repo, we get:
db: failed to install ~/Android-FPVDemo/FPVDemo/app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY: Package couldn't be installed in /data/app/com.dji.FPVDemo-MK44tKyMCcOJymktlTpfvQ==: Package com.dji.FPVDemo requires unavailable shared library com.android.future.usb.accessory; failing!]
We removed the Manifest declaration requiring this capability, but then the app doesn't connect to the RC. We are running on Android 9. Any tips to make this work?
Think 4.11.1 fixed the problem. Need to change to 4.11.1 not 4.11
手机root和关闭selinux权限,运行demo,闪退
Demo not working
Description of the issue.
Steps to reproduce the bug or crash issues(It would be great if you can provide this)
No crash
Crash logs (If you can find it, it would be very helpful)
No logs
DJI Android SDK version you are using (Like Android SDK 3.4, etc)
4.9
DJI Product you are using (Like Phantom 4, Mavic Pro, etc)
Mavic Pro
Android system version you are using (Like Android 6.0.1, Android 5.1.1, etc)
Android 8.1
Android device you are using (Like Samsung Galaxy Note 5, Nexus 5, etc)
Nexus 6P
Android Studio version you are using (Like Android Studio 2.2, etc)
3.4
I cloned the demo in here. I renamed the package so that it matches my registered Application. I provided the proper SDK key. The key was accepted, registration successful upon start of application.
The Android phone is connected via USB with the RC. The drone is on and connected with the RC. The app shows "Status: No product connected". The "OPEN" button is greyed out. Whenever I connect the RC via USB with the phone an new instance of the app is loaded.
What am I doing wrong here? What am I supposed to do right?
Why I can't play it in my Android Studio? How can I install it in my phone?Thank you!
Hi, the app say me only RC connected
Hi, i'm deploying an app to view and broadcast the thermal image of this aircraft. I seen the example of XT2 Camera in Android but, the operation of the Mavic 2 Enterprise camera and the way to work with it is similar?
How I can change these images and access to thermal image's callback to send and show it?
Best regards !
The app does not seem to work completely with Phantom 3 Standard. While I am able to see through the drones camera all other functionality of the app seems to be lost. I.e. capture and video mode do not save to the drone's SD card and instead of saying the model of drone connected it says disconnected (it also puts up two toast messages that say disconnected upon opening the app). Lastly, if you open the app connected to the controller's wi-fi it will say that the SDK registration failed.
More generally I was curious if DJI or anyone have put out tutorials specifically on coding for drones where you have only a wi-fi connection to the controller. Alternatively is it possible to somehow hardwire the phone into the phantom 3 standard controller.
Any help is greatly appreciated.
Hello,
I'm getting the following errors when I try to run the FPVDemo.
03-04 17:45:16.946 26645-26645/com.sandiego.dmaidana.dji_camera_demo E/com.sandiego.dmaidana.dji_camera_demo.CameraActivity﹕ onResume
03-04 17:45:17.056 26645-26645/com.sandiego.dmaidana.dji_camera_demo E/com.sandiego.dmaidana.dji_camera_demo.CameraActivity﹕ onSurfaceTextureAvailable
03-04 17:45:17.056 26645-26645/com.sandiego.dmaidana.dji_camera_demo E/com.sandiego.dmaidana.dji_camera_demo.CameraActivity﹕ mCodecManager is null 2
03-04 17:45:17.066 26645-26672/com.sandiego.dmaidana.dji_camera_demo E/AndroidRuntime﹕ FATAL EXCEPTION: Thread-1924
Process: com.sandiego.dmaidana.dji_camera_demo, PID: 26645
java.lang.NullPointerException
at a.a.b.d.f.a(Unknown Source)
at dji.midware.data.manager.P3.g.run(Unknown Source)
at java.lang.Thread.run(Thread.java:841)
03-04 17:45:17.086 994-1152/? E/InputDispatcher﹕ channel '42c6d4a0 com.sandiego.dmaidana.dji_camera_demo/com.sandiego.dmaidana.dji_camera_demo.CameraActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
Maybe you can help me here.
Thank you
Hello, I am writing to ask you about the reference system of the thermal camera of the Mavic 2 Dual Enterprise.
I'm looking at your documentation and I can't find anything about it. The system you use is as follows? Where the ranges of the X and Y axes are [0-1].
Thanks in advance and best regards !
run demo code, can't connect to remote control.
m100,firmware:v1.5.8
the app-key is correct and pass the sdk validation.
Does compatibility problems with the UXSDK elements exists?
After app deployment using our api key, the app starts and connects to the mavic 2.
The live video feed works, but when trying to record a video or take a capture, the error
`"dji error camera is busy or the command is not supported in the current state"
gets thrown.
Is there a workaround, which allows image capture during live video stream for the mavic 2?
I imported the project, everything was working properly, but suddenly the preview stopped to update, since onSurfaceTextureDestroyed() called with no reason. I use M100 with manifold in the middle which. I run ./test -t on the manifold.
Hi,
I am unable to get this working with the N1 Video Encoder. Has anyone got that working or is that just for the Go App?
Cheers,
Andrew
Hey,
I need to implement autofocus fo my video app. I use this: camera.getCamera().setFocusMode(SettingsDefinitions.FocusMode.AUTO, null);
where exactly, or at what moment I need to include it.
I tried but my app is crashed after this...
Please help me
Running of this application saves images/videos into a drone's SD card.
How to save them in an android phone directly
new Thread(){
public void run(){
try{
DJIDrone.checkPermission(getApplicationContext(), new DJIGerneralListener(){
@Override
public void onGetPermissionResult(int result){
if(result == 0) {
// show success
Log.e(TAG, "onGetPermissionResult ="+result);
Log.e(TAG,
"onGetPermissionResultDescription="+DJIError.getCheckPermissionErrorDescription(result));
} else {
// show errors
Log.e(TAG, "onGetPermissionResult ="+result);
Log.e(TAG,
"onGetPermissionResultDescription="+DJIError.getCheckPermissionErrorDescription(result));
}
}
});
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}.start();
I find typo of sample code at Readme.md
new DJIGerneralListener() is new DJIGeneralListener().
There is no getProductInstance() and getCameraInstance() defined in MainActivity.Java.
So one will need to add below in Mainactivity.java:
public static synchronized DJIBaseProduct getProductInstance() {
if (null == mProduct) {
mProduct = DJISDKManager.getInstance().getDJIProduct();
}
return mProduct;
}
public DJICamera getCameraInstance() {
return (DJICamera)this.mComponentMap.get(DJIBaseProduct.DJIComponentKey.Camera);
}
PS: Please let me know, if I am wrong anywhere :)
Hi,
There is some simple way to decode the received H264 raw image to display it in OpenCV, without using DJI decoder?
Thanks in advance.
I saw that there is a DJIAoaControllerActivity but it has no references in the github. There is no java.class with such name.
Best Reggards
Yes
Hi, I am using the DJI OSMO+ gimbal for developing an Android Camera application and I noticed that there is a huge difference in CPU usage when using the official DJI Go app (CPU Usage ~10% to 15%) from the Android PlayStore vs. DJI FPV Demo app (CPU Usage ~40% to 50%). Here are some details re my development environment:
DJI FPV Demo:
6044 u0_a125 16 -4 51% S 151 1597524K 154936K ta com.dji.FPVDemo
6044 u0_a125 16 -4 40% S 154 1601524K 156208K ta com.dji.FPVDemo
6044 u0_a125 16 -4 43% S 157 1604996K 155932K ta com.dji.FPVDemo
6044 u0_a125 16 -4 43% S 159 1607068K 155640K ta com.dji.FPVDemo
6044 u0_a125 16 -4 49% R 163 1611676K 156136K ta com.dji.FPVDemo
6044 u0_a125 16 -4 44% S 166 1614516K 155000K ta com.dji.FPVDemo
6044 u0_a125 16 -4 43% S 167 1616440K 156840K ta com.dji.FPVDemo
6044 u0_a125 16 -4 40% S 170 1619948K 156568K ta com.dji.FPVDemo
6044 u0_a125 16 -4 43% S 173 1623292K 156680K ta com.dji.FPV
DemoDJI Go:
4009 u0_a158 16 -4 13% S 139 2261940K 223852K ta dji.pilot
4009 u0_a158 16 -4 13% S 136 2258952K 226304K ta dji.pilot
4009 u0_a158 16 -4 14% S 131 2253212K 227052K ta dji.pilot
4009 u0_a158 16 -4 14% S 130 2252356K 226992K ta dji.pilot
4009 u0_a158 16 -4 13% S 131 2253640K 223644K ta dji.pilot
4009 u0_a158 16 -4 14% S 128 2250664K 225868K ta dji.pilot
4009 u0_a158 16 -4 13% S 129 2251020K 226740K ta dji.pilot
Note that CPU usage stays ~30% even on the ConnectionActivity (i.e. before even starting the video decoding in the MainActivity). Seems like a whole lot of junk on my device hogging the CPU for no reason...
Questions: - Does anyone know what could be the reason behind this huge CPU usage difference? - Please advice on how I can reduce the CPU usage when using the DJI FPV Demo app; kindly share code snippet or update Github with sample code.
Thanks!
Hi, I am a graphic designer, I want to help others in graphic design.
After I reviewed your project, you have no logo on this project. Therefore I want to contribute to this project by creating a new logo / icon. what do you think?
Hi, I am a graphic designer, I want to help others in graphic design.
After I reviewed your project, you have no logo on this project. Therefore I want to contribute to this project by creating a new logo / icon. what do you think?
and I used the FPVDemo for development my own app,but where filesystem path in my device can get the photo? and can I setting the photo path ?
Yep, then please delete this template and provide the following infos for us to help investigate the issue:
mavic 2 , 运行官方 FPVDemo ,切换拍照模式 ,或者录制模式都成功,但是点击拍照,或者开始录制,都会提示 Camera is busy or the command is not supported in the Camera's current state,请问什么原因
I have a question about Dji mobile on Android System.
I used a Android device and run Dji go ,then set open EXT port and App-output-mode from LB to EXT ,The device can display video.
However when I run the FPVDemo ( download from the GitHub DJI-SDK ) by Android Studio ,it dosen’t work, I can not see anything from the preview.
First, I can make sure that the app is register success and jump to the MainActivity.class,
Second, the CameraReceivedVideoDataCallback has no data callback;
Third, the environment like that.
Env:Huawei M3 + A3 + LightBridge 2 + 禅思X5 + S900
What do I need to set in this demo to display the video ?
The video recording and image capturing doesn't work on phones that don't have SD cards.
Hello,
When exiting, I receive the following error:
Service has leaked IntentReceiver dji.internal.version.c@4309fc40 that was originally registered here. Are you missing a call to unregisterReceiver()?
It says that the IntentReceiver has been registered somewhere in "initParams", called by "DJISDKManager.initSDKManager()".
Could you tell me which IntentReceiver is registered by "initSDKManager()" and how to unregister it?
Thanks in advance!
Missing the following files
back_button_disable.png
back_button_normal.png
back_button_press.png
selector_back_button.xml
IN THE EXAMPLE FILE
You should mention in the README that the sdk is built with android level 22, because the project must also be built with android level 22. By default android studio creates a project using the latest built tools (at the moment it would be compileSdkVersion 23).
Also, the sample project android level is 23 so it won't run successfully.
Hi to all,
I'm developping an mobile application with DJI SDK in Android studio.
I use Fabric for report crash
I usually get crash reports of this kind:
Fatal Exception: net.sqlcipher.database.SQLiteException: attempt to write a readonly database at net.sqlcipher.database.SQLiteDatabase.native_rawExecSQL(Unknown Source) at net.sqlcipher.database.SQLiteDatabase.rawExecSQL(Unknown Source) at dji.midware.data.forbid.util.FlyforbidUtils.generateConfuMixDb(Unknown Source) at dji.midware.data.forbid.db.FlyfrbPolygonMainDbManager.getDb(Unknown Source) at dji.midware.data.forbid.db.FlyfrbBaseDbManager.deleteAll(Unknown Source) at dji.internal.geofeature.flyforbid.FlyfrbPolygonDataUpdateManager$1.onSuccess(Unknown Source) at dji.internal.geofeature.flyforbid.FlyfrbPolygonDataUpdateManager$1.onSuccess(Unknown Source) at dji.thirdparty.afinal.http.HttpHandler.onProgressUpdate(Unknown Source) at dji.thirdparty.afinal.core.AsyncTask$InternalHandler.handleMessage(Unknown Source) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6121) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Fatal Exception: java.lang.UnsatisfiedLinkError: No implementation found for void net.sqlcipher.database.SQLiteDatabase.dbopen(java.lang.String, int) (tried Java_net_sqlcipher_database_SQLiteDatabase_dbopen and Java_net_sqlcipher_database_SQLiteDatabase_dbopen__Ljava_lang_String_2I) at net.sqlcipher.database.SQLiteDatabase.dbopen(Unknown Source) at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal(Unknown Source) at net.sqlcipher.database.SQLiteDatabase.openDatabase(Unknown Source) at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(Unknown Source) at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(Unknown Source) at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(Unknown Source) at dji.thirdparty.afinal.FinalDb.generateDb(Unknown Source) at dji.thirdparty.afinal.FinalDb.(Unknown Source) at dji.thirdparty.afinal.FinalDb.getInstance(Unknown Source) at dji.thirdparty.afinal.FinalDb.create(Unknown Source) at dji.thirdparty.afinal.FinalDb.create(Unknown Source) at dji.midware.data.forbid.db.FlyforbidDbManager.getDb(Unknown Source) at dji.midware.data.forbid.db.FlyfrbBaseDbManager.(Unknown Source) at dji.midware.data.forbid.db.FlyforbidDbManager.(Unknown Source) at dji.midware.data.forbid.db.FlyforbidDbManager.init(Unknown Source) at dji.midware.data.forbid.DJIFlyForbidController.(Unknown Source) at dji.midware.data.forbid.DJIFlyForbidController.getInstance(Unknown Source) at dji.internal.geofeature.flyforbid.FlyforbidUpdateService.onCreate(Unknown Source) at android.app.ActivityThread.handleCreateService(ActivityThread.java:3192) at android.app.ActivityThread.-wrap5(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1568) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6121) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference at dji.midware.data.forbid.db.FlyfrbPolygonMainDbManager.getDb(Unknown Source) at dji.midware.data.forbid.db.FlyfrbBaseDbManager.findAll(Unknown Source) at dji.internal.geofeature.flyforbid.FlyfrbPolygonDataUpdateManager.(Unknown Source) at dji.internal.geofeature.flyforbid.FlyforbidUpdateService$1.run(Unknown Source) at java.lang.Thread.run(Thread.java:761)
I'm using the last version of dji sdk.
So how can i solve this problems ?
Hello, when I run the sample code and try to capture pictures. It will toast "arror at accessing sd card". I have checked permissions and it does have the rights to write and read external storage.
sometimes when i launch my app after check SDK.
it try to find my osmo camera, but sdk return me an unknow device (wifi connection)
I am trying to dynamically give a GPS coordinate to the FollowMeMission.
When I called startSimpleFollowMe its giving me an error "The aircraft is not in the air.".
Here are the two methods which I used for a
public void updateSimpleFollowMe(){
if(fmmo == null){
fmmo = MissionControl.getInstance().getFollowMeMissionOperator();
}
final FollowMeMissionOperator followMeMissionOperator = fmmo;
if(followMeMissionOperator.getCurrentState().equals(FollowMeMissionState.EXECUTING)) {
followMeMissionOperator.updateFollowingTarget(new LocationCoordinate2D(homeLatitude + 100 * GeneralUtils.ONE_METER_OFFSET, homeLongitude),
new CommonCallbacks.CompletionCallback() {
@OverRide
public void onResult(DJIError error) {
if (error != null) {
setRunningResultToText(followMeMissionOperator.getCurrentState().getName().toString() + " " + error.getDescription());
} else {
setRunningResultToText("Mission Update Successfully");
}
}
});
}
}
public void startSimpleFollowMe(){
if(fmmo == null){
fmmo = MissionControl.getInstance().getFollowMeMissionOperator();
}
final FollowMeMissionOperator followMeMissionOperator = fmmo;
if (followMeMissionOperator.getCurrentState().equals(FollowMeMissionState.READY_TO_EXECUTE)){
fmm = FollowMeMission.getInstance().initUserData(homeLatitude, homeLongitude,15);
followMeMissionOperator.startMission(fmm, new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError djiError) {
if(djiError != null){
setRunningResultToText(djiError.getDescription());
} else {
setRunningResultToText("Mission Start: Successfully");
}
}
});
}
}
Not a but, just a question: I played a bit with the DJIVideoStreamDecoding example. I noticed, that whenever yuv decoding is switched on
mCodecManager.enabledYuvData(true);
mCodecManager.setYuvDataCallback(this);
neither of the views (texture, surface) is updated anymore.
This observation is backed up by this series of traces after the switch above:
D/SurfaceUtils: disconnecting from surface 0x7d6e1a6010, reason disconnectFromSurface
D/DJIDecodeServer: releaseDecoder() end
E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
E/GLContextMgr17: OpenGL destoryed
E/GLYUVSurface: OpenGL destoryed
E/Lightbridge: startStream videoCtlobjet == NULL
D/DJIVideoDecoder: stopVideoDecoder()
Does that mean I can't video preview and yuv decode at the same time? Then I'm wondering, how I could flight if I just want to obtain the video for post processing purposes.
I want to receive the YUV data and do something with it. Then I followed the document and wrote such code:
mCodecManager.enabledYuvData(true);
mCodecManager.setYuvDataCallback(this);
while the MainAcitivity implements DJICodecManager.YuvDataCallback, and when clicking a button the code above would be executed.
But now as long as I click the button, the preview of the TextureView will be stuck. Even if I commented the code mCodecManager.setYuvDataCallback(this)
, the code mCodecManager.enabledYuvData(true)
would still make the preview stuck when I click the button.
So how to deal with the problem and receive the YUV data correctly?
My devices' information:
UAV: Phantom 4 Pro
DJI SDK version: 4.5.1
Android System version: 7.0
AS version: 3.1
Hi,
I am new to Android Studio and Github. I tried to build the Camera Application of the DJI SDK 4.1.1 by using Android Studio 1.5 then with Android Studio 2.2, both without success.
First I wanted to confirm that my android device is compatible with the Phantom 4 Pro.
I downloaded the DJI Go 4 application and started it, input my email and password used in my dji account.
It works fine with the Phantom 4 Pro with the following devices: Zenpad 8.0 (Android 6.0.1) tablet, Galaxy Note 10.1 (2014 edition) running Android 4.4.2.
The PH4P is detected once the RC is turned on then I can enter the camera view and the video streaming starts once I turn the PH4P ON.
However, it didn't work on Galaxy S6 Edge (Android 7.0).
Using the Zenpad 8.0, I tried the 2 following methods:
Method 1:
By downloading the project from Github at: https://github.com/DJI-Mobile-SDK-Tutorials/Android-FPVDemo
I signed in and clicked "Clone or download" button, then "Download Zip".
I unzipped the archive and imported it in Android Studio. 2 messages appeared:
What am I missing here ?
Method 2
By following step by step the FPVDemo tutorial available at:
https://developer.dji.com/mobile-sdk/documentation/android-tutorials/index.html
I requested a DJI Key and inserted it in the manifest.xml file.
When I compile the application from android, the connection activity starts on my tablet.
Then I unplug the tablet from the PC and while the remote controller is OFF I connect the tablet to the remote controller, and turn the RC power ON.
I select the FPVDemo to access the USB. There is a "Register Success" toast message showing up, but nothing happens and the connection activity is not displayed.
From the previous SDK, I checked the following points:
I could track the issue to DJISDKManager.getInstance().startConnectionToProduct(); in FPVDemoApplication.java returning false, but I couldn't get further information regarding the cause.
Thanks for your help!
In the Android's Integrate SDK into Application tutorial, use are using the following sentence in manifest.xml file<service android:name="dji.sdk.sdkmanager.DJIGlobalService" >
Adding this line causing to the following error -
'dji.sdk.sdkmanager.DJIGlobalService' is not assignable to 'android.app.Service' less... (⌘F1)
Inspection info: Validates resource references inside Android XML files.
I am using:
> compileSdkVersion 28
> minSdkVersion 19
> targetSdkVersion 28 gz#25311
I cloned the repository and tried to run the app on my phone. The App instantly crashes.
The app crashes when
Phone: Samsung Galaxy S22 Ultra
Android: Android 13
Android Studio: Android Studio Dolphin | 2021.3.1 Patch 1 | Runtime version: 11.0.13+0-b1751.21-8125866 amd64
Drone: DJI Phantom 4 Pro V2
Logcat output:
---------------------------- PROCESS STARTED (15899) for package com.dji.FPVDemo ----------------------------
2023-01-18 11:08:24.818 15899-15899 nativeloader com.dji.FPVDemo D Configuring classloader-namespace for other apk /data/app/~~87ADPMzJhgZo_C6hP3qVbg==/com.dji.FPVDemo-p1u6VklFTAgKx13O_Ei8Ww==/base.apk. target_sdk_version=30, uses_libraries=, library_path=/data/app/~~87ADPMzJhgZo_C6hP3qVbg==/com.dji.FPVDemo-p1u6VklFTAgKx13O_Ei8Ww==/lib/arm64:/data/app/~~87ADPMzJhgZo_C6hP3qVbg==/com.dji.FPVDemo-p1u6VklFTAgKx13O_Ei8Ww==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.dji.FPVDemo
2023-01-18 11:08:24.818 15899-15899 nativeloader com.dji.FPVDemo D Extending system_exposed_libraries: libhumantracking.arcsoft.so:libPortraitDistortionCorrection.arcsoft.so:libPortraitDistortionCorrectionCali.arcsoft.so:libface_landmark.arcsoft.so:libFacialStickerEngine.arcsoft.so:libveengine.arcsoft.so:lib_pet_detection.arcsoft.so:libae_bracket_hdr.arcsoft.so:libhigh_res.arcsoft.so:libhybrid_high_dynamic_range.arcsoft.so:libimage_enhancement.arcsoft.so:liblow_light_hdr.arcsoft.so:libhigh_dynamic_range.arcsoft.so:libsuperresolution_raw.arcsoft.so:libuwsuperresolution.arcsoft.so:libFacialAttributeDetection.arcsoft.so:libBeauty_v4.camera.samsung.so:libexifa.camera.samsung.so:libjpega.camera.samsung.so:libOpenCv.camera.samsung.so:libVideoClassifier.camera.samsung.so:libtensorflowLite.dynamic_viewing.camera.samsung.so:libImageScreener.camera.samsung.so:libMyFilter.camera.samsung.so:libtflite2.myfilters.camera.samsung.so:libCandidSnapJNI.camera.samsung.so:libHIDTSnapJNI.camera.samsung.so:libSmartScan.camera.samsung.so:libRectify.camera.samsung.so:libDocRectifyWrapper.camera.sam
2023-01-18 11:08:24.826 15899-15899 GraphicsEnvironment com.dji.FPVDemo V ANGLE Developer option for 'com.dji.FPVDemo' set to: 'default'
2023-01-18 11:08:24.826 15899-15899 GraphicsEnvironment com.dji.FPVDemo V ANGLE GameManagerService for com.dji.FPVDemo: false
2023-01-18 11:08:24.826 15899-15899 GraphicsEnvironment com.dji.FPVDemo V App is not on the allowlist for updatable production driver.
2023-01-18 11:08:24.828 15899-15899 NetworkSecurityConfig com.dji.FPVDemo D No Network Security Config specified, using platform default
2023-01-18 11:08:24.833 15899-15899 NetworkSecurityConfig com.dji.FPVDemo D No Network Security Config specified, using platform default
2023-01-18 11:08:24.864 15899-15899 com.dji.FPVDemo com.dji.FPVDemo W Accessing hidden field Ldalvik/system/BaseDexClassLoader;->pathList:Ldalvik/system/DexPathList; (unsupported, reflection, allowed)
2023-01-18 11:08:24.904 15899-15899 com.dji.FPVDemo com.dji.FPVDemo W Accessing hidden field Ldalvik/system/DexPathList;->dexElements:[Ldalvik/system/DexPathList$Element; (unsupported, reflection, allowed)
2023-01-18 11:08:24.933 15899-15899 AndroidRuntime com.dji.FPVDemo D Shutting down VM
2023-01-18 11:08:24.933 15899-15899 AndroidRuntime com.dji.FPVDemo E FATAL EXCEPTION: main
Process: com.dji.FPVDemo, PID: 15899
java.lang.RuntimeException: Unable to create application com.dji.FPVDemo.MApplication: java.lang.NullPointerException
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7603)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2397)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8741)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by: java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:461)
at android.graphics.Typeface.setFlipFonts(Typeface.java:1823)
at android.app.Application.onCreate(Application.java:275)
at com.dji.FPVDemo.MApplication.onCreate(:23)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1266)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7598)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2397)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8741)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
2023-01-18 11:08:24.949 15899-15899 Process com.dji.FPVDemo I Sending signal. PID: 15899 SIG: 9
---------------------------- PROCESS ENDED (15899) for package com.dji.FPVDemo ----------------------------
I also had this problem when following your tutorial for the UXSDK Demo and creating the App from scratch.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.