0

How do I get the filepath from the cache? Android: getCacheDir() / Xamarin: CacheDir. I can't find any useful information on this ...

What is meant with the 1 MB size limit? Each file or the file size of all files in the cache directory? Where should one place temporary files which exceeds that limit? On the device's internal storage?

poupou
  • 43,413
  • 6
  • 77
  • 174
testing
  • 19,681
  • 50
  • 236
  • 417

1 Answers1

2

The CacheDir property returns a Java.IO.File. This object has a property AbsolutePath that contains the path of the cache directory.

// e.g. in your activity
public class MyActivity : Activity
{
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        System.Diagnostics.Debug.WriteLine(CacheDir.AbsolutePath);
    }
}

This 1MB is just an example. You can use more space. It is just a hint from google, to set a limit to yourself. Here is a really nice answer to this question: https://stackoverflow.com/a/10069679/1489968

Community
  • 1
  • 1
Sven-Michael Stübe
  • 14,560
  • 4
  • 52
  • 103