[英]How to connect to parse server backend from back4app.com for Qt android app
I am trying to develop an Android application with Qt 5.13
. 我正在尝试使用Qt 5.13
开发一个Android应用程序。 I am planning to use a parse-server for my backend. 我打算在后端使用解析服务器。 I am using a free plan from back4app . 我正在使用back4app的免费计划。 I followed the official tutorial here 我在这里关注了官方教程
But I am not sure how to import the android SDK into my Qt C++ code. 但是我不确定如何将android SDK导入我的Qt C ++代码。 ? ?
I added the below code to the gradle.build
file. 我将以下代码添加到gradle.build
文件中。
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation "com.github.parse-community.Parse-SDK-Android:parse:1.20.0"
}
repositories{
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
After this step, I am not sure where to put below code 完成此步骤后,我不确定将以下代码放在哪里
import com.parse.Parse;
I need to be able to run the below code in my C++ code. 我需要能够在我的C ++代码中运行以下代码。
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId("appId")
.clientKey("clientId")
.server("https://parseapi.back4app.com")
.build()
I tried to import in Qml code without luck. 我试图导入Qml代码而没有运气。
Based on the documentation you need to put the code into a .java
file. 根据文档,您需要将代码放入.java
文件。 For that I'd suggest to check the guide on QAndroidJniObject Class , as you'll need to do your base implementation in java
and using java native interface JNI
to call the code from C++
. 对于我建议去检查指导QAndroidJniObject类 ,因为你需要做你的基地实施java
和使用Java Native Interface JNI
调用从代码C++
。
Since you'll be needing https to access the server. 因为您将需要https访问服务器。 You will also need to include openSSL libs to your project, you can find the required libs and instructions here 您还需要在项目中包含openSSL库,您可以在此处找到所需的库和说明。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.