2. - Android as OS
- Android vs Java
- General concepts in development
- Interestingness
- Features
Agenda
3. File-oriented system
Android as OS
What does it mean?
It doesn't matter where the file is, in all programms
which support it, we see it.
*.doc for office
*.fb2 for readers
4. Work with memory
Android as OS
Android knows when it needs more memory and can
close your application.
We need to save important info.
5. Android is not framework
Android vs Java
The Android SDK provides the tools and APIs necessary
to begin developing applications on the Android
platform using the Java programming language.
6. Many APIs are similars
Android vs Java
but you don't have all J2SE APIs.
Android uses its own library built on a subset of the
Apache Harmony Java implementation.
You can use java jars if they use only compatible APIs.
7. Android doesn’t use JVM
Android vs Java
it has has special VM Dalvik*.
Code compiles to standart java byte-code and next it
converts, with utility dx, to .dex formart to next
interpritation on VM Dalvik.
*Dalvik - fishers island in Iceland
8. General concepts in development
Gradle
Gradle is an open source build
automation system that builds upon
the concepts of Apache Ant and
Apache Maven and introduces a
Groovy-based domain-specific
language (DSL) instead of the XML
form used by Apache Maven of
declaring the project configuration.
9. General concepts in development
Activity
An Activity is an application component that provides a screen
with which users can interact in order to do something, such as
dial the phone, take a photo, send an email, or view a map. Each
activity is given a window in which to draw its user interface.
10. General concepts in development
Activity
An Activity is an application component that provides a screen
with which users can interact in order to do something, such as
dial the phone, take a photo, send an email, or view a map. Each
activity is given a window in which to draw its user interface.
11. General concepts in development
Layout
A layout defines the visual structure for a user interface, such
as the UI for an activity or app widget. You can declare a layout
in two ways:
Declare UI elements in XML.
Instantiate layout elements at runtime.
15. General concepts in development
Service. Broadcast receiver
A service is a component that runs in the background to
perform long-running operations without needing to interact with
the user and it works even if application is destroyed.
Broadcast Receivers simply respond to broadcast messages
from other applications or from the system itself. These
messages are sometime called events or intents.
16. General concepts in development
Android manifest
Every application must have an AndroidManifest.xml file
(with precisely that name) in its root directory. The manifest file
presents essential information about your app to the Android
system, information the system must have before it can run any
of the app's code.
18. Features
Lifecycles
Many components in Android have its own lifecycle. Android
system calls a series of lifecycle methods on the component
which running now in the user interface or other components in
background.
Activity lifecycle
19. 1 dp = 0.75 px
1 dp = 1 px
1 dp = 1.5 px
1 dp = 2 px
1 dp = 3 px
Features
dp instead of px
Density-independent pixels (pronounced “dips”) are flexible
units that scale to uniform dimensions on any screen. When
developing an Android application, use dp to display elements
uniformly on screens with different densities.
low (ldpi)
medium (mdpi)
high (hdpi)
extra high (xhdpi)
extra-extra-high (xxhdpi)
20. Features
Simple localization
Put the application's default text in a file with the following
location and name:res/values/strings.xml (required directory)
You want to localize all the text in your application to
Ukranian. In this case, you could create second alternative
strings.xml files, each stored in a locale-specific resource
directory:res/values-uk/strings.xml
If the device is set to any language other than Ukranian, Android will load title
from the res/values/strings.xml file.
If the device is set to Ukranian, Android will load title from the res/values-
uk/strings.xml file.
21. Interestingness
Firebase
Firebase's is a NoSQL database which provides an API that
allows developers to store and sync data in realtime to every
connected client. Database is storing in JSON.
When data changes, the Firebase automatically sycn it with
connected clients. Before data has been writen to server it saves
in local, what gives possibility to working offline.