3. Android Studio 2.0:
default project
structure
app (module)
Gradle scripts
(module)
Gradle is the official build
system for Android Studio.
Its configuration is set in
the files contained here.
The application
The application’s
specification is
defined here
4. app (module)
manifests java
res
Stores the
app’s
manifest file The externalized app’s
resources are stored in
the different
subdirectories of the
project’s res directory
The app’s source
code is placed here
5. manifests
AndroidManifest.xml
The application
The AndroidManifest.xml
file must be in the root
directory of the application.
The information presented
here is essential. It's a must,
in order the app's code to
run.
Required elements:
<manifest> <application>
The
application
Required attributes:
xmlns:android ->
defines the Android
namespace. It must
always be set to:
"http://schemas.a
ndroid.com/apk/re
s/android"
package -> the
unique package
name for the
application. One
the app published,
the package name
cannot be
changed.
Theapplication
The app's components
are defined here.
By default, some
attributes (icon, label,
theme) are set to default
values
<activity>
The application
Each of the app's activities must be
described in the manifest via a separate
<activity> element. Otherwise they would
not be run.
6. java
main project
directory androidTest
test
The
application
The source code
for the whole
application is
contained here.
The content of
this module is to
be built into .apk
file and installed
on a device.
MainActivity
ApplicationTest
ExampleUnitTest
Testing
modulesThe applicationJUnit tests
inserted here
7. resdrawable
layout mipmap
values
Here are
stored
resources "that
can be drawn"
(.jpg, .png, .
9.png, .gif) or
XML files that
can be
compiled into a
drawable
resource
subtype)
Stores drawable files for
different launcher icon
densities. The launcher
icon reference in the
AndroidManifest.xml
should be altered as well:
android:icon="@mipmap/
ic_launcher"
The XML files from
here are compiled into
screen layouts.
Different layouts could
be provided for
different densities
External
resources
for the
application’s
elements
8. valuescolors.xml
dimens.xml strings.xml
styles.xml
A set list of colors
provided. The
color is specified
with an RGB
value and optional
alpha channel.
<color
name="red">
#ff0000</color>
Defines different
customization
based on the
physical device
density of the
screen
The text strings for
the application are
stored here.
<string
name="app_name
">Test</string>
Here we
specify the
format and the
look for the
user interface
(UI).
The styles can
be differently
applied to:
1) Views
2) Activities
3) The
application
itself
dimens.xml dimens.xml
(w820dp)