Import-Export
in eclipse can be used like these ways :
Import project from
another workspace.
For
some reason we usually have more than one workspace and each them have some
project inside bur sometime we need to open a project from unopened workspace,
rather than switch between workspace we can import a project from that
workspace. To do this clik File in menu or just right-click in Package
Explorer and click Import, import window will show up. Expand
General
and click Exsisting project into workspace and then Next, an import projects window will open and
click Select root derectory (if not selected yet) then browse project folder in
unopened workspace from window
explorer and OK, it will send back to previous import
project window and that chosen project folder appear in project box and
already checked (check it if not), if you want to work with
this project from the owner workspace (unopened workspace) directly just leave Copy
project into workspace uncheck but if you want to copy it into current
opened workspace check this box, by do that you will have two same project in
two workspace and you can work with one of them independenly means if you do
modification in one project, another same project will not updated. Finally
click Finish and that project will appear in your Package Explorer.
Import Android Code
from another folder.
For
example we want to import sample android code from android SDK, so click Import
from File menu, on import window expand Android and click
Existing
android code into workspace and then Next, an Import
project window will open and browse android code from
window explorer, for example : Eclipse – adt-bundle…..- Eclipse –SDK – sample
- android 14 – Lunar Lander and OK. That chosen
android sample code appear in project box and
check it’s checkbox, if you want
to work with this project from original place directly just leave checkbox Copy
project into workspace uncheck but if you want to copy it into current
opened workspace check this box, choose the second one so you can work with
this code freely, you can learn it and do modification as well. Then click Finish
and that code appear in your Package Explorer.
Import project from
currently opened workspace.
Sometimes
we need to delete some projects from Package Explorer list but not from
workspace means project just disappear from list but still in workspace, this
because too many project listed in Package Explorer will make eclipse
take long enaugh to get ready at first time opened because eclipse will check
one by one all project from error. To delete from list, right-click project
name in Package Explorer – Delete – OK. Don’t check Delete project
content on disk because it will delete project from workspace too. To
display it back on the list click Import from File menu or
right-click in Package Explorer and import window will open, expand General,
click Existing project into workspace then Next. From import
projects window browse the project you want to import from current workspace
and click OK, it will go back to previous window and the project will
appear in projects box. Notice : project sometime displayed in grey and unchecked
because Copy project into workspace option still checked, just uncheck
it and click Refresh to make project appear solid black and checked then
click Finish and that project will be back in Package Explorer list.
Export to Archive File
Project
archive file is usefull to used later to do recover project or just to compare
the discrapancies between two project with same name. To archive just click Export
from File menu or right-click in Package Explorer and export
window will open, expand General, click Archive File then Next.
In file
system window just pick project you want
to archive, you can archive the whole project or just certain folders/files to
be archived. Browse the directory where the archive file will be saved, in Options
you can Save in zip (recommended) or tar format, you may Compress
the content of the file (recommended). Check option Create directory
structure for files (recommended) if you want to archive files and complete
directory structure just like in project package, or if you just want to save
files and directory associated with them check Create only selected
directories. Then Finish.
Export to File System
To
do this click Export from File menu or right-click in Package
Explorer and export window will open, expand General, click File
System then Next. In file
system window just pick project you want
to save, you can save the whole project or just certain folders/files to be saved.
Browse the directory where the archive file will be saved, in Options check
option Create directory structure for files (recommended) if you want to
archive files and complete directory structure just like in project package, or
if you just want to save files and directory associated with them check Create
only selected directories. Then Finish.
How to Use Archive Files / File System ?
If
you for some reason lost your project, say accidentally deleted, You can import
archive files use import project from another worspace procedure just
like described above, just Select archive files as source.
If you want to recover
some files in your project, say you make mistake that you can’t fixed, do
import file system. Click Import from File menu or right-click in
Package Explorer and import window will open, expand General,
click File System then Next. From file system window in From
directory browse file system you want to import and click OK, it
will go back to previous window and the file system will appear in explorer box.
Select all files in file system or pick particular files you want to import then
in
Into folder browse folder in your project directory (this directory
must be the same with directory you pick in
From directory), click
Finish
and just click
Yes if
overwrite warning pop up then the failed files in
your project will be recovered with file from file system. You can also use
archive file to recover some failed files in your project but you have to
extract it first.