Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
androidjninfc.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 Centria research and development
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
include
"androidjninfc_p.h"
5
6
#
include
<
QCoreApplication
>
7
#
include
<
QtCore
/
qjnitypes
.
h
>
8
9
QT_BEGIN_NAMESPACE
10
11
namespace
QtNfc
{
12
13
bool
startDiscovery
()
14
{
15
return
QtJniTypes::QtNfc::callStaticMethod<jboolean>(
"startDiscovery"
);
16
}
17
18
bool
isEnabled
()
19
{
20
return
QtJniTypes::QtNfc::callStaticMethod<jboolean>(
"isEnabled"
);
21
}
22
23
bool
isSupported
()
24
{
25
return
QtJniTypes::QtNfc::callStaticMethod<jboolean>(
"isSupported"
);
26
}
27
28
bool
stopDiscovery
()
29
{
30
return
QtJniTypes::QtNfc::callStaticMethod<jboolean>(
"stopDiscovery"
);
31
}
32
33
QtJniTypes
::
Intent
getStartIntent
()
34
{
35
return
QtJniTypes::QtNfc::callStaticMethod<QtJniTypes::Intent>(
"getStartIntent"
);
36
}
37
38
QtJniTypes
::
Parcelable
getTag
(
const
QtJniTypes::Intent &intent)
39
{
40
return
QtJniTypes::QtNfc::callStaticMethod<QtJniTypes::Parcelable>(
"getTag"
, intent);
41
}
42
43
}
// namespace QtNfc
44
45
QT_END_NAMESPACE
46
47
extern
"C"
Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm,
void
*
/*reserved*/
)
48
{
49
static
bool
initialized =
false
;
50
if
(initialized)
51
return
JNI_VERSION_1_6;
52
initialized =
true
;
53
54
JNIEnv* env;
55
if
(vm->GetEnv(
reinterpret_cast
<
void
**>(&env), JNI_VERSION_1_6) != JNI_OK) {
56
return
-1;
57
}
58
59
const
auto
context = QNativeInterface::QAndroidApplication::context();
60
QtJniTypes::QtNfc::callStaticMethod<
void
>(
"setContext"
, context);
61
62
return
JNI_VERSION_1_6;
63
}
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtNfc
Definition
androidjninfc.cpp:11
QtNfc::stopDiscovery
bool stopDiscovery()
Definition
androidjninfc.cpp:28
QtNfc::getStartIntent
QtJniTypes::Intent getStartIntent()
Definition
androidjninfc.cpp:33
QtNfc::startDiscovery
bool startDiscovery()
Definition
androidjninfc.cpp:13
QtNfc::isEnabled
bool isEnabled()
Definition
androidjninfc.cpp:18
QtNfc::getTag
QtJniTypes::Parcelable getTag(const QtJniTypes::Intent &intent)
Definition
androidjninfc.cpp:38
QtNfc::isSupported
bool isSupported()
Definition
androidjninfc.cpp:23
qtconnectivity
src
nfc
android
androidjninfc.cpp
Generated on
for Qt by
1.18.0