Xamarin Android-How to create folder on sdcard with app icon with left down corner? Programmatically

SelvanSelvan USMember ✭✭
edited September 2015 in Xamarin.Android

I want to create a folder programatically for my app same as this screen shot.

I tried on google but not getting proper out put.

check attach screen shot this screen shot is for showing a reference of Folder with icon.

Image captures from Es explorer file manager.

In Manifest File,

  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

In My MainActivity,

public void Create()
{
    var dir =  new Java.IO.File(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/Sample/");
    if (!dir.Exists ())
        dir.Mkdirs ();
    if(dir.Exists())
        dir.Delete();

}

Create(); // I have called this function in OnCreate function.

I was able to create a folder, but folder with app icon with left down corner ( so as in attachment) was unable to create using the above code. If Everyone knows the exact code of it kindly share it.

Answers

  • any hope you got an answer for your own question :smile:

  • ArcSArcS USMember ✭✭

    @selvan
    Can you please tell what this stands for "/Sample/" ?

    And for this: Create(); // I have called this function in OnCreate function.

    Where did you find the OnCreate function?

Sign In or Register to comment.