locked
Where is /dat/data/MyApp directory on hard drive? RRS feed

  • Question

  • User44090 posted

    I am using a trial version of Xamarin, trying to port a Windows app to an Android project from within Visual Studio 2012. My app copies gifs from a server to my hard drive and then I want to open them from the hard drive. My question is where exactly is the /data/data/[MyApp] (insert your app name into MyApp) directory on my pc's hard drive? Like C:/data/data/MyApp.

    I retrieve the info like this: string appPath = Android.App.Application.Context.ApplicationInfo.DataDir;

    I even created the directory, and I know it exists because subsequent calls to find the directory will find it, but I can't find the bloody directory with File Explorer. Did a file search in File Explorer and still no love. Created a file inside the folder and couldn't find the file.

    This has to be a simple answer but I can't find it...

    Saturday, February 28, 2015 7:13 PM

Answers

  • User1669 posted

    The Android emulator is a Virtual Machine running the Android operating system. It's no different than if you were running a VM of Windows Server, Linux, or another Version of Windows. So therefore, it's isolated from your hard drive on the PC because it's running on a virtual environment. Android has its own file system, and when the code execute it is executing in your Android VM (Emulator) and not running on your PC using your PC resources. So therefore, you need to browse through the file system of the Android Emulator.

    With that being said, you can use the Android Device Monitor (aka DDMS) to browse through your emulator's file system. The easiest way to do this is to:

    1. Start your Emulator and make sure it's running.
    2. Open up Visual Studio (if it's not open already).
    3. Go to "Tools->Android->Android Device Monitor".

    In your Devices Window Select your Emulator that is running. Then in the select the "File Explorer" tab and you should be able to browse your Emulator's file system.

    More info here: developer.android.com/tools/debugging/ddms.html#emulator

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, March 3, 2015 9:43 PM

All replies

  • User1669 posted

    Yes, the answer is simple. That directory does not reside on your PCs hard drive. It resides on the internal storage of your Android Emulator or your Android device.

    Tuesday, March 3, 2015 8:49 PM
  • User44090 posted

    My Android emulator is running on the same pc, so how does that work?

    Tuesday, March 3, 2015 9:17 PM
  • User1669 posted

    The Android emulator is a Virtual Machine running the Android operating system. It's no different than if you were running a VM of Windows Server, Linux, or another Version of Windows. So therefore, it's isolated from your hard drive on the PC because it's running on a virtual environment. Android has its own file system, and when the code execute it is executing in your Android VM (Emulator) and not running on your PC using your PC resources. So therefore, you need to browse through the file system of the Android Emulator.

    With that being said, you can use the Android Device Monitor (aka DDMS) to browse through your emulator's file system. The easiest way to do this is to:

    1. Start your Emulator and make sure it's running.
    2. Open up Visual Studio (if it's not open already).
    3. Go to "Tools->Android->Android Device Monitor".

    In your Devices Window Select your Emulator that is running. Then in the select the "File Explorer" tab and you should be able to browse your Emulator's file system.

    More info here: developer.android.com/tools/debugging/ddms.html#emulator

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, March 3, 2015 9:43 PM
  • User316826 posted

    Hello am working on a project, but am finding it difficult to access files in my device file explorer

    Friday, January 12, 2018 6:38 AM