how to judge the project is connect to the sdcard?

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

how to judge the project is connect to the sdcard?

Postby xiangyong » Mon Dec 08, 2008 10:14 am

sdcard
xiangyong
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Nov 10, 2008 4:39 am

Top

Postby MrSnowflake » Mon Dec 08, 2008 10:16 am

[mod]Please, make proper posts. We take the time to read and answer, so you should make time to make a decent post.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby Bossly » Mon Dec 08, 2008 2:18 pm

If you meens - how to run emulator from Eclipse with attached storage card - then follow to this steps:
1. run Eclipse IDE
2. Find Run menu Item -> Run(or/and Debug) Configuration -> Android Application -> Target (tab) in Additional Emulator Command Line Options write -sdcard <fullpath to your sdcard file> (for example -sdcard "D:Android Enviromentsd_card.img")
3. Run/Debug you application with new launched emulator

Warning: This change will be available for selected project that change maded.

I hope it's help.
Using android-sdk-windows-2.1
Best wishes, Bossly
User avatar
Bossly
Freshman
Freshman
 
Posts: 8
Joined: Mon Dec 01, 2008 11:03 am

sorry

Postby xiangyong » Tue Dec 09, 2008 2:57 am

MrSnowflake wrote:[mod]Please, make proper posts. We take the time to read and answer, so you should make time to make a decent post.


I am very sorry to that,i will improve.
xiangyong
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Nov 10, 2008 4:39 am

Postby xiangyong » Tue Dec 09, 2008 3:29 am

Thank you very much. i know how to configure and use sdcard, but now i want judge whethe the current progect is connect to the sdcard throuth code.
xiangyong
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Nov 10, 2008 4:39 am

Postby Bossly » Tue Dec 09, 2008 5:52 pm

Okey. So why just don't try to open directory of sdcard and check if it exist??


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. File file = new File("sdcard");
  2.  
  3. boolean bSDCardPresent = file.exists();
Parsed in 0.058 seconds, using GeSHi 1.0.8.4
Using android-sdk-windows-2.1
Best wishes, Bossly
User avatar
Bossly
Freshman
Freshman
 
Posts: 8
Joined: Mon Dec 01, 2008 11:03 am

Top

Postby MrSnowflake » Tue Dec 09, 2008 7:03 pm

Bossly wrote:Okey. So why just don't try to open directory of sdcard and check if it exist??


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. File file = new File("sdcard");
  2. boolean bSDCardPresent = file.exists();
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
You probably want to make that "/sdcard" :).
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 6 guests