Académique Documents
Professionnel Documents
Culture Documents
Activities
A single screen that a user can see An application typically has multiple activities Concept of activities can be easily understand by comparing an Android application with a website
Intents
Messages that are sent among the major building blocks (for example, to start or stop an activity or service) Intents are asynchronous Could be explicit (the sender clearly mentions a specific receiver) or implicit (the sender mentions the type of receiver)
Intents Example
Services
Run in the background and dont have any user interface components Useful for actions that we want to perform for a while, regardless of what is on the screen For example, listening music while flipping between applications
Content Providers
Interfaces for sharing data between applications Data that belongs to an application is usually isolated Although we also use intents for sharing information, content provider are suited for large datasets
Content Providers
Broadcast Receivers
Androids implementation of a system-wide publish/subscribe mechanism. They are also called observer patterns The receiver is a piece of code that gets activated once an event to which it has subscribed occurs
Application Context
Android major building blocks together make up an application They live inside the same application context Application context refers to the application environment It gets created whenever first component of an application starts (that component can be any building block) Reference to context can be obtained
Context.getApplicationContext() Activiy.getApplication()
Step # 1: Java
When you write Android applications, you typically write them in Java source code. That Java source code is then turned into the stuff that Android actually runs (Dalvik bytecode in an APK file). Hence, the first thing you need to do is get set up with a Java development environment and be ready to start writing Java classes.
Step # 1: Java
This is what we did in the last week