Best way to Backup project - android

Hey guys simple question here. Whats the best way to back up an android project? I use eclipse. I'm fairly new and not sure what I need to back it up. Do I need just the project or do I need the meta data also? Thanks guys

If I'm understanding you correctly you want to make a backup of your project? If you've never used version control before, now would be a great time to start! Version control will not only provide you with what you're looking for but many other great features. There's plenty of different SCM's available for you to choose froml; Git, SVN, Mercurial and so on.
Otherwise if all you want is to copy the project to another location, open your eclipse workspace folder (the directory you defined when you first started eclipse) and copy the project directory from there. Or do as MarchingHome suggests.

I always directly copy the entire folder of the project in the eclipse workspace.
You can import that later in eclipse via File --> Import --> General --> Existing project into workspace.
You can there select the folder and everything will be restored.
Hope this helps.

As long as you work alone and on always the same machine, you can simply backup the entire project folder with the help of a version control system like git. This will help you keep track of all the changes you make and lets you undo any code changes. You can use github as a reliable remove service. If you aren't familiar with it yet, then it might take some reading to get into, but afterwards you life will be much easier.

You need the metadata. There are a few files in the top level project directory when you use eclipse: .cproject (this might only be if you use CDT plugin), .project and sometimes a .settings directory. Basically, you need all the dot files/dirs. You can just zip up the directory and that should be enough.
That said, if you try and open that project and the paths have changed, you'll probably get errors. Same for if you're missing vital plugins used by your project.
What you should be doing is using some sort of revision control. Try git or mercurial. Eclipse has plugins for them as well.

Related

How to merge 2 android projects

HI I have and android project A, I have been working on it, and also a friend of mine has been working on it, so now I have 2 projects A-Mine and A-Friend (I have nor svn, cvs nor git). Is there a way to get a diff of or to merge them, using ecplise or tortoise or anything (windows based)
Thnak u very much best regards Ignacio.
Now's a great chance to set up source control! Commit your version into source control, have your friend check it out, create a new branch and recursively copy all his files into it. Then just use the tools provided by your source control software of choice to merge those changes into the main branch. Done!
As I thought my friends there is always another way, Turns out ecplise won't allow you to open twice same project in the same workspace, but you can very well match up files and folders with simple windows copy + paste, so what is what you do? Yo open one project in eclipse and paste the renamed folders of the second project. the you can use Eclipses Compare With tool, to match up all files in a certain directory.
Clean, easy and fast

Most rational and painless way to work on the same Eclipse Android project on two different PCs

I have a project that I develop partly at the work pc and party at my home PC.
Export-Import-Export-IMport and so on
And every day I spend a good amount of my time trying to resolve those annoying build path and configuration issues. Today I have written two lines of code and I have wasted the rest of my time dealing with all kinds of errors you could imagine.
And this hell repeats daily.
So I thought
Could I install Eslipse ADT on a flash drive and have my workspace on the flashdrive as well, so once the configuration is set up properly, I will be able to finally concentrate on development?
I could equalize the number of drives of both my PCs so the flash drive always appears as with same drive letter, if that could be an issue?
I really want to find a way to use the same IDE installation and the same workspace at two computers. Not two different IDE's.
Every time my project needs a new library I have to install it on both computers and it goes to a different directory and then I have to set the project to use it and when I switch computers all settings are wrong again.
This happens to me aswell. Your problem is that Android uses some external libraries, which on every computer, are located on a different directory.
Those libraries, are referenced in a file named project.properties.
All you've to do, is use a GIT or a SVN as a link to your home - work. And then, add several ignores, basically:
project.properties
bin
gen
This will kill any troubles.
In Eclipse, the project contents and the workspace are logically separate (although the default location when creating a project is place its contents in the workspace folder on disk, it doesn't have to be that way). Workspaces can not be shared between computers or users, but project contents should be. That includes all of the configuration files that make up a project (.project, .classpath, etc).
You could use a portable storage location like a flash drive or Dropbox to store just the project contents, and import it into each different Eclipse workspace you want to work on it in (ie, each different computer), but you'll need to always remember to Refresh the entire project every time you start to work in the workspace and there's a potential for human error to screw things up. I second the other recommendations to use some sort of source control system like cvs, svn, git, etc to check files in/out for working on different workspaces/PCs. I've done that many times with good results.
Why can't you just setup you favorite IDE once then export/import your settings to another PC?
That way you'll deal with IDE config issues.
Then configure Maven build for your project so all the dependencies and stuff can be resolved automatically during the build process.
And as last step you should setup git repo for the project - Github/Bitbucket, for example.
Leaving home => push all your daily work; came home => pull all updates and continue working.

How to use a Android Studio project on two computers?

I use two computer for coding. My desktop pc and the notebook. I sync the two computers with dropbox. How can I import/load a project on each of this two computers? The project base folder is different on each computer. When I try to load/import a project which is created on the other computer it loads the project but I got a error with a wrong path.
"Gradle "Test2Project" project refresh failed:
Could not fetch model of type "IdeaProject" using Gradle distribution "http://services.gradle.org/distributions/gradle-1.6.zip".
Project directory "C:\Users\thomas\AndroidStudioProjects\Test2Project" does not exist."
The wrong pfad is the right pfad on the other computer. How can I import Android Studio projects so that it works even on another computer with a different folder structure?
Like the others i agree, that using a VCS would be the best solution. Even though you can try to filter all android studio related files (like *.iml, .idea folder and local.properties). I don't know if you can do this with dropbox or if you need some kind of 3rd software.
After that you should be able to make source code changes on both computers without greater problems. (You may have to declare project dependencies changes for the android studio twice)
Builds depending on the build.gradle files should work to. But again: using a VCS is the better way to go.
Go for git, you can use bitbucket.com as a free remote repository.
This is a problem I have ran into when trying to store Android projects in a Dropbox folder. What happens is that Machine 1's IDE is mapping system resources (like the SDK) as being in that machine's filesystem. When you go to Machine 2, everything will work EXCEPT for what you expect--because the SDK will probably be in a different spot!
One way to get around this is to use your VCS (dropbox, git, whatever) as a repository for JUST your source files, and then have a local project created on each machine that reads from the Dropbox folder. This requires two separate projects that are mapped differently, but that have the same source folder.
I discovered this problem when I tried to load up an Android project on a new install on a Mac machine:
Do you see what's happening there? My Mac Android Studio is saying, "Hey, I don't see where "C:\Android\SDK is, but I do see that you have an Android SDK in a different folder, so I'm going to update your project files to reflect the actual location of the SDK."
In my opinion, the only way around this is to create your project on both machines, and version control your source and assets folder. If you don't create the project separately on each machine and use VCS for just the source and assets, the only way to get around build and filepath errors is to store your SDK in the same folder on each machine. This worked for me when I was building on a Windows desktop and Windows laptop, but no longer works for me since I am using a Macbook Pro.
I know this was questioned about 4 years ago, but this is up to now still an issue. Using a VCS seems like a good solution, but for me it is simply more overhead than i want to have. I also use Dropbox to synchronize my folders and the history they provide is for my private programming needs good enough. So i think, it would be good, if android studio simply uses relative paths.
I know it needs some system paths and it does a good job in looking at the local.properties and setting it to the correct place when the project is loaded.
The main problem with using Dropbox are the build-directories. There are many many references to fully qualified paths in the files within these directories. So my solution was to exclude the build-directories from Dropbox-synchronisation.
When you work at your laptop, build the app, create new files, change files or delete files, the build on your pc will be completely outdated when you switch back to it. but android studio will recognize this and do a fresh build when you start your project for the first time after working on the laptop.
so the biggest problem at this point is the file local.properties and this is handled correctly by android studio. it may be a good idea (or a really bad one, i don't know the drawbacks) when the build system wouldn't write fully qualified paths in the files within the build directory.
But up to now this is my solution for using Dropbox and not using a VCS:
exclude build-paths from Dropbox synchronisation
i hope this helps somebody.

Which folders in an Eclipse Android project do I need to back up in SVN?

It's all in the title really: I don't want to include folders that are generated by Eclipse - I just want to know what's the minimum I need to include in my SVN backup.
I'm guessing AndroidManifest.xml, src, assets (empty in my case) and res. What about libs, which contains android-support-v4.jar? Anything else?
My SVN is external to eclipse as I have several projects in different languages and TortoiseSVN itself, which I use, is installed on my PC. So I don't want to use any integrated plug-in.
Thanks.
PS: I checked other similar questions/answers but none really answered this.
First off, SVN is not a backup, it's version control. Don't use it as a backup.
Second, there is no difference if you use the integrated plugin, the command line client or some UI tool.
Finally, what you don't want to put in VC are generally generated files and files specific to your workspace (if multiple people are working on the code). For Android projects, generated files include the bin/ and gen/ directories. You might want to put libs/ in VC for convenience, but it is not strictly necessary, since you can get the libraries from somewhere else. On the other hand putting them in VC guarantees that everyone is using the same version. Workspace-specific files are Eclipse's .settings/, .metadata, etc. It is also advisable to keep your project code and the Eclipse workspace directory separate, so that you can recover easily when Eclipse messes up.
So, exclude the above and put everything else in VC.

Another Eclipse/Android/version control system question

I saw the question in this post and I have a similar but perhaps more detailed question. I have just installed SVN and Subversive and I added an existing project to a repository. Then I checked out the project and opened it. Unfortunately, in Eclipse, the Subversive layout has taken over the Android layout in the Project Explorer view and I'm not too happy about that.
In other words, the Android layout organizes the project under src, gen, assests, res, and other nodes, whereas the Subversive layout organizes the project strictly by the folder structure under the repository. Is there any way to use a source control plug-in AND keep the Android layout? If not, I may just resort to removing the Eclipse version control plug-in and manually use TortoiseSVN.
I remember having a similar issue with my team.
we thought that having the eclipse plug in would be a great idea (handling everything from the same app) but we got lots of problems with the layout and the conflict resolution.
my advice is to keep editing in eclipse(neat beans or whatever IDE) and use tortoise in your explorer to commit, and when you update hit F5 and continue coding ^^

Categories

Resources