2012-01-31 3 views
1

私はアンドロイドタブレットに接続されているUSBフラッシュの最初のセクタまたは最初のバイトを読んでみたいです!どのように私はアンドロイドデバイスに接続されたUSBフラッシュの最初のセクタを読むことができますか?

私はそれがRandomAccessFileを使うべきであることを知っていますが、私のUSBフラッシュのアドレスは何か分かりません!私が知っている

私はこのコードを発見したが、私は引数の代わりに置くべきかわからないあなたの助けに感謝


[0]

public class FAT16 
{ 
public static void main(String[] args) throws IOException 
{ 
// open file whose name is on the command line for input 

RandomAccessFile file = new RandomAccessFile(args[0], "r"); 

// skip ahead to byte 19 (0x13 hex) where the num of sectors is stored 

file.seek(0x13); 

// 2-byte values are little-endian; Java is big-endian, so we 
// have to read the two bytes separately and glue them together 
// ourselves 

int low = file.readUnsignedByte(); 
int high = file.readUnsignedByte(); 

int sectorsOnDisk = low + (high * 256); 

// skip ahead to where the sectors per FAT is stored 

file.seek(0x16); 
low = file.readUnsignedByte(); 
high = file.readUnsignedByte(); 

int sectorsPerFAT = low + high * 256; 

// skip back to where the bytes per sector is stored 

file.seek(0x0b); 
low = file.readUnsignedByte(); 
high = file.readUnsignedByte(); 
int bytesPerSector = low + high * 256; 

// report size of disk and number of sectors per FAT 

System.out.println("Disk size = " + sectorsOnDisk * bytesPerSector); 
System.out.println("Sectors per FAT = " + sectorsPerFAT); 
} 

}

私たちはLinuxで "/ dev/sdaX"を使うべきですが、それはadnroidのためには何でしょうか?

+0

回答は、あなたの質問に直接答える回答のみに留意してください。明確化のために回答の下のコメントを使用するか、質問を編集して詳細な情報を提供してください。 Stack Overflowは議論のフォーラムではありません(要素のようないくつかのフォーラムがありますが)。[FAQ](http://stackoverflow.com/faq) –

答えて

1

Android SDKの「USBフラッシュ」はサポートされていません。デバイスの「USBフラッシュ」にアクセスするための特定のプロトコルがあるかどうかについては、デバイスの製造元に問い合わせてください。

+0

私はこのタブレットを持っています キューブU10GT! – ahmadii

+2

@AliAhmadi:私はあなたのデバイスメーカーではありません。 – CommonsWare

+0

私のデバイスメーカーは返信しません! : – ahmadii

関連する問題