Load Mission Fails in Android using DJI 4.5.1 - android

I am using the latest version of DJI which is 4.5.1 and using WaypointMissionOperator for loading the mission, still I am getting the same error while trying to load mission. Can anyone help me in resolving this?

Some additional information would be helpful. A little code snippet would help or some additional detail like how many points, etc?
Can you describe your data flow, aka, what calls and in what order? Is the mission failing to load and is there any detail in the error return?
final DJIError djiError = missionOperator.loadMission(mission);
if (djiError != null) {
Log.d("TEST", djiError.getDescription()));
}

Related

Unable to make Ar with flutter (unable to detect arcore android 11)

I have issus making Ar with flutter and i'm running out of ideas.
I tried this package : https://pub.dev/packages/ar_flutter_plugin the problem i have :
https://github.com/CariusLars/ar_flutter_plugin/issues/72
https://github.com/CariusLars/ar_flutter_plugin/issues/82
The only "workable" thing i have is this plugin using webobjects but its not rendering fine.
if (this.webObjectNode != null) {
this.arObjectManager!.removeNode(this.webObjectNode!);
this.webObjectNode = null;
} else {
var newNode = ARNode(
type: NodeType.webGLB,
uri:
"https://github.com/KhronosGroup/glTF-Sample-Models/raw/master/2.0/Duck/glTF-Binary/Duck.glb",
scale: Vector3(0.2, 0.2, 0.2));
bool? didAddWebNode = await this.arObjectManager!.addNode(newNode);
this.webObjectNode = (didAddWebNode!) ? newNode : null;
}
}
Then i used another plugin : https://pub.dev/packages/arcore_flutter_plugin
on this one i have another kind of problem : arcore (playsore app) is not detected :
https://github.com/giandifra/arcore_flutter_plugin/issues/204
Even the sample code that i downloaded on github does not detect arcore. i've followed documentation of arcore :
https://developers.google.com/ar/develop/java/enable-arcore?hl=fr
Then i tried to fix it by this way :
https://stackoverflow.com/questions/64939892/google-play-services-for-ar-requires-latest-version-error#:~:text=You%20have%20not%20updated%20the,hot%20or%20has%20memory%20problems.
You can see arcore issue here :
Google Play AR requires latest version error
I downloaded pokemon go on my phone and thoses pokemon are rendering fine, thats mean arcore works ? isnt it ? And that mean there is a way to do what i want.
But now i'm runing out of ideas except change job and go working in a Zoo.
Thanks for reading :)

Reading Texts Kotlin - Android SDK 29

I'm relatively new to Android Dev and I'm running Android Studio on SDK 29 for a project to read through messages, find Roster text messages for where I work and then import them into the Google Calander via API. I've had a small amount of experience with Android before so the text and onClick etc are fine (Although I used java in the past, trying kotlin as it's the future). However I'm trying to play around with reading the body of all messages and just printing them to the screen so I can understand how it works, tweak things here and there and see the results I get. However just getting the body of messages and printing them is turning out to be quite difficult.
I had issues initially however they were to do with permissions not working correctly. From there I fixed that issue and got some working code with no errors however instead of getting an output of the body of the messages I got a random '12'. So after further researching and googling I've managed to get myself to what I think is a close lot of code however, it's just incomplete and I'm unable to see what errors there may be as I haven't found a working lot of code online yet.
Furthermore the android dev documentation hasn't been a huge help. So I'm reaching out. Sorry if this seems a easy fix however it's new to me and I havent' found anything online after a fair bit of searching.
Thanks in advance
This is my code so far:
var cr = contentResolver.query(
Uri.parse("content://sms/inbox"),
null,
null,
null,
null
)
if(cr.moveToFirst()){
do {
var msgData = ""
for(messages in cr.getColumnIndex("body")) {
lastSyncMessage.text =
lastSyncMessage.text.toString() + " " + msgData.toString()
}
}while(cr.moveToNext())
}
}```
Try the next code, the for loop is not correct:
if(cr!= null && cr.moveToFirst()){
do {
lastSyncMessage.text =cr.getString(cr.getColumnIndex("body"))
}while(cr.moveToNext())
}
This code will set the last sms body message as the lastSyncMessage text. Just play with this.

Titanium Hyperloop access to android.os.SystemProperties

I have been trying a ( i hope) simple bit of Android hyperloop code directly within a titanium project (using SDK 7.0.1.GA and hyperloop 3).
var sysProp = require('android.os.SystemProperties');
var serialNumber = sysProp.get("sys.serialnumber", "none");
But when the app is run it reports
Requested module not found:android.os.SystemProperties
I think this maybe due to the fact that when compiling the app (using the cli) it reports
hyperloop:generateSources: Skipping Hyperloop wrapper generation, no usage found ...
I have similar code in a jar and if I use this then it does work, so I am wondering why the hyperloop generation is not being triggered, as I assume that is the issue.
Sorry should have explained better.
This is the jar source that I use, the extraction of the serial number was just an example (I need access to other info manufacturer specific data as well), I wanted to see if I could replicate the JAR functionality using just hyperloop rather that including the JAR file. Guess if it's not broke don't fix it, but was curious to see if it could be done.
So with the feedback from #miga and a bit of trial and error, I have come up with a solution that works really well and will do the method reflection that is required. My new Hyperloop function is
function getData(data){
var result = false;
var Class = require("java.lang.Class");
var String = require("java.lang.String");
var c = Class.forName("android.os.SystemProperties");
var get = c.getMethod("get", String.class, String.class);
result = get.invoke(c, data, "Error");
return result;
}
Where data is a string of the system property I want.
I am using it to extract and match a serial number from a Samsung device that is a System Property call "ril.serialnumber" or "sys.serialnumber". Now I can use the above function to do what I was using the JAR file for. Just thought I'd share in case anyone else needed something similar.
It is because android.os.SystemProperties is not class you can import. Check the android documentation at https://developer.android.com/reference/android/os/package-summary.html
You could use
var build = require('android.os.Build');
console.log(build.SERIAL);
to access the serial number.

error with pymtp to work on python 3

I want to access a android device from python to download some photos.
libmtp works from the CLI.
Than pymtp. It's been around for a while but it's designed for python 2 and i'm using python 3. Meanwhile fixed several minor issues but i'm stuck at an error from function get_filelisting
specially this section:
ret = []
next = files
while next:
ret.append(next.contents)
if (next(next.contents) is None):
break
next = next(next.contents)
The error is related to the "next".
That section looks strange to me, i've been coding in python for a while but i'm new to ctypes. Tried a lot of variants, they all failed. The "next" could be confusing with python buildin function so i renamed it to nextpointer and came to this code:
ret = []
nextpointer = files
while nextpointer:
ret.append(nextpointer.contents)
nextpointer = nextpointer.contents.next
It seems to work but did it work by accident ? does it have any design flaws ? Could anyone with experience on python ctypes confirm this a solution ? Any suggestion welcome.
From python2.7 documentation
next(iterator[, default])
Retrieve the next item from the iterator by calling its next() method. If default is given, it is returned if the iterator is
exhausted, otherwise StopIteration is raised.
from python3 documentation
next(iterator[, default])
Retrieve the next item from the iterator by calling its __next__() method. If default is given, it is returned if the iterator is
exhausted, otherwise StopIteration is raised.
Notice that next() method was removed from python3 but the function still exists.
This is all I can say about the next function and .next()/__next__() methods.
I downloaded the pymtp module and get_filelisting() is slightly different from what you posted in your ported code, here it is:
ret = []
next = files
while next:
ret.append(next.contents)
if (next.contents.next == None):
break
next = next.contents.next
If none of this helped you (which probably didn't :D), the version of pymtp library that I am using is 0.0.6 download using pip.

Acessing Application Lifecycle Interface with AppMethod

I am using the new Embarcadero AppMethod 1.14 to do some development for Android Devices (in C++), but I cannot for the life of me figure out how to gain access to the lifecycle events (doPAuse, doResume, etc). If anyone has any how-to's links, tips or code they can share on this subject?
Here is the code I finally came up with:
TGUID guid = StringToGUID("{F3AAF11A-1678-4CC6-A5BF-721A24A676FD}"); // GUID for ApplicationEventService interface
IInterface *AEventSvc;
if (TPlatformServices::Current->SupportsPlatformService(guid)) {
AEventSvc = TPlatformServices::Current->GetPlatformService(guid);
IFMXApplicationEventService *EventSvc;
AEventSvc->QueryInterface(guid,(void**)(&EventSvc));
EventSvc->SetApplicationEventHandler(SysEventHandler);
EventSvc->Release();
}
Kudos out to Pawel Glowaki whose blog gave me the key details to getting this answer: http://blogs.embarcadero.com/pawelglowacki/2013/09/30/40067/

Categories

Resources