forked from CubePilot/qgroundcontrol-herelink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAndroidInterface.cc
29 lines (26 loc) · 1.16 KB
/
AndroidInterface.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/****************************************************************************
*
* Copyright (C) 2018 Pinecone Inc. All rights reserved.
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include <QtAndroidExtras/QtAndroidExtras>
#include <QtAndroidExtras/QAndroidJniObject>
#include "QGCApplication.h"
#include "AndroidInterface.h"
#include <QAndroidJniObject>
QString AndroidInterface::getSdcardPath()
{
QAndroidJniObject value = QAndroidJniObject::callStaticObjectMethod("org/mavlink/qgroundcontrol/QGCActivity", "getSdcardPath",
"()Ljava/lang/String;");
return value.toString();
}
void AndroidInterface::triggerMediaScannerScanFile(QString& file_path)
{
QAndroidJniObject path = QAndroidJniObject::fromString(file_path);
QAndroidJniObject::callStaticObjectMethod("org/mavlink/qgroundcontrol/QGCActivity", "triggerMediaScannerScanFile",
"(Ljava/lang/String;)V",
path.object<jstring>());
}