[Android] how can I access picture in sdcard ?
This my code
if (Application.platform == RuntimePlatform.Android) { Debug.Log ("This is android platform");
DirectoryInfo dirAndroid_left_seq = new DirectoryInfo (Application.persistentDataPath + "/seq_test/lucky_left");
FileInfo[] infoLeftAndroid = dirAndroid_left_seq.GetFiles ("*.png");
foreach (FileInfo f in infoLeftAndroid) {
//Debug.Log (f.ToString());
Texture2D tex = null;
byte[] fileData;
if (File.Exists (f.ToString ())) {
fileData = File.ReadAllBytes (f.ToString ());
tex = new Texture2D (1920, 1080);
tex.LoadImage (fileData); //..this will auto-resize the texture dimensions.
jpegViewerLeft.sortList.Add (tex);
}
}
But It's not working. How can access sdcard with path . thank you in advance.
Comment