regarding Backing-up a work-space in Eclipse [duplicate] - android

I got into this learning the Android Operating System. I'm still in learning mode. Along with learning Android, Seems I'm getting a bit of a refresh on Java, and because most of the examples I find expect you to use Eclipse... well I guess I'm also learning Eclipse (This is a good thing, I'm not complaining)... This question is primarily about Eclipse, and how to perform a rudimentary save of my current state.
I'm running without a Version Control system. Something I will fix once I have a good feel for where I'm going, what I want, and what I need it to do, so for the moment, I'm just looking for some advice on how to save (perhaps quite crudely) my current state of affairs, and be able to restore to that point if I manage to mess up my world.
Question 1:
If I just copy my entire workspace to a different location (CD Rom?). and then perform tasks / experiments - on the original workspace (Create new projects, create project from existing sources, deleting projects.... all in the saved workspace) and really manage to trash the workspace, or maybe I just want to go back to my saved point, and try the same things in a different manner.... Will exiting Eclipse, deleting the modified workspace recreating the workspace at the same location, from the CD Rom, and maybe running "Clean All Projects" - safely put me back to my origin saved point?
Question 2:
If not. What do I need to do, to accomplish something morally enlivenment to this?
Perhaps this is already answered in some web documentation I haven't found. Pointers to a couple of well written web pages may be all I need?
Thanks for any advice
Joe

You don't even have to delete your workspace. In one of the menus there should be an option like "Change Workspace". I believe this will accomplish what you want. Just change your workspace to the backup.

Eclipse saves almost everything into the workspace so backing that up is sufficient in most cases. The only other instance I have encountered is installed plugins which are saved under the eclipse folder.
Be sure you backup "hidden" files as .settings is hidden on some OSes.

You just have to copy your work-space back to your PC and use that work-space from eclipse to return back to your saved projects..

Related

Should I "copy project into workspace" external Android libraries or use the default root location?

When importing libraries like appcompat, which are maintained and updated by SDK manager, into a workspace should I copy them into the workspace or use from their root location? If I copy it into my workspace and if Google updates it then I will have to manually update it too, so it seems leaving them in their root location like ~/sdk/extras/.../appcompat sounds like a better option.
Just my opinion, but I think it would be far better to copy the library for a single, very good reason: you don't want the android tool to update the dependencies of your project, but it's something you really want to take in your hands instead.
Should you need more convincing think about this scenario:
You have project A and B, both using the same library, linked to the same directory.
Maybe you are working on C, when you find out that google udpated the library and this will probably fix a terrible bug in your project. Months later you go back to project A, and you find out that it's not working anymore.
Now, after all that time, what are the odds of you remembering that you updated the libraries one month before? :)
Oh, and let's not mention the odds of getting the "old" version of the library (should you not be using a code revision system) to make A work again...
Hope this helps

Eclipse compare project with local history not available?

I was looking for an easy way to backup an android project in eclipse and found this question: Android is there a easy way to back up your android project? the selected answer states that "You can also revert to a previous version if you are using Eclipse. Eclipse has this nice functionality called Local history that allows it. Right click on a file and use "compare with..." -> "Local History"."
However when I right click on the project and click compare with I only see the diabled option "Each other"
I checked Preferences > General > Workspace > Local History but everything seems ok.
Why isn't Eclipse backing up my project? What do I do to enable the option compare with local history?
EDIT I was clicking on the project folder and realised this function only works for individual files, what I am looking for is to restore the entire project. Is it possible to enable this on Eclipse?
Nope, it just does it file per file. Eclipse is not meant to be used as a version control mechanism. Notice that even though that's the "accepted" answer, it has only one upvote. The one with more upvotes is what you're looking for in this case. Just invest a little time to use a real Version control mechanism (like Git).
Also, Eclipse would not really "back up" anything, since everything would still be local and if your hard drive crashed, everything would be bye bye anyway.
Are you against an SVN? I use Subversive and it seems to work fine for backing up/creating new projects and updates/restoring to older versions if necessary. You can set up a repository on a separate web server or on a local file server. You can get local history but I don't believe this is very reliable. I would use regualar backups or set up an SVN. Once you get it set up and install the plug-ins, it works pretty well.

Android Marketplace Updates & Eclipse Projects

So I have managed to get a couple apps up on the marketplace only to have a stray thought of what is the best way to go about managing my projects/apps within eclipse to accommodate future updates to the marketplace. My question resides within Eclipse and what to do with my projects/apps as I apply updates.
Do I simply copy my project/app, paste it and the increment the version information accordingly? Or am I continuously working on my published project/app? Or...Is there a recommended/preferred method of going about this. Since they are up and good on the marketplace I am leery of doing something that will cause problems for me later on down the line.
And don't change the package name....correct?
This is what I currently have on the Marketplace...
Wind Chill Calculator
True Love Game
First of all, everyone's posts were very helpful and I have spent some time looking over documentation through the links provided.
So...and brace for impact as I say this. Being one who has NEVER used any form of SCM for my projects this is all new to me (as everyone's faces cringe), which is why I am asking the original question in the first place. I hate to say tell me anything without doing my research...so within the past few hours using git within eclipse I have gleamed the following:
Team > Share Project ...ignores...any tags(for version info)which is what I am after...commits...THEN
Clone? File -> Import -> Git -> Git Repository at this point once I have cloned my project do I create a new tag with the new version info, and go through the commit process again? If this is the case I now have two items in my Git Repository. One of which has the single tag of 1.0, and the other item which contains two tags 1.0 and 1.1, and when I look at the history I see two tags Version 1.0 and Version 1.1. Then I just switch between the resources I need from within the repository?
I just want to make sure my process is correct before I begin to implement some of this on existing projects that are pretty extensive already. As for the rest I am just going to learn on the fly...branches
You might want to use a revision control system like SVN or git or one of dozens of other options, and continuously update the single project in Eclipse. The benefit of using source control is that you can branch into a new project for major changes, update your existing code for minor changes, and tag the branches so you can revert back to an old snapshot in the future.
I personally use bitbucket which is hosted remotely and is free. It supports SVN and Mercurial.
No, dont change the package name, that will make it new app, instead of upgrade of original.
Use a version control system, like SVN.
Manage Tags for a complete working state of code(through svn), so you can always revert back to that tag.
When ready for new release, increment version no. etc and update on market...
EDIT After addition in question:
Don't get much confused with various GIT/SVN working.. There main purpose is that they will allow you to switch your code back and forth to any point in past, that allows you to code in a way properly knowing that you can always revert back to a Working state.. and it is definitely of much more benefit in a Team , when multiple people are working on same codebase and possibly same files...
Being a long-time user of SVN, I recommend subclipse (svn for eclipse). When you're ready to release another version of your app, create a 'tag' for the release version and you'll always be able to go back to that exact version.
SVN has excellent docs. There is also TortoiseSVN for repo work outside of eclipse.

IntelliJ Android cache build with drawables ignores changes

I have a minor issue with the way IntelliJ caches files or builds (not sure about terminology here).
Situation Abstract:
Library module
DrawableA
DrawableB
App module
DrawableA
Assume library images are black and white, App ones are color.
The app shows (correctly) the colorful A.
The app shows (correctly) the black and white B (means its missing).
Now I add an image to App project, Drawable B, in color.
If you simply press "run" he will keep using black and white B
If you "rebuild project" he will use the correct one
If you try "Make" and "Compile" manually on Lib and App NO EFFECT
To clarify, this issue is really special. It only occurs if the DrawableB is NOT present in the App module. If you have it, but the WRONG one, and you update it, it works. I assume its an internal caching of IntelliJ, and he does not recognize that I added a drawable (and he has to use it from the App now, not the LIB). Perhaps its something in the google build of Android projects, not enough info about the internal here...
I know, the obvious tip is "do a rebuild of the whole project" - that said, I have 18 App modules, each for one App. The rebuild takes forever (on one of our machines without SSD), and its not neccessary. If I change something in e.g. AppX, I only need to rebuild AppX and the Library. But there seems to be no option for it.
Does anyone know a workaround, like deleting BIN or other cache folders via script? Cant split up the modules in different "projects", would loose refactoring capabilities.
Crosspost here, check before wasting time to answer (this site here is more frequented and faster, but this issue is so specific, cant hurt to ask the developers too)
http://devnet.jetbrains.net/message/5446674
Try to rebuild project. Smtm i have same problem and it helps me.
Can you try it with the new IntelliJ Idea version 12? It seems to handle cached resources pretty well.

Library based application installs 2 APK files, not one - Why?

I am trying to restructure an existing app so that, except for a few override-able methods in a derived activity, all code will reside in a library. This still doesn't work for some reason, but in the process of attempting to troubleshoot this, I discovered much to my dismay that there are two .apk files installed, not one (when I run a debug session from eclipse):
The first (and larger file) is
having the original library name.
The second (only 20KB in size) is
having the derived application name.
Why is that and where can I learn more about this?
Could that explain the ClassNotFoundException problem I am having?
I found the answer myself. It turns out that I had 2 critical settings in the Properties of both projects not set correctly:
In the library project, "Is Library"
was not checked for some reason. I
could swear that I checked it, but
knowing how whimsical the Android
development environment under
Eclipse can be, I suspect that it
was unchecked by Eclipse (or the ADT
plugin) as a result of some glitch.
In the application project, I
neglected to add my library project
as a reference via the Add...
button. (how dumb could I be?)
Hoping this can be useful for other newbies to come.

Categories

Resources