I'm trying to create the path "/package name/databases" under the sdcard folder. Anybody got the secret?
Does anyone know how to create a folder tree in the Eclipse DDMS File Explorer?
why to store an application's database file (*.db) outside to it's original path (data/data/APPLICATION_PACKAGE/databases/DATABASE_NAME.db) ? –
Airiness
@Vegolath - several possible reasons. It could be big. Also, if it's in the app's private storage area, DDMS can't access it (except on the emulator or a rooted device) –
Vengeful
@Chris Stratton, try avoiding shipping heavy databases with you application. If it is possible try remote your db on a server then access it with your app, like REST app. –
Greg
It's not my question or application. Content on the SDCARD is hopefully not shipped "with" an application, but there are many legitimate reasons for installing large datasets there - such as usability when the mobile network is not available. –
Vengeful
Are you using fileobj.mkdir()
method from File
class? Check if the directory already exist if not exist then create it.Refer
And don't forget about writing permissions for external storage, WRITE_EXTERNAL_STORAGE
.
Thanks for reminding me about the permissions. It's not relevant for this but it will be in a subsequent activity. [See comment above ...] –
Concepcion
Just select the parent folder and click the small + ("New Folder"). Do this again for the next subfolder.
Please note: I'm trying to do this in the emulator, not an actual phone! My sdcard folder is under mnt. It doesn't appear to allow any additions ... –
Concepcion
Can't reproduce that. Have you actually added a sdcard to your emulator? By default the card-size field is empty, resulting in no sdcard (There should be a notification in the statusbar in this case). The file explorer shows an sdcard folder in this case though, but i get a read-only message if I try to create something in there. But if I have added some space for the card, it works for me in an 1.6 AVD and in a 2.3.3 one. –
Anorthosite
I don't recall adding anything to this tree previously. I'm running under 2.2 API8. When I check the settings in the AVD, the size of the sdcard storage is 31.49mb! –
Concepcion
Mhm I can't even specify 31.49mb, the settings only allow me round numbers. Maybe your AVD is somehow damaged? Did you try creating a new one from scratch? –
Anorthosite
Creating SD Card
Access to your Android SDK Tools folder and use command “mksdcard” in order to create one.
By default installation on Windows, the Tools folder should be here:
C:\Program Files\Android\android-sdk\tools
Using following syntax to create your desired SD Card
mksdcard [memory size] [output file]
For example, I’d like to create a SD card with 200 MB in memory and put the files in
C:\Personel\AndroidNewbie\SDCard with file named “sdcard_dev.iso“, I do like this:
mksdcard 256M C:\Personel\AndroidNewbie\SDCard\<span class="skimlinks-unlinked">sdcard_dev.iso</span>
Then
Using SD Card
You’ve done creating your desired SD Card, now you need it to be used by Android emulator. Open Eclipse,
access to your project.
On menu Run -> Run Configurations, click on Android Configuration on the left tree menu, click on tab
Target on the right pane. You will see at the bottom: “Additional Emulator Commandline Options” and an
Input/Edit box below:
Just type your input sdcard following syntax
-sdcard [sdcard location]
For example, with the SD Card I’ve created above, I type:
-sdcard C:\Personel\AndroidNewbie\SDCard\<span class="skimlinks-unlinked">sdcard_dev.iso</span>
© 2022 - 2024 — McMap. All rights reserved.