Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why don't we have a single file to open an Android Studio Project?

Why don't we have a file similar to the .xcodeproj (for XCode applications) or an .xds (for Sencha Architect Projects) for our Android Studio Project?

I'm pretty sure a good number of you here have experienced the frustration of trying to import a project you see online in order to piece it apart better and learn how it works. I get that we are supposed to Import Android Projects built using Eclipse and Open Android Projects built using Android Studio.

However, why is it that we have to go through File -> Open -> then pick out the directory of the Android Studio app that we want to open? And the thing is, Android Studio doesn't seem to know it's an Android Studio project until it tries to open and build it. In the screenshot I have below, I have the sample Android Studio projects of ARToolKit, but I've only imported two of them.

screenshot

As you can see, only those I've imported "can be seen as an Android Studio Project" as indicated that they have the Android Studio logo instead of a Folder.

This can be an issue for those just starting to develop in Android Studio on their own and they try and use existing projects (build from Eclipse or Android Studio) and they hit a snag with just trying to import the projects for reference. They might not know that they should import the folder and not the projectname/src subfolder. It adds to the "steep learning curve" that Android Development has if opening/importing projects aren't streamlined to a degree.

To sum up, my question is:

Why don't we have a single file that we can open that would in turn open Android Studio and import and build the project if it isn't built yet?

like image 656
Razgriz Avatar asked Nov 11 '16 14:11

Razgriz


2 Answers

Android is not iOS. iOS development is only possible in xcode, hence it makes sense they added a shortcut to open it in xcode directly with a .xcodeproj file. Make life easier for iOS developers.

Android development however can be done outside of android studio as well. Eclipse is just one example, there may be other IDE's that support this. This is possible because android has standalone SDKs and tools that third party applications can use. iOS does not.

Imagine you are working on an android project in android studio. Then your boss tells you someone from 3000km away is going to help you. This guy may be using android studio, but maybe he isn't. When there are multiple options that developers can choose from individually, you do not want to pollute version control with files that you are using, but others may not care about. Each their environment.

This is merely a logical conclusion that you can come to by comparing. The "real" reason why this was done can only be answered by the people that created (adapted intellij) android studio.

like image 129
Tim Avatar answered Oct 21 '22 18:10

Tim


This has been very frustrating to me too.

I try to give you a "beta" answer, waiting somebody to confirm it to me.

An Android project is just the composition of many parts that in some cases are concurrent to create the apk file. It's just like what happens for the whole java projects: you have the main/src/java, the main/src/test, the maver or gradle files, the gradle or maven wrapper, the manifest, the configuration etc. So you won't have a single project, but a series of folders that can contain many "flavours" or "versions" of the product itself.

The only help it is given to us is the Android studio icon that appears if a folder contains an android project in its subfolders.

I don't know if I have really answered to you, I just have given you my impressions and my thought.

like image 24
Alex Mawashi Avatar answered Oct 21 '22 18:10

Alex Mawashi