2

I'm currently using Samsung Galaxy S2 i1900G to try to test my application but apparently I need to push a database file in order for my application to connect to it and work. But it would seem that every time I try to push a file into the device I would get an error.

Here's the error I keep getting

[2012-05-20 16:16:26 - ddms] transfer error: Read-only file system
[2012-05-20 16:16:56] Failed to push selection: Read-only file system

I can't seem to figure out what the problem is. Will it make any difference if I were to root my phone? And is it possible to root Samsung Galaxy S2 i1900G model for now? Hope you guys can help me out.

Ant4res
  • 1,217
  • 1
  • 18
  • 36
Ryuujin
  • 51
  • 1
  • 1
  • 5

5 Answers5

10

Here is the solution

  1. Open Android Virtual device manager
  2. select your emulator
  3. edit your emulator
  4. must specified size of your sd card 1024MB
  5. in hardware option click new set property add sd card support: yes(value)
  6. start your emulator, in eclipse window-->showview-->other->android-->file explorer
  7. ->in file explorer open mnt->sdcard and using pushfile button for insert your file and image
  8. DONE
Jack
  • 10,943
  • 13
  • 50
  • 65
Rinkesh
  • 3,150
  • 28
  • 32
3

You can try adb shell mount -o remount,rw /data to remount /data as rw

Tarun
  • 13,727
  • 8
  • 42
  • 57
1

If your application needs to access a database, you don't need to copy one to the phone. And in any case, if you were to root the phone and force it on, this type of application would only work on your specific phone.

This article here - http://www.vogella.com/articles/AndroidSQLite/article.html - explains how to use an SQLite database with Android applications. You should just use the built-in API to create the database from your application if it doesn't already exist.

Rajesh J Advani
  • 5,585
  • 2
  • 23
  • 35
  • i'm actually trying to get it in my phone only. cause it's meant for demonstration purposes only. is there a way to do this? – Ryuujin May 20 '12 at 09:08
  • @Ryuujin why aint you shipping your app with database file. You can put your db file in assets folder. The above link will show you how to do that. – Tarun May 20 '12 at 09:23
1

This is probably since your device is connected in USB storage mode which means your SD card is mounted... You have to connect your device in a different mode in order for adb to be able to push files

IncrediApp
  • 10,303
  • 2
  • 33
  • 24
  • but i dont have an SD card. is there another way to connect my device? @@ – Ryuujin May 20 '12 at 09:07
  • Sorry, it doesn't have to be an SD card, it can be your internal memory. Same. Try to find a setting that changes the connection mode. In HTC it's on settings -> Connect to PC – IncrediApp May 20 '12 at 09:46
0

Even if it is working you won't be able to push to all dirs and it may look like you have a problem when you don't.

In the DDMS Perspective , file explorer tab select the sdcard directory and try a push - it should go - you can only push to rw dirs and some are read only. If you can do this then you just need to make sure the dir you are using is rw - which is shown in the permissions tab of the same view.