[TinyTut] - Pull/Push files from/to the Emulator (Eclipse)

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

[TinyTut] - Pull/Push files from/to the Emulator (Eclipse)

Postby plusminus » Mon Nov 26, 2007 9:11 pm

[TinyTut] - Pull/Push files from/to the Emulator


What you learn: You will learn how push/pull Pull/Push files from/to the Emulator using the DDMS-View in Eclipse.

Difficulty: 0.5 of 5 :roll:

Description:
You can push/pull files from/to the emulator, by using the DDMS-View that comes with the ADT-Plugin for Eclipse.
Open the DDMS-View like in the picture. (If you cannot see the Button A points to, do it the B-Way).
Image


Then open the File-Explorer Tab and open Push/Pull files as you wish. In this case we selected the '/data/misc/location/gps/nmea' (Mock LocationProvider) to pull it to from the emulator.
Image


Alternative to PUSH:

:idea: Emulator has to be open && Browse in Terminal/CommandLine to ".../android_sdk/tools"

Syntax: " adb push <local_source> <emulator_destination> "
Image


Regards,
plusminus
Last edited by plusminus on Wed Nov 28, 2007 10:15 pm, edited 2 times in total.
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby nico » Wed Nov 28, 2007 12:05 pm

i can do pull, but not push :(
Failed to push items
null


what's goin on?
nico
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Nov 27, 2007 10:33 am
Location: Indonesia

Postby plusminus » Wed Nov 28, 2007 9:36 pm

Hello nico, (nice name btw ;) )

added an alternative to push files, using a Terminal/CommandLine.
See above :roll:

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby nico » Thu Nov 29, 2007 6:18 am

Hello nico, (nice name btw :wink: )

hehe,thanks :wink:

it worked! thanks a lot! u're great!! :D
nico
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Nov 27, 2007 10:33 am
Location: Indonesia

Postby Gamby » Thu Dec 20, 2007 4:04 pm

I don't really understand why the push button from DDMS persp doesn't work....

Is there a reason? Is there anyone who knows why?

grrrrrr :x
Gamby
Freshman
Freshman
 
Posts: 7
Joined: Mon Nov 26, 2007 3:16 pm
Location: Italy

Postby plusminus » Thu Dec 20, 2007 4:27 pm

Hello Gamby,

I also do not know why it is still not working :(
CommandLine-Pushing is a bit annoying, but it works always ^^

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby hieunguyen » Tue Jan 22, 2008 12:34 pm

Hi plusminus.

I have tried to use Commnandline to push file onto the emulator. But it did not work :

Image

May you help me? I am looking to hearing you soon !

Regards.
Hieu Nguyen
hieunguyen
Freshman
Freshman
 
Posts: 3
Joined: Thu Jan 10, 2008 3:15 pm
Location: Vietnam

Postby Ishtar » Tue Jan 22, 2008 5:58 pm

Err.. is there a reason you're pushing the files to /tmp? Because /tmp is used for temporarily data.
/tmp - This directory contains mostly files that are required temporarily.
Many programs use this to create lock files and for temporary storage of
data. On some systems, this directory is cleared out at boot or at
shutdown

From: http://www.freeos.com/articles/3102/

I don't know how Android manages it's tmp folder, but it could be gone the next time you launch your emulator.

Ishtar
Ishtar
Experienced Developer
Experienced Developer
 
Posts: 50
Joined: Wed Jan 16, 2008 10:22 pm
Location: Netherlands

Postby plusminus » Tue Jan 22, 2008 7:13 pm

Hello Isthar,

exaxtly that was the reason for choosing "/tmp/", because of not creating useless data on your emu, you'll forget somewhen.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby noya » Tue May 26, 2009 4:02 pm

hi there,

If i want to read from a file i saw i have to put it in a "files" directory inside data/data/[package] ... but how to create this directory?

thanks!

EDIT: I've resolved... to accomplish that in Eclipse, you can start the emulator with a line of code requesting for a file in that directory. It will give you an Exception but it will also create the data directory. So you can upload the file and then restart the application... well it's not so an elegant solution but it works :wink:
User avatar
noya
Junior Developer
Junior Developer
 
Posts: 14
Joined: Fri May 08, 2009 3:16 pm
Location: Bergamo, Italy

Re: [TinyTut] - Pull/Push files from/to the Emulator (Eclips

Postby moin.dev » Thu Aug 19, 2010 11:16 am

hello Nico

the
"Failed to push items
null"

can be got rid of even in the file explorer,,

i found out tht,,,
try to collapse the sdcard folder if it is in expanded state,,and then select the sdcard folder and try pushing the files into the device,,,it worked for me..


why it showed "null" was becoz nothing was selected but it was initially showing sdcard folder selected,,,which is a stupid eclipse prob

if it still persists,,,try to expand <->collapse the folder and then see...
moin.dev
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Aug 19, 2010 11:06 am

Re: [TinyTut] - Pull/Push files from/to the Emulator (Eclips

Postby kojh87 » Wed Mar 23, 2011 7:53 am

I cant pull the files out from the device.

Fail to pull selection
(null)

what is the problem with this and how can i solve this?
kojh87
Freshman
Freshman
 
Posts: 3
Joined: Thu Mar 17, 2011 4:08 am

Re: [TinyTut] - Pull/Push files from/to the Emulator (Eclips

Postby solo » Sat Apr 23, 2011 6:37 pm

Can not open my data-folder.

How come? Is there anything to do with the rights on my phone? It is a HTC Wildfire.
~ Asking if computers can think is like asking if submarines can swim.
User avatar
solo
Junior Developer
Junior Developer
 
Posts: 22
Joined: Fri Mar 25, 2011 9:51 pm

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 12 guests