Android Question Access storage from Service

Discussion in 'Android Questions' started by ElliotHC, Aug 11, 2019.

  1. ElliotHC

    ElliotHC Active Member Licensed User

    I'm trying to use the ExternalStorage example to access a known location within the SD card, this location will never change so I don't need to browse to it. I have it as a string.

    What I need to do is quite simple but the complexities and additional functionality of the above example are making it extremely difficult to integrate it in to my project. It also doesn't help that there is a separate event module which I have no idea how to merge in to the main project.

    Simply put, I need to load the file names from a known folder location in to a list every 1 second in a service. That's it!

    e.g. "/storage/0000-0000/DCIM/Camera/"
    In that folder
    Load all the Image names in to a list.
    e.g.
    20190809_0800.jpg
    20190809_0801.jpg

    Unfortunately, I've spent the past 2 days trying to achieve this using the ExternalStorage example, which I can't seem to pull apart and get working in isolation.

    I'm pretty sure what I'm trying to do here is a few lines of code and I'm banging my head against a wall trying to figure out the ExternalStorage app.

    The reality is, I don't have days to play. This is a small part of a much larger project that I'm trying to get running.

    Any help here would be much appreciated. Thanks
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    No such thing. You cannot access the external storage (sd card) unless the user selected it. Once the user selected it you can keep the Uri as demonstrated in the example.
     
    ElliotHC likes this.
  3. ElliotHC

    ElliotHC Active Member Licensed User

    Ok, so the only way is to access the SD card is to use the ExternalStorage Example.
     
  4. DonManfred

    DonManfred Expert Licensed User

    Is to use the ExternalStorage Class.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice