Tìm kiếm theo tiêu đề

Tin tức cộng đồng

[MỜI HỢP TÁC] Các kỳ thi Olympic Quốc tế 2026 (IMO - IEO - ISO)

Kính gửi Quý Lãnh đạo, Ban Giám hiệu và Quý Thầy/Cô, FermatTech (Đối tác Google tại VN) phối hợp cùng SCO Ấn Độ trân trọng kính mời tham gia 3 kỳ thi uy tín dành cho HS từ lớp 1 - 12: - IMO: Olympic Toán Quốc tế. - IEO: Olympic Tiếng Anh Quốc tế. - ISO: Olympic Khoa học...
Xem tiếp

Tin tức thư viện

Chức năng Dừng xem quảng cáo trên violet.vn

12087057 Kính chào các thầy, cô! Hiện tại, kinh phí duy trì hệ thống dựa chủ yếu vào việc đặt quảng cáo trên hệ thống. Tuy nhiên, đôi khi có gây một số trở ngại đối với thầy, cô khi truy cập. Vì vậy, để thuận tiện trong việc sử dụng thư viện hệ thống đã cung cấp chức năng...
Xem tiếp

Hỗ trợ kĩ thuật

  • (024) 62 930 536
  • 0919 124 899
  • hotro@violet.vn

Liên hệ quảng cáo

  • (024) 66 745 632
  • 096 181 2005
  • contact@bachkim.vn

Android Fundamentals

Wait
  • Begin_button
  • Prev_button
  • Play_button
  • Stop_button
  • Next_button
  • End_button
  • 0 / 0
  • Loading_status
Nhấn vào đây để tải về
Báo tài liệu có sai sót
Nhắn tin cho tác giả
(Tài liệu chưa được thẩm định)
Nguồn: Internet
Người gửi: Nguyễn Tuấn Kiệt
Ngày gửi: 10h:19' 30-12-2013
Dung lượng: 376.5 KB
Số lượt tải: 11
Số lượt thích: 0 người
@2011 Mihail L. Sichitiu
1
Android Introduction
Application Fundamentals
@2011 Mihail L. Sichitiu
2
Goal
Understand applications and their components
Concepts:
activity,
service,
broadcast receiver,
content provider,
intent,
AndroidManifest
@2011 Mihail L. Sichitiu
3
Applications
Written in Java (it’s possible to write native code – will not cover that here)
Good separation (and corresponding security) from other applications:
Each application runs in its own process
Each process has its own separate VM
Each application is assigned a unique Linux user ID – by default files of that application are only visible to that application (can be explicitly exported)
@2011 Mihail L. Sichitiu
4
Application Components
Activities – visual user interface focused on a single thing a user can do
Services – no visual interface – they run in the background
Broadcast Receivers – receive and react to broadcast announcements
Content Providers – allow data exchange between applications
@2011 Mihail L. Sichitiu
5
Activities
Basic component of most applications
Most applications have several activities that start each other as needed
Each is implemented as a subclass of the base Activity class
@2011 Mihail L. Sichitiu
6
Activities – The View
Each activity has a default window to draw in (although it may prompt for dialogs or notifications)
The content of the window is a view or a group of views (derived from View or ViewGroup)
Example of views: buttons, text fields, scroll bars, menu items, check boxes, etc.
View(Group) made visible via Activity.setContentView() method.
@2011 Mihail L. Sichitiu
7
Services
Does not have a visual interface
Runs in the background indefinitely
Examples
Network Downloads
Playing Music
TCP/UDP Server
You can bind to a an existing service and control its operation
@2011 Mihail L. Sichitiu
8
Broadcast Receivers
Receive and react to broadcast announcements
Extend the class BroadcastReceiver
Examples of broadcasts:
Low battery, power connected, shutdown, timezone changed, etc.
Other applications can initiate broadcasts
@2011 Mihail L. Sichitiu
9
Content Providers
Makes some of the application data available to other applications
It’s the only way to transfer data between applications in Android (no shared files, shared memory, pipes, etc.)
Extends the class ContentProvider;
Other applications use a ContentResolver object to access the data provided via a ContentProvider
@2011 Mihail L. Sichitiu
10
Intents
An intent is an Intent object with a message content.
Activities, services and broadcast receivers are started by intents. ContentProviders are started by ContentResolvers:
An activity is started by Context.startActivity(Intent intent) or Activity.startActivityForResult(Intent intent, int RequestCode)
A service is started by Context.startService(Intent service)
An application can initiate a broadcast by using an Intent in any of Context.sendBroadcast(Intent intent), Context.sendOrderedBroadcast(), and Context.sendStickyBroadcast()
@2011 Mihail L. Sichitiu
11
Shutting down components
Activities
Can terminate itself via finish();
Can terminate other activities it started via finishActivity();
Services
Can terminate via stopSelf(); or Context.stopService();
Content Providers
Are only active when responding to ContentResolvers
Broadcast Receivers
Are only active when responding to broadcasts
@2011 Mihail L. Sichitiu
12
Android Manifest
Its main purpose in life is to declare the components to the system:


   
                          android:icon="@drawable/small_pic.png"
                  android:label="@string/freneticLabel"
                  . . .  >
       

        . . .
   


@2011 Mihail L. Sichitiu
13
Intent Filters
Declare Intents handled by the current application (in the AndroidManifest):



   
                          android:icon="@drawable/small_pic.png"
                  android:label="@string/freneticLabel"
                  . . .  >
           
               
               
           

           
               
               
               
           

       

        . . .
   


Shows in the Launcher and is the main activity to start
Handles JPEG images in some way
 
Gửi ý kiến