If I deploy my files to assets\internal, where is it in Android phone?
I opened up Explorer and look at the phone's contents, can only find something
like : Internal shared storage\Android\data\com.embarcadero.project1\
but when I click on 'cache' or 'files' subfolders, both are empty.
Please advise where to find my deployed file.
Related
I've tried several folders but looks like no file is created.
External read & write permission have been enabled.
The code run without any sign of error. (as given below)
Here is the screenshot of the code inside mainactivity.cs (this is for testing purposes).
I also assume that since this is platform specific, the code must be in android project.
string filename = Path.Combine(Xamarin.Essentials.FileSystem.AppDataDirectory, "count1.txt") ;
StreamWriter sw = File.CreateText(filename);
sw.WriteLine("asad ini test");
sw.Close();enter code here
1b. I 'm using Android 6.0 phone, but I can't find such folder /data/user...
(I'm not sure if such folder is targeted special version of Android)
I search both internal /Android/myproject/files/ and found nothing
I search external SDcard /Android/myproject/files/ and still found nothing
(please look at the my android phone folders, i can't even find /data folder
Once, this is accomplished the next step would be how to call this function from the generalproject (non android, non IOS, non UWP project).
Example to write file given in xamarin document.
Where should this code reside? in general project folder ? or, android project folder?
The term "external" used in android is very misleading. It doesn't mean the external removable SD card rather some folders that don't require "root" permission. Therefore, initially I can't find the folder which I save a file into.
Another reason is each phone manufacture uses different name, hence it is very difficult to get an absolute address of an external removable SD Card.
More details is explained in blog_external_removable_SD_Card
You can't write to the removable SD Card
an old post here
I'm currently developing an app in Android Studio for Android TV on a mac. Ultimately I want to load local image files as card images in a VerticalGridFragment where a card id and an image filename have matching numbers. For the sake of prototyping, right now I'm just trying to set up best practices (as a complete novice) with a single 1.jpg file that will appear on every card.
I'm using the included Android TV emulator and assume I shouldn't attempt to use access or make use of any OSX file system. So my two questions are:
While I'm prototyping and trying to get 1.jpg to be the image for
each card, where should I place this file in a manner that I can
access using a file path string for internal storage, such as /root/1.jpg
which I can later change to /root/$.jpg where $ is a dynamic id
associated with each card. This needs to satisfy both the emulator
being able to access the file, a device being able to access the file when the app is finished, and me being able to place files there
from my host os while prototyping.
A follow-on question. When the app is finished I obviously won't be
relying on manually placing image files. Will the solution to the
above also provide a straightforward means of saving images to this
directory on a device?
Thanks.
Ok, I think I've got my head around this now:
Inside Android Studio, there's a Monitor utility in which there's a File Explorer. Using this, you can browse, and save to the directory structure that the emulator's using.
Most importantly, there is a standard assigned directory for apps to save and open from on internal storage. It can be found in the file browser at /data/data/com.applicationname/files/
From any app, it can be referenced for saving to or opening from using getFilesDir(), which answers question 2.
I can't find the folder containing videos and pictures on my tablet using the file explorer of Android Device Monitor.
The folder I'm trying to find is "Internt lager" which translates to internal storage in english:
I can expand all folders in the device monitor file explorer without finding my movie files, image files, downloaded files, etc. If I try to pull storage/self/primary for instance, I get an empty folder.
I know the storage/emulated folder is a symbolic link, but I need to find out where it points to, so that I can open my files in my app.
I've created an app using Android Studio and it has a database file handler. I've gone through a few post and everywhere they are saying go to data\data\ folder to get the app folder. But mine doesn't show any folder for my app. Do I have to manually set this file location to be created? How can I find my database.db file?
It should be automatically placed in data/data/databases in your app folder unless you specify otherwise. Are you sure it is created?
That is /data/data/package-name/databases/dbfilename
I have another suggestion. If you have enabled backup for your application, you might be able to use ADB BACKUP, like suggested here: http://blog.shvetsov.com/2012/09/backup-your-android-without-root-or.html
The database files are located in the following folders.
/data/data/packagename/databases/
You can access the .db file only on emulator, its not possible on actual device. In the android studio open the DDMS perspective, there on the left hand side you will find the storage structure, there in data/data/ you will get the file you are looking for
Well, I tried to search in google and SO, but didn't find much mainly because I am not sure what should be my search word. So, if anybody thinks this question is too generic and should be searched first, please help me providing some useful link.
What I want is, to have two buttons in my App which should download sample.csv and sample.php (I want to attach this file inside my App) file and save it to user directory, preferably in "download" folder or somewhere user can access easily.
I found this page by searching but here they demonstrates saving File on Internal Storage in App's folder only. Now I am confused whether this App's folder is accessible by browsing or not (I can't find my app's folder in my Samsung Note 2).
Another question pops up in my mind is, whether I have to read those sample files and create new file to save, or I can simply put a link and download the sample files I provided (more like HTML link)? Or may be I can just upload those sample files in my web server as zipped and give a link to dload?
Apology for my long email, but I am confused where to start.
Thanks,
You can not access your app's internal directory. However, what you can do is to use InputOutputStream to copy your file from the internal directory to your desired folder, and then delete the file from the app's directory. Try searching for copying files and you'll find multiple links.