Android Question Persistent App

ElliotHC

Active Member
Licensed User
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
Upvote 0

ElliotHC

Active Member
Licensed User
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

ElliotHC

Active Member
Licensed User
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.

If I know the location, can't I just set that as the persistent Uri?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
can't I just set that as the persistent Uri?
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:
Upvote 0

ElliotHC

Active Member
Licensed User

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

DonManfred

Expert
Licensed User
Longtime User
The issue I seem to be having here is using the ExternalStorage Class as a service.
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
    12.7 KB · Views: 111
Upvote 0
Top