Android Studio - Difference between Import project and Open project - android

I have been using Android Studio since one of the first releases (about one year ago, since I/O 2013)
However I have recently noticed that in the first screen when lets you to create a project there are also Open and Import project options, and I cant find any difference between them
I remember that in Eclipse, import project would make a copy of the project in the workspace... However, in Android Studio there is no workspace as far as I know...
So, what are the differences between Import project and Open project?

I think there is no much difference if you are working with gradle project. Since Android Studio tries to sync project every time when project is opened.
However there is difference if you try to import Eclipse project folder. In this case it will migrate it to gradle project structure.
Watch this new IO video talk to get more about tools https://www.youtube.com/watch?v=hu4U8XKmJGA

Related

Github Desktop, how to import projects into Android Studio

The title says it all. I have recently downloaded Github Desktop in my belief that it would be easier to import projects into android studio. However, I have not found a way to do that. Any suggestions?
Cheers.
I'm unsure if you may have tried this or where you are in the process, but the best way I've seen to import an existing Android project is to import it via the build.gradle. If you already have a project open in Android Studiuo, your're going to want to go to File->Close Project and then from the "Welcome to Android Studio" screen click "Import project(Eclipse ADT, Gradle etc)" and then navigate to your project's build.gradle.

Automatically Migrating projects to gradle in Android studio

I made some apps in the past with android studio, and there was no problems with them.
And I could open example projects from many sites, for example: developer.android.com/.
Now after an update of android studio, I can't open projects in android studio without migrating them manually, which was done before the update by android studio itself.
What could be the problem now?
First I get this warning, that android framework is detected.
Then after choosing the setup frameworks and clicking ok, I get this:
As you can see it is not gradle based project.
What can I do to make android studio automatically migrate projects again?
IMPORTING ANDROID STUDIO PROJECT IN ANDROID STUDIO:
If you want to import An Android Studio Project then do the following:
1.
Select Open an existing Android Studio Project
2. Browse your desired project derectory.
3. Now rather than selecting the folder that contains your project, you have to select the build.gradle file that is just inside of your parent folder of the project.
It will not create any problem and will not ask you to migrate into gradle and import any framework at all.
IMPORTING ECLIPSE PROJECT IN ANDROID STUDIO:
If you want to import Eclipse Project in Android Studio:
1. Select Import project (Eclipse ADT, Gradle, etc.)
2. Then nothing special just follow the instructions in the wizard.

Importing and converting Eclipse-made Android project from Github to Android Studio Gradle-build

I'm trying to migrate from using Eclipse for my Android-project to the new Android Studio, and I'm having an issue related to Gradle.
What I want is for me to push the latest Eclipse-build to Github, and then be able to pull it down in Android Studio, having the latter automatically convert the project to a Gradle-build. If I'm reading the documentation right, the Android Studio import is supposedly able to do this.
When importing, I can choose between "Create project from exisiting sources" or "Import project from external model"
If I choose the first option, the project won't use Gradle (as far as I can see). If I choose the second, it seems to be looking for an already existing gradle buildfile "build.gradle" in my project.
So - Should I download a Gradle-plugin to Eclipse and make a gradle build-file there, or am I doing something wrong in the import?
It seems the only other questions I can find on SO is about importing and Eclipse export or simply how to pull a project from Github in Android Studio.
Thanks :-)
Importing and converting an existing Eclipse project into a Android Studio Gradle project is quite simple :
File -> Import Project (in Android Studio)
Select the manifest of your Eclipse Android project.
Done.
There may be some dependacy management to deal with.
You can also take a look here :
How do you import an Eclipse project into Android Studio now?
How about this:
clone repo to location 1
export from eclipse
import to android studio in location 2
copy the .hg files or whatever's applicable from 1 to 2
commit from location 2 including deleting eclipse files
Now the repo will have the android studio project and not eclipse.

Import Sibling Module in Android Studio

I have an Android project recently converted to Gradle from Maven/IntelliJ. The project has a traditional maven structure with the app and sdk projects being sibling projects referenced through the nexus. I can import either of the projects into Android Studio correct and build them, but when I try to import the SK as a module into the app project (which is what we did in IntelliJ) Android Studio basically refuses to import it. I'm using Android Studio 0.8.2. The actual error I get is either
Specify location of the Gradle or Android Eclipse project
if I select the SDK's .iml file or
Select modules to import
if I select the build.gradle file or the root directory.
I would like to avoid converting to the current Gradle super project mechanism because that would require new source control and would lose valuable history.
What I have tried:
Separate projects, works but doesn't allow SDK debugging and generally is a pain to manage due the multiple windows.
Using an empty super project. This gets both projects in the same windows, but Android Studio no longer detects the project's source controls. IntelliJ would correctly identify the sibling source controls in the previous configuration.
Is there any way to get Module Import to work in Android Studio like in IntelliJ?

Migration from Eclipse to Android Studio

So,
as it seems that more and more people are using Android Studio i got curious and wanted to take a peek at it.
I have used Eclipse up until now and wanted to migrate a project to Android Studio. So i exported a gradle buildfile from within Eclipse, as android.developer.com suggested.
That worked fine, now i wanted to import that into Android Studio 0.3.2
When trying to import i got that Unable to import Eclipse project to Android Studio error. Now it is building.
But it got a new suprise, now before it is finished building, its asking specifically for an older Version of Gradle(1.6)... Ok, i can do that. Which leads me right back to the first error. So i tried this - Gradle version 1.6 is required. Current version is 1.8-20130730220035+0000
I can however create a New Project with Android Studio.
I've tried this for about an hour now and im getting sort of pissed, because it doesnt seem to know what it wants. Is it some sort of Bug or did i make some sort of mistake.
You're using a very old version of Android Studio. I'd recommend upgrading to 0.4.3. Versions later than 0.4.0 allow direct import of Eclipse projects instead of requiring you to do the cumbersome (and as you've seen problematic) export of projects from Eclipse; it's smarter about setting up the right plugin and Gradle versions. 0.4.3 has some important bugfixes over 0.4.0-0.4.2.
I've just migrated my projects. Here is two suggestions from my side.
Take the latest Android Studio.
Do not export / import projects from Eclipse. Most likely you are going to have errors in the project after this step. Starting from a clean project, which builds, will safe you a lot of time and avoid unnecessary frustration.
Create an empty Android Project in Android Studio. It must build without errors (⌘ F9). The start to enhance it using official Gradle Plugin user guide.
Create libraries folder and add all libraries in there one by one. Update build.gradle dependencies as mentioned in user guide. Make sure everything builds successfully.
After all libraries build you can copy-paste sources, resources and assets from Eclipse project to corresponding folders of Android Studio project. Make sure everything build as expected.
Now you can start with more advanced configuration like ProGuard configuration, release certificates etc.
I've done it in a couple of hours. Hope this helps you too.

Categories

Resources