Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: Need to know which folders/files to backup

I have to take backup of Android project. But the entire folder structure size is very big (goes upto few hundreds of MBs) for periodical backups. Basically I want to take backup of only source and configuration files (so that I should be able to build project successfully just with backup). I don't care generated and intermediate files.

But when I've look at folder structure, it looks too confusing and cannot make which folders/files I should backup and which should discard (Yes, I can find out my own written source files, but which are config and other files needed by Android Studio?)

enter image description here

Can someone please guide?

Thanks!

like image 329
Atul Avatar asked Aug 26 '16 03:08

Atul


People also ask

How do I choose which folders to backup?

Right-click on the Backup & Sync icon on the bottom right of the system taskbar, click 3 dots and then select the Preferences option. Now, add another folder for the backup process by clicking on the CHOOSE FOLDER option. Browse and select the folder to backup. Then click Select Folder to add it to the application.

What folders are important in Android project?

The resource folder is the most important folder because it contains all the non-code sources like images, XML layouts, and UI strings for our android application.

In which folder all the design file will be saved in Android?

Storage of the Android project. Android Studio stores the projects by default in the home folder of the user under AndroidStudioProjects. The main directory contains configuration files for Android Studio and the Gradle build files.


2 Answers

Actually, it is very simple in the android studio. Only you have to do is just

File ->Export to Zip File This will create a zip file of your project. This Zip file will only contain the files that are necessary, to import the project back into Android studio again.

Edit: From the new Android Studio Version Export to Zip flow changed(My Version: Android studio 4.1, Running in Mac Os Catalina). Now it is File->Manage IDE Settings ->Export to Zip FIle.

like image 164
Lins Louis Avatar answered Oct 11 '22 01:10

Lins Louis


You backup whatever is important. For each project or library, do backup these:

  1. src folder (contains source code, resource files)
  2. build.gradle file (contains info about dependencies, libs)

Do not need to backup:

  1. build folder
  2. gen folder
  3. .gradle folder

Note: Clean Project sometimes does not remove generated files.

like image 26
T D Nguyen Avatar answered Oct 11 '22 02:10

T D Nguyen