Login and getting file from Google Drive or DropBox by using Qt/QML in Android and iOS
-
wrote on 10 Aug 2017, 09:23 last edited by zenghsing 8 Oct 2017, 09:35
I am developing app for Android and iOS by using QML/Qt 5.9.1. We want to login the Google Drive and download and upload some file. Of course, we must can select file from my App. Hence, I am trying to use the 3rd part library. Hence, my first thing is to find the sample code for login by using Qt. I follow the below line with two article.
http://blog.qt.io/blog/2017/01/25/connecting-qt-application-google-services-using-oauth-2-0/
I can get login page from browser when I process the QOAuth2AuthorizationCodeFlow part in my Qt code. I think it want to use REST to get message from Google's api as below link.
https://developers.google.com/drive/v3/web/about-sdk
I develop app for mobile phone but I must login Google Drive by using the "browser". I think it is weird. By the way, in the above link, there no other code for getting file list from Google Drive. I got stuck here.
Hence, I trying to study using the native code to implement this by using mobile api without web's api. The idea is to implement the whole thing in native code.
https://developers.google.com/drive/android/examples/
And using JNI or other method to passing message from the native code to Qt. But it seem pretty complex and I find I can't run the Google's sample code successfully in my red-mi note 4. I can't login Google Drive and I alway in the select account page on the sample code as below link.
https://github.com/googledrive/android-demos/issues/43
I am study how to use DropBox now. I can get workable sample code from below link.
https://bugreports.qt.io/browse/QTBUG-60400
I can login, upload, download and remove from the sample code. But the problem is it still using "browser" to login account. And I must copy the pin code and paste the pin code to my app for finished the OAuth. It is not friendly and it is hard to copy the pin code from my mobile phone. By the way, I must paste the pin code for login every time when I open the app.
Does it possible to login in my app without the "browser" by using REST?
Does it possible not re-paste the pin code to my app every time?
1/1