Kindle Fire の開発者向けページに説明があった

とりあえず Kindle Fire の開発者向けページで記述を発見。

SD Card Support
Kindle Fire tablets have an internal SD card that your app can write to. Kindle Fire tablets' SD card is internal and is not removable. You should not have to change your app for Kindle Fire tablets if it currently stores data on the SD card. To write to the internal SD card on Kindle Fire, use getExternalStorageDirectory().

ということだそうだ。
SD Card が中に入ってて取り出すことはできないだけで、getExternalStorageDirectory() でパスを取得してアクセスするのは普通(?)の Android機と一緒だ。


でも、疑問なのが内蔵 Storage はないの?ってこと。
Galaxy S2 とか Nexus とか、getDataDirectory() でパス取得してアクセスしたら問題なく内蔵 Storage に保存できたけど。
あれ? 何か Android 本体に設定とかあったかな? アプリのパーミションは External の時だけだったと思うし…。
自分、何か思いっきり勘違いしてるのかな?


というわけで、最終的にこんなコードで FileOutputStream ができた。(エラーが出てあれこれ細かくやったので何度手間にもなってるけど…)

File dir;
FileOutputStream output;
String filename = "tempFile";
File tempFile;

dir = new File(Environment.getExternalStorageDirectory().toString()+"/temp");
if (!dir.exists()) {
	dir.mkdirs();
}
tempFile = new File(dir, filename);

try {
	tempFile.createNewFile();
	output = new FileOutputStream(tempFile);
} catch (FileNotFoundException e) {
	e.printStackTrace();
} catch (IOException e1) {
	e1.printStackTrace();
}