ElliotHC Active Member Licensed User Aug 10, 2019 #1 I have an app which is using SMB and FTP which needs to carry on what it's doing in the background. Is this a simple command? Thanks
I have an app which is using SMB and FTP which needs to carry on what it's doing in the background. Is this a simple command? Thanks
DonManfred Expert Licensed User Longtime User Aug 11, 2019 #21 ElliotHC said: It has to run in the background! Click to expand... Inform about long running tasks! There is a good example. Background Location Tracking. you are free to use a timer or whatever in the long runnign task. Upvote 0
ElliotHC said: It has to run in the background! Click to expand... Inform about long running tasks! There is a good example. Background Location Tracking. you are free to use a timer or whatever in the long runnign task.
ElliotHC Active Member Licensed User Aug 11, 2019 #22 Ok so simply this is what I'm trying to do. All of this is happening in the background every second... 1. List files in location on External SD card 2. Sort list (false) 3. FTP upload file at top of list if different from the last check. The problem is that I can't seem to get it to work in a service. Upvote 0
Ok so simply this is what I'm trying to do. All of this is happening in the background every second... 1. List files in location on External SD card 2. Sort list (false) 3. FTP upload file at top of list if different from the last check. The problem is that I can't seem to get it to work in a service.
ElliotHC Active Member Licensed User Aug 11, 2019 #23 DonManfred said: No, you can´t. The interactions are needed. The user must initially select the External SD. This can only be initiated from an Activity. Once you know the persistenturi you can store it and then use it to further interact with the SDCard. Click to expand... If I know the location, can't I just set that as the persistent Uri? Upvote 0
DonManfred said: No, you can´t. The interactions are needed. The user must initially select the External SD. This can only be initiated from an Activity. Once you know the persistenturi you can store it and then use it to further interact with the SDCard. Click to expand... If I know the location, can't I just set that as the persistent Uri?
DonManfred Expert Licensed User Longtime User Aug 11, 2019 #24 ElliotHC said: can't I just set that as the persistent Uri? Click to expand... No. ONLY after you let the use select the root folder first. You can not just use a "fictive" persistanUri without letting the user select it ONCE. Edit: You can for sure edit the class and just TRY to do that. But i fear it ends in an error as it is a requirement by Google. Last edited: Aug 11, 2019 Upvote 0
ElliotHC said: can't I just set that as the persistent Uri? Click to expand... No. ONLY after you let the use select the root folder first. You can not just use a "fictive" persistanUri without letting the user select it ONCE. Edit: You can for sure edit the class and just TRY to do that. But i fear it ends in an error as it is a requirement by Google.
Brandsum Well-Known Member Licensed User Aug 11, 2019 #25 There is an example for syncing files via ftp https://www.b4x.com/android/forum/threads/app-to-sync-photos-using-fileobserver-library.74712/ check it. Upvote 0
There is an example for syncing files via ftp https://www.b4x.com/android/forum/threads/app-to-sync-photos-using-fileobserver-library.74712/ check it.
ElliotHC Active Member Licensed User Aug 11, 2019 #26 Brandsum said: There is an example for syncing files via ftp https://www.b4x.com/android/forum/threads/app-to-sync-photos-using-fileobserver-library.74712/ check it. Click to expand... I am doing this no problem.. I really struggle with posting anything thing else my project does through fear of getting pointers to other projects. I'm doing the FTP stuff no problem. I can do that in the background no problem. The issue I seem to be having here is using the ExternalStorage Class as a service. Upvote 0
Brandsum said: There is an example for syncing files via ftp https://www.b4x.com/android/forum/threads/app-to-sync-photos-using-fileobserver-library.74712/ check it. Click to expand... I am doing this no problem.. I really struggle with posting anything thing else my project does through fear of getting pointers to other projects. I'm doing the FTP stuff no problem. I can do that in the background no problem. The issue I seem to be having here is using the ExternalStorage Class as a service.
DonManfred Expert Licensed User Longtime User Aug 11, 2019 #27 ElliotHC said: The issue I seem to be having here is using the ExternalStorage Class as a service. Click to expand... You can not use it "as a Service". It is a Class. You can "use it IN a Service". In the example attached it is in the Starter service. For the initialisation (letting the user select the root folder) it is initialized in Main activity too. This is only needed as long the user did not selected it. Note that i use a slightly edited Class here.... Attachments ExtStorage.zip ExtStorage.zip 12.7 KB · Views: 333 Upvote 0
ElliotHC said: The issue I seem to be having here is using the ExternalStorage Class as a service. Click to expand... You can not use it "as a Service". It is a Class. You can "use it IN a Service". In the example attached it is in the Starter service. For the initialisation (letting the user select the root folder) it is initialized in Main activity too. This is only needed as long the user did not selected it. Note that i use a slightly edited Class here....
Brandsum Well-Known Member Licensed User Aug 11, 2019 #28 DonManfred said: You can not use it "as a Service". It is a Class. You can "use it IN a Service". Click to expand... That is what he was having trouble understanding. Upvote 0
DonManfred said: You can not use it "as a Service". It is a Class. You can "use it IN a Service". Click to expand... That is what he was having trouble understanding.
DonManfred Expert Licensed User Longtime User Aug 11, 2019 #29 And some other things too i fear. Upvote 0