2016년 12월 5일 월요일

Android Directory Structure


I am now working with Taifun's FTP extension, and understand the general workings of it, particularly the remote server side aspects. I have used Taifun's example app and it works with no problems.

My problem is that I don't quite understand the Android Directory Structure. For instance if I create a TinyDb with tags, what is the absolute path to that TinyDB?

From that TinyDb I can create a .csv file for uploading, in Taifun's extension, what would be the local directory for that file?

Whilst researching for an answer myself, I found that AppInventor has created a directory on my phone with two subdirectories, Assets and Data. Are these directories used only whilst in development?

-- 
TinyDB is an xml file and that file is accessible only on rooted phones


I found that AppInventor has created a directory on my phone with two subdirectories, Assets and Data. Are these directories used only whilst in development?

yes

-- 
I want to upload a .csv file which I have created from a TinyDb. Using your FTP extension, could you explain where  the .csv is located?

I also want to download that same .csv into another app. What is the path to that local directory to download into?

I know these seem like the most basic questions to you, but as stated in my first post, I am unfamiliar with Android file system...

-- 
I want to upload a .csv file which I have created from a TinyDb.
how did you create the csv file? Using the file component?

Using your FTP extension, could you explain where  the .csv is located?

assuming you are using the File.SaveFile method, you define the path to the file yourself, just use the same path for the ftp extension


SaveFile(text text, text fileName)
Saves text to a file. If the filename begins with a slash (/) the file is written to the sdcard (for example, writing to /myFile.txt will write the file to /sdcard/myFile.txt). If the filename does not start with a slash, it will be written in the program's private data directory where it will not be accessible to other programs on the phone. There is a special exception for the AI Companion where these files are written to /sdcard/AppInventor/data to facilitate debugging. Note that this block will overwrite a file if it already exists. If you want to add content to a file use the append block.



I also want to download that same .csv into another app. What is the path to that local directory to download into?
what is the local directory you are talking about?

the ftp extension can only store files on sdcard, see also the documentation https://puravidaapps.com/ftp.php
Download one or all files from remote directory into local directory on SD card.
In case the local directory does not exist, it will be created. If the localDirectoryName starts with file:/// you can specify a complete path for example to download to the external SD card.
To download all files from a remote directory, use an empty string as remoteFileName.

-- 


댓글 없음:

댓글 쓰기