35

I just started using the Android Studio IDE and I already released and published a simple APK to Google Play store. The problem is that I did this at work. Now I downloaded the Android Studio at my home and I want to continue working and fixing bugs on my Project. I see that there is Import Project in the Android Studio home screen, but from where I export the project in order to import it? I tried Zipping my whole Project folder and import it but it didn't work very well.

030
  • 10,842
  • 12
  • 78
  • 123
TomG
  • 2,409
  • 4
  • 23
  • 40
  • Just copy your entire project folder and point to that folder in the import wizard – yonili Sep 04 '13 at 11:29
  • I wrote that I tried to do that, but it gave me some kind of "rendel" errors when I opened it. – TomG Sep 04 '13 at 11:32

7 Answers7

56

In the Android Studio go to File then Close Project. Then take the folder (in the workspace folder) of the project and copy it to a flash memory or whatever. Then when you get comfortable at home, copy this folder in the workspace folder you've already created, open the Android Studio and go to File then Open and import this project into your workspace.

The problem you have with this is that you're searching for the wrong term here, because in Android, exporting a project means compiling it to .apk file (not exporting the project). Import/Export is used for the .apk management, what you need is Open/Close project, the other thing is just copy/paste.

030
  • 10,842
  • 12
  • 78
  • 123
g00dy
  • 6,752
  • 2
  • 30
  • 43
  • Thank u man, I did this and ran into a different problem. I posted it as a different question, please take a look if you can: http://stackoverflow.com/questions/18624666/how-to-change-gradle-sdk-settings-when-opening-android-studio-project-from-a-dif – TomG Sep 05 '13 at 15:12
  • I posted a comment on the link you provided. – g00dy Sep 05 '13 at 15:49
  • 3
    is it necessary to copy the whole project directory? Including the various "build" sud directories? My concern here is the space. With all the various sub-directories and build outputs the zip directory is almost 10Mb. – Mike Scott Jan 22 '15 at 20:25
18

As mentioned by other answers, as of now android studio does not provide this out of the box. However, there are ways to do this easily.

As mentioned by @Elad Lavi, you should consider cloud hosting of your source code. Checkout github, bitbucket, gitlab, etc. All these provide private repositories, some free, some not.

If all you want is to just zip the sources, you can achieve this using git's git archive. Here are the steps:

git init       # on the root of the project folder
git add .      # note: android studio already created .gitignore
git commit -m 'ready to zip sources'
git archive HEAD --format=zip > /tmp/archive.zip

Note: If you intend to send this by email, you have to remove gradlew.bat from zip file.

Both these solutions are possible thanks to VCS like git.

rpattabi
  • 9,984
  • 5
  • 45
  • 53
4

It seems as if Android Studio is missing some features Eclipse has (which is surprising considering the choice to make Android Studio official IDE).

Eclipse had the ability to export zip files which could be sent over email for example. If you zip the folder from your workspace, and try to send it over Gmail for example, Gmail will refuse because the folder contains executable. Obviously you can delete files but that is inefficient if you do that frequently going back and forth from work.

Here's a solution though: You can use source control. Android Studio supports that. Your code will be stored online. A git will do the trick. Look under "VCS" in the top menu in Android Studio. It has many other benefits as well. One of the downsides though, is that if you use GitHub for free, your code is open source and everyone can see it.

030
  • 10,842
  • 12
  • 78
  • 123
Elad Lavi
  • 633
  • 5
  • 7
  • Exactly. GitHub is useless if you just want to backup your own code privately unless you don't mind paying a monthly fee! – CMP Oct 01 '15 at 17:21
1

Source control is best way to handle this problem, if you don't want to pay then try bitbucket

It's free, allows private repo for upto 5 members team.

digiwizkid
  • 791
  • 2
  • 14
  • 28
1

Windows:

First Open Command Window and set location of your android studio project folder like:

D:\MyApplication>

then type below command in it:

gradlew clean

then wait for complete clean process. after complete it now zip your project like below:

  • right click on your project folder
  • then select send to option now
  • select compressed via zip
Sagar Maiyad
  • 12,655
  • 9
  • 63
  • 99
0

Apparently, there's a lot of "dead wood" in the "build" directories of a project.

Under linux/unix, a simple way to get a clean, private backup is to use the "tar" command along with the "--exclude=String" option.

For example, to create an archive of all my apps while excluding the build directories, I have a script that creates the following 2 commands :

cd $HOME/android/Studio
tar cvf MyBackup-2017-07-13.tar Projects --exclude=build
RudyF
  • 805
  • 1
  • 10
  • 16
0

For Android Studio below 4.1:

From the Top menu Click File and then click Export to Zip File

For Android Studio 4.1 and above:

From the Top menu click File > Manage IDE Settings > Export to Zip File ()

Mkurbanov
  • 197
  • 3
  • 13