I am creating an android app using Android Studio. In the project view, apart from the main folder where all my classes are stored I also have "androidTest" and "test" folders (marked with red in the image). I did not created these folders and I believe Android Studio generated these folders. What are these folders for? Is it safe to delete them?
Yes, you can delete them (and you can delete their references from the gradle file), but why even bother? These files are just there to nudge you do the right thing.
They're like the broccoli that your mother might put on your plate even though she probably already knows that you're not going to eat them. You could refuse them and even delete them, but there is really little to no point in doing that.
If you want less visual clutter, just use the "Android View" instead of the "Project View" and don't expand those particular test folders.
These folders are created by default for testing your code
src/test - Unit Tests
src/androidtest - Android Instrumentation tests
[Read more]
Related
Typically when I use Android studios the project files on the side bar are all nice, organized and clean; having App - (manifest, java, res, assets) Gradle Scripts -
I like when it is like that. But for some reason, every so often when I open a project, typically one that I did on another computer with Android Studios, the files come in all expanded, That is they look like they just came out of the folder looking something like this: .gradle- .idea- app -(build, libs, src, .gitIgnore, app.iml, build.gradle, progaurd-rules.pro) build- gradle- And Still more. It is messy any unorganized. Even more, my namespaces are all expanded, so when I view files I have to expand the folders way out.
Android studios when working the way I like puts the namespaces into one folder, that is there will be a folder that is called com.etc.whatever and it doesn't have to be expanded way out.
So how do I get it back to normal?
You must change your project structure to Packages. it may work.
explore the other option given in project structure.
I'm using Android IDE to develop, and I need to move source files from one folder to another, but I can't seem to find a way to actually MOVE a file (even copy and delete in two steps would work).
Am I blind? This seems like a required feature of any IDE, and given how good Android IDE is, I find it shocking if this feature was overlooked.
NOTE: This question is NOT about Android Studio!
You are right. The (essential) feature to move files around is missing from Android IDE.
Workaround:
You can manipulate the files in any explorer. Your project files are placed in /sdcard/AppProjects/YourProject.
You can count on the fact that such a feature will not be missing for long.
I would download a file manager (I like root browser) and switch between the two apps as a temporary work around. That app is updated fairly often so I would also just shoot the developers a feature request. I am sure they would consider it essential as you do.
PREFACE: Use a file manager; this hack renames Java classes.
Rename, with the relative path as the new name.
Let's say I wanted to move file from /sdcard/A to /sdcard/B. I'd long-press on file, chose rename, and type the new destination as ../B/file.
This doesn't seem like deliberate feature, rather a side effect of blindly passing path strings to the underlying framework. Can't say I don't like it, although, I'd recommend using a proper file explorer app.
Right-mouse click on any element (folder, Class, or XML file) the click = 'cut'.
Right-mouse click on the folder where you would like the files to be moved to, and then select 'paste'.
This works the same as moving files in the file-system.
For the most part (depending on where you are moving to and from) you can just drag-and-drop your files to move them as well.
I often achieve this goal by simply drag and drop. And the IDE also takes care of all the refactoring stuff.
While modifying a white label app, I needed to change a logo and found it was located in 2 locations (duplicated):
res/drawable and similar folders (for other screen depths)
bin/res/crunch/drawable and similar folders (for other screen depths)
So I would like to know if I should care about the second folder, or if it's something generated by Eclipse/ADT.
They are automatically generated on build. You can ignore them.
The crunch is used to export the app by eclipse and I've experienced a problem that a drawable was not updated in a crunch. If you want to be really sure that you deliver what you see, just clean the res/crunch/drawable before exporting.
Based on my experience, i believe that this is because of import from one machine to another one. (mostly, like 64-bit to 32-bit)
Just delete the folder crunch... activity will run fine.
I would like to be able to change the default subdirectories created as part of an Eclipse ADT project. That is, instead of "res" and "bin" I would like to have something else.
With most kinds of Eclipse projects it seems pretty straightforward -- there are a few places where you go to change different core subdirectories, you go there and change them, and that's pretty much that.
With the ADT plugin for Eclipse, it seems that if you refactor "res" to "resources" for example a new folder called "res" gets automatically added anyway. The same seems to be true for "bin" and "gen."
Where do I start to look to learn more about what causes this automated behavior and how to change it?
I'm not sure you can, as they are strictly defined by Android
http://developer.android.com/guide/topics/resources/providing-resources.html
http://developer.android.com/guide/topics/resources/available-resources.html
Why do you want to change the names?
I'm a newbie with Eclipse and Android. I have a legacy project from an
SVN repository which I could import and use under Eclipse Helios. Also
changes inside and outside Eclipse are synchronized fine with the SVN.
Now the problem: The project structure consists of a root directory,
referring to a src path, which exists outside the root (i.e. on the
same level as the root of the project is). I guess this has been
arranged by the designer, because the src part has been referenced
from different java projects for different platforms. I think this is
not such a bad idea.
However: Whatever I do I can't make Eclipse and SVN synchronize
changes on files located in this "outer" directory. What do I have to
do in order to make both aware of the outer parts, w/o being forced to
change the file/dir structure completely?
Kind regards
From what I understand from your description you did the following ?
You Removed the src folder created by eclipse during the first check out.
You create a linked src folder (when you created it, instead of just accepting all the defaults, you opened the "advanced" dialog box and checked the radio button saying Link...(Linked Folder) and you filled in the location where you wanted that "outer" src folder to be located).
You updated from the repository.
But when you look at the updated folders, the src that has been updated is really under the root rather than the one you have shifted away.
Can you confirm my understanding ?
If not, then you might try the procedure outlined above.
Unless there are twists in the ADT I don't know about (a little bit like in hierarchical maven projects where you can "export as Maven subproject"), I cannot see any other scenario that would lead to the problem you describe.