0

I am trying to develop an Android application with Qt 5.13. I am planning to use a parse-server for my backend. I am using a free plan from back4app. I followed the official tutorial here

But I am not sure how to import the android SDK into my Qt C++ code. ?

I added the below code to the gradle.build file.

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.

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.

Muneeb Ali
  • 472
  • 6
  • 14

1 Answers1

1

Based on the documentation you need to put the code into a .java file. 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++.

Since you'll be needing https to access the server. You will also need to include openSSL libs to your project, you can find the required libs and instructions here

Megued
  • 120
  • 9
  • Thank you.. I will update you once I am able to do this successfully. – Winston Rodrigues Aug 06 '19 at 05:11
  • Unfortunately I need to do this in Java files. So need to learn java. Sorry for delay. I was working in a different project for a while. Once I finish doing this I will post a link to my code. – Winston Rodrigues Aug 20 '19 at 12:34
  • Just make sure not to publish any private keys in your code. For java and Qt KDAB has some nice guides, so might be worth checking them out. – Megued Aug 20 '19 at 13:13