How to get my Android project from one computer to the other? - android

I have a laptop that I'm using to work on my app in Eclipse. I share the computer so it's not always available. How can I get the entire Android project from my laptop's Eclipse to the Eclipse on my PC? I don't want to email each individual file to myself and open it on the PC, either.

If you just want to copy your project from one computer to another, on the first one choose in eclipse: File->Export...->General->Archive file, then select project(s) to export, choose archive name and format and save it. Copy archive file to second PC. In the second eclipse choose: File->Import...->General->Existing Projects into Workspace->Select archive file. Select your archive, select project(s) to import. Voila!

If you want your project's source code to be open on the public, you can use github or Google code or something similar. Then you should install a plugin to Eclipse in order to be able to synchronize easy your code.
At my early steps, I was using Dropbox for project synching. It was good for projects that only one person writes to them. If many people participate, then this solution is a mess.
Also you can set up your own sych server, if you have a pc that is online 24/7 or when you need it. I tried to set up a Gitorious but I haven't managed to get it running 100%. So, for now I have an SVN server, and using the Eclipse plugin for SVN synching, I have everywhere I want my eclipse projects. To setup an SVN synch server is very easy and will not take more than a few hours(minutes??).

I'm surrounded by computers all day long, but I don't have access to install anything on them. My solution is that I made a Lubuntu Live USB drive that I then installed Eclipse and the Android dvelopment tools on. Luckily the BIOS is not locked on any of the computers so I boot the closest computer up using my USB drive as the OS and everything is exactly as I left it no matter which computer I'm at. When I am at home and I want to code I boot my desktop or laptop up using that drive as well.

Related

My First Android App Does Not Run In Mobile

i have prepared my first android app in android studio, but it run only in Android Studio Emulator not in mobile. Please help me by telling the simple solution so that i can distribute the app to others.
Thank You.
Click on the "build" tab in the android studio and then click on "build apk". After your android studio is finished building the apk, you will have an option to go to the folder where the apk is located. Go to that folder, select the .apk file and transfer it to your phone. After, make sure that your android phone has a permission to install apps outside of PlayStore. Install your app!
First you will need to create an .apk of your app through studio. If it successfully runs in Emulator, that is a good sign. Once the .apk is created. Save it to Desktop or wherever else you would like. Plug in your android device and open the device in File Explorer (or equiv. depends on OS). Copy the .apk to your device's Downloads folder. Once the copy is successful, eject your device from your computer. Open the file manager (whatever it is called, I don't personally own an Android, but I had to fix my cousin's :p) on your device. Go to Downloads and click the .apk you just transferred to the device. A dialog should come up asking if you would like to install the app. Click yes, or install, or the equivalent. Go to your Apps view and it should be there.

Android Studio debugging inconsistency

I'm not sure this is a common issue, I have Android studio installed on my window pc and my mac laptop and on and off I will switch between both.
Just now I was cleaning up my source code and delete a .xml file from the layout folder and I debug using my phone to make sure it is a working before I upload to the server for other programmers to access it.
Later on the programmers said that there are errors in my file and ask me to look into it, so I immediately switch to my mac and try to debug it and I got the error as well. Later found out that I didn't remove the activity call from AndroidManifest.xml for the previous deleted .xml.
To make sure I did not get the wrong version of my build I try again on my window pc with the errors and perform debugging and surprisingly there isn't any error and the emulator run smoothly. How is that possible?
do you use version control aka team, git, subversion vcs. I believe android studio does this automaticaly via vcs on main menu. githubis another form of this concept. When a team works together it is common to have a local copy of source code and a remote repository on a server. You also may have different branches or versions of the local and/or remote source code. If you find out what version control you use and you still need help post a comment back.
By the way android studio is now using gradle so you can now have free and paid flavors of the same app and i can see that could cause problems.

Work on an Android program with several computers

I am developing a project from work, but would like to be able to take the project home and continue it. I can't just "open" a project, so what are the settings to save it on one computer, then open it from home, then save it again to work on it from home?
I use Dropbox. My Eclipse workspace is inside my Dropbox folder, so whenever I load up Eclipse on any of my computers, I always have the most updated versions of my files without any hassle.
This also gives you the added benefit of not having to worry about a harddisk failure and being able to rollback files.
Either do as Glendon said or setup a subversion or git repository.
I usually do both.
If you're not using Dropbox or github, I assume you're emailing the code or using a USB drive. After you've unzipped your project to your other computer's home directory, run Eclipse and do
File, New, Android Project
enter the Project Name
in Contents, select Create project from existing source
in Location, browse to the directory you just created in your home directory
choose a Build Target
and click Finish assuming the other settings have been filled in for you.
I do the same thing by putting a bare git repository on a memory stick and cloning it onto all development machines.
As the repositories on the development machines are cloned from the one on the stick, their "origin" will point back to the memory stick. So all I have to do when bouncing from one development machine to the other is
<insert memory stick>
cd <work_directory_on_harddisk>
git pull
...write code
git push
<remove memory stick>
and I am done.
What is nice about this is that even if you forget the stick, or forget to synchronize and end up working on an outdated directory, you can untangle it easily with all the power of git.

Huh? Android Preferences page refuses to load after adding SDK 1.6

This one is really weird. I had a perfectly working Eclipse + Android 2.2 SDK working in both Administrator account and LUA (Limited User Account) under Windows XP.
Then I decided to add the Android 1.6 SDK (I could do it from an Administrator account only). It seemed to have gone well, since it still works perfectly -- but only in that Administrator account!
When I try to start Eclipse under a LUA, I receive the following error message box:
Which disappears within 2-3 seconds and replaced with:
I then tried to check the Preferences page, but again, all I receive is error messages:
and:
Any idea why this is happening and how to fix this?
(I would love to be able to continue working from a LUA)
Update: I have uploaded the error log file (referred to in the "Show Error Log" in the message boxes), for your expert examination. Hopefully this can shed some light on the mystery.
The full answer is somewhat complex, concerning Eclipse's configuration area, the workspace area, etc. This is all documented on the Eclipse site, if you're interested.
But there's a simpler, more immediate approach, since you're not trying to run multiple users simultaneously on the same copy, over a network -- in which case you'd need the full answer.
Simply install Eclipse in a directory, say, C:/dev/Eclipse. Make sure both your limited user and your admin have write access to everything. Run Eclipse as the limited user. It should start right up, as there's nothing privileged that is needed by Eclipse.
At this point, you can lock it down as read-only if you desire. By default, all the configuration is stored within the Eclipse installation directory.
I'd suggest starting with a fresh install at this point, to eliminate any inconsistencies that you may have introduced. Though you should be able to reset things by deleting all the subdirectories of the configure/ directory (but not the config.ini). There's an official way to do that, but that's part of the full answer. :=)
I'd also suggest using a different workspace for each user, to avoid any permissions problems.
But my BIG suggestion is -- upgrade to Windows 7, and do NOT run Eclipse as an administrator!
Anyway, once you have it working -- to upgrade in the future, make the Eclipse directory completely writable by the limited user, and then update as the limited user, and then make it read-only again if needed.
Note: This is the cheating way. The REAL answer is to give each user their own configuration directory. This is only viable because you have control over both users and can coordinate any updates.
Try running eclipse by downloading the binary and unzipping and directly running the .exe rather than "installing" it. The android tools should work this way if you configure the appropriate paths to them, and if eclipse isn't "installed" but simply run from a the archive folder, it should try to download plugins and such into its own directory (owned by your user), which may solve your problem.
I doubt the Android developers who built the tools run under LUAs, so they probably didn't run into this problem...
Workaround found: Run Eclipse as Administrator (Right-click exe/shortcut, then select "Run as...", then enter Administrator's password).
This is a workaround, not a solution, but it does allow me to continue working while logged in LUA.
Thanks to #David who suggested this solution here: Android ADT Plugin doesn't show up in Eclipse
Update: Solution found:
Enable the Security tab in Windows XP Pro (""Use Simple File Sharing.")
Add the LUA account to C:\eclipse with Modify permissions.
That's it. No need to run Eclipse via "Run as". Also eliminates the need for a fresh install (which takes more time).

Moving Android/Eclipse project to new PC

Well, I hosed up my Android development PC, but didn't care all that much since I really needed a newer, much faster PC for this work. And here I am now with a high-end Windows 7 64-bit box.
Eclipse and all the Android components are up and running, but the one thing I'm having trouble with is how to get my previous project into the new workspace. I copied over my entire old workspace directory from the old disk and made that my Eclipse workspace, but it doesn't automatically see the projects that are there. I tried creating a new Android project "from existing source", but it complained about having "overlapping projects" or some such.
Is there a way to have it recognize the existing project files, or should I move them somewhere else, create the project from scratch, and then copy the old files back into the project tree? Or any other solutions?
A super easy way is by just doing an Import.
Select File Import.
Select Existing Projects Into Workspace and click next.
Select the directory of the project file.
Click Finish.
You will have to do this for each project. Note, that you may need to remove the project folder that you copied into the workspace manually, because this procedure will automatically copy the folder and hierarchy for you.
I used this method to code on my home machine as well as a development environment running from a live CD while attending classes in the computer lab.
Get Dropbox.
Put your workspace in a Dropbox folder.
Point the new machine's Eclipse install to your
Dropbox workspace folder after it
has updated itself.
Get back to coding.
Hope this works for you. It did for me.
There was one other complication. On my "old" PC I had been using Eclipse Helios, which apparently has some minor compatibility issues with ADT, so on my new PC I went with Galileo instead, and there might be some differences in existing files in the project directory.
In any case, what I did was to move my old project directory to a temp location, create a new project in Eclipse with the same name and basic settings, close Eclipse, copy my whole directory tree back into the new project directories, and then restart Eclipse. Eclipse bitched a bit about something, then went ahead and rebuilt everything.
I'm back in business! Thanks for all the responses.
BTW, the entire install process took a long time since I wasn't sure whether to install 64-bit Java or 32-bit (32-bit was required), etc. But it's nice to be running on a clean, fast PC instead of one that's been accumulating general crud for several years.
Move each of the projects in your hard disk to the new PC's workspace, or wherever you want to have them. Do not copy the metadata folder!. Then create new projects from existing sources (yes, you'll have to manually do this for each of the projects)
Ger
I know that this is old question but it is a issue I ran into when moving my project over from my home theater PC to my new laptop so I can leave my HTPC to doing HTPC things. Anyways what I did was I imported my project from over the computer over the network to my new laptop using new android project from existing code. The files where populated but it changed my root folder name. Being OCD I wanted to change the name of the root folder back to what I had on the other machine. I found if I right clicked the item in the project tree and selected refactor I could rename it back to what it was on my HTPC. This then resulted in my laptop having a exact working copy of the code so I can program from here.
You can copy whole Workspace just through import>General>Existing Projects into Workspace>Select root Directory>finish
Have you checked if the export/import eclipse mechanim works fine with 2 linked projects: android and app engine?

Categories

Resources