Print Page | Close Window

FMX Cloud Pack don't works on SDK >= 26?

Printed From: TMS Software
Category: FMX Components
Forum Name: FMX Cloud Pack
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=12975
Printed Date: 23 Oct 2019 at 12:01am


Topic: FMX Cloud Pack don't works on SDK >= 26?
Posted By: Schröder Heiko
Subject: FMX Cloud Pack don't works on SDK >= 26?
Date Posted: 05 Feb 2019 at 4:46pm
Hello,

could you update your demo apps please, because it seems some of them are not working under SDK>=26 (new requirement to update apps in Google Play Store!)

My problem: my Android app uses FMX Cloud Pack since some years. But now if I compile my app in RAD Studio 10.3 Rio and want to connect to the Cloud services Dropbox and GDrive for SDK>26 I will get the error: "EJNIException with message android.os.NetworkOnMainThreadException".
SdkVersion is the following: <uses-sdk android:minSdkVersion="20" android:targetSdkVersion="28" /> 

I ckeched the same source code in RAD Studio 10.1 with the current version of the FMX Cloud Pack but another SdKVersion and it works!
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14" /> 

That's why I thought I can check your CloudStorageDemo, but it seems it isn't SDK>=26 compatible.

In UCloudStorageDemo you have to use another user folder, otherwise you will get an error.
Or you have to implement the new restriction access with the FileProvider to get acces to another folders!

  {$IFDEF MOBILE}
//  fn := TPath.GetSharedDocumentsPath + PathDelim;
  fn := System.SysUtils.IncludeTrailingPathDelimiter(System.IOUtils.TPath.GetHomepath);
  {$ELSE}
  fn := ExtractFilePath(Paramstr(0));
  {$ENDIF}
In your StorageDemo if I try to connect to Dropbox or Google Drive I will get the error "Java Class JCustomTabsIntent_Builder not found" on line 222 in FMX.TMSCloudBaseFMX.pas

Could you give me an answer if you know about the problems and you will work on it to fix it?


Best regards



Replies:
Posted By: Bart Holvoet
Date Posted: 05 Feb 2019 at 4:58pm
Hi,

Thank you for notifying us.
We are currently investigating this issue and will report back as soon as possible.


Posted By: Bart Holvoet
Date Posted: 07 Feb 2019 at 9:56am
- We haven't been able to reproduce the NetworkOnMainThreadException.
Can you please provide the following information so I can further investigate this?
Does the issue also occur in the demo or only in your own application?
Which version of Android are you using?

- The GetSharedDocumentsPath has been replaced in the demo.
The update will be available with the next release of TMS FMX Cloud Pack.

- To avoid the "JCustomTabsIntent_Builder" error, please follow instructions on this page:  https://www.tmssoftware.com/site/externalbrowser.asp - https://www.tmssoftware.com/site/externalbrowser.asp


Posted By: Schröder Heiko
Date Posted: 07 Feb 2019 at 6:47pm
Hello,

thanks for the response. The NetworkOnMainThreadException is in my application on Android 9.
It looks for  a special folder on GDrive.

I can test it tomorrow on Android 6.0.1 with the current version of FMXCloud Pack.


Posted By: Schröder Heiko
Date Posted: 13 Feb 2019 at 3:21pm
Hello,

I was able to solve the error: "EJNIException with message android.os.NetworkOnMainThreadException".

It was a thread issue in my app. 

In SDK<26 the usage of TMS Cloud Pack function like "TMSGoogleDrive.SearchFolder()" in TThread.Synchronize() is possible, Later on Android it isn't no more possible and I have to do such function calls in TThread.CreateAnonymousThread();






Print Page | Close Window