Android Question [ SOLVED ] How can I write a file from File.DirRootExternal to SDCard?

Discussion in 'Android Questions' started by Javier Mateo, May 8, 2019.

  1. Javier Mateo

    Javier Mateo Member Licensed User

    Hello everybody.
    I am very lost and blocked.
    Many years ago I developed an app for commercial management.
    I used a SQLite database and made the backups in the SDcard.
    This works well in the kitkat versions but in higher versions I can not find how to do it.
    First I would like to know how to get the correct path in the SDCard, and later how to record the file.
    I have seen some examples in the forum but I did not find any solution.
    I know I have to use inputstream and outputstream and the function File.Copy2 (in, out) but I do not know how to get the correct path from the File.DirRootExtermal to the External storage.
    I know how use the runtime permisions, but I do not how made the backup copy.

    Could you help me in that subject?

    Thanks in advance.
  2. DonManfred

    DonManfred Expert Licensed User

    Erel likes this.
  3. Javier Mateo

    Javier Mateo Member Licensed User

    Thanks a million DonManfred!!!

    I have solved my problem.
  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