1. Trang chủ
  2. » Luận Văn - Báo Cáo

Báo cáo Thực hành Lập trình di động bằng Android Studio

133 71 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 133
Dung lượng 3,68 MB

Nội dung

Báo cáo tổng hợp thực hành lập trình di động cơ bản bằng Android Studio. Ngôn ngữ lập trình: Java, Kotlin.TABLE OF CONTENTCHAPTER I. INTRODUCTION TO ANDROID STUDIO61. Android Studio61.1. Download Android Studio for Window61.2. Install Android Studio72. Components in an Android project132.1. Activities132.2. Service142.3. Content Providers142.4. Broadcast Receivers152.5. Additional Components153. Folders and files in a project153.1. Manifests folder163.2. Java folder163.3. Resources folder173.4. Gradle scripts173.5. The Android Project View174. Create an Adroid project184.1. Configuration184.2. Run the application224.3. My First App25CHAPTER II. LAYOUT AND MEASUREMENTS281. Android Layouts281.1. What is layouts in an android application?281.2. Common layouts292. Measurements312.1. Dots per inch322.2. Density independence in Android323. Design a Simple Calculator33CHAPTER III. INTERACTIVE COMPONENTS AND EVENT HANDELING391. Basic Components392. Android UI Controls392.1. TextView392.2. EditText402.3. Button402.4. RadioButton402.5. Checkbox402.6. Spinner402.7. TimePicker402.8. DatePicker412.9. Toast413. Event Handling413.1. Event listeners413.2. Event handlers413.3. Event listeners registration424. Design a simple app to perform Event handling424.1. Design424.2. Event handling475. Design a simple app using Radio Button, Checkbox Toast485.1. Design485.2. Event Handling516. Program a Calculator Application52CHAPTER IV. DESIGN AND CUSTOMIZE UI561. Listview562. Custome listview563. Design a simple app using list view563.1. Design563.2. Event handling594. CTU form604.1. Design614.2. Event handling68CHAPTER V. DATABASE MANAGEMENT – SQLITE741. SQLite in Android742. Design a simple app using SQLite752.1. Design752.2. Event handling823. Reproduce application873.1. Design883.2. Event handling914. Program an electrical index recording application974.1. Design974.2. Event handling116CHAPTER VI. GOOGLE FIREBASE1301. Google Firebase1302. Group Project1302.1. Requirement1302.2. Design1302.3. Program130REFERENCES131

TABLE OF CONTENT CHAPTER I INTRODUCTION TO ANDROID STUDIO Android Studio 1.1 Download Android Studio for Window 1.2 Install Android Studio Components in an Android project 13 2.1 Activities 13 2.2 Service 14 2.3 Content Providers 14 2.4 Broadcast Receivers 15 2.5 Additional Components 15 Folders and files in a project 15 3.1 Manifests folder 16 3.2 Java folder 16 3.3 Resources folder 17 3.4 Gradle scripts 17 3.5 The Android Project View 17 Create an Android project 18 4.1 Configuration 18 4.2 Run the application 22 4.3 My First App 25 CHAPTER II LAYOUT AND MEASUREMENTS 28 Android Layouts 28 1.1 What are layouts in an android application? 28 1.2 Common layouts 29 Measurements 31 2.1 Dots per inch 32 2.2 Density independence in Android 32 Design a Simple Calculator 33 CHAPTER III INTERACTIVE COMPONENTS AND EVENT HANDLING 39 Basic Components 39 Android UI Controls 39 2.1 TextView 39 2.2 EditText 40 2.3 Button 40 2.4 RadioButton 40 2.5 Checkbox 40 2.6 Spinner 40 2.7 TimePicker 40 2.8 DatePicker 41 2.9 Toast 41 Event Handling 41 3.1 Event listeners 41 3.2 Event handlers 41 3.3 Event listeners registration 42 Design a simple app to perform Event handling 42 4.1 Design 42 4.2 Event handling 47 Design a simple app using Radio Button, Checkbox & Toast 48 5.1 Design 48 5.2 Event Handling 51 Program a Calculator Application 52 CHAPTER IV DESIGN AND CUSTOMIZE UI 56 Listview 56 Custom listview 56 Design a simple app using list view 56 3.1 Design 56 3.2 Event handling 59 CTU form 60 4.1 Design 61 4.2 Event handling 68 CHAPTER V DATABASE MANAGEMENT – SQLITE 74 SQLite in Android 74 Design a simple app using SQLite 75 2.1 Design 75 2.2 Event handling 82 Reproduce application 87 3.1 Design 88 3.2 Event l intent = Intent(this, NewCustomerActivity::class.java) this.startActivity(intent) } 128 // ADD NEW RECORD findViewById(R.id.btn_add_rec_atv).setOnClickListener { val intent = Intent(this, NewRecordActivity::class.java) this.startActivity(intent) } listView.setOnItemClickListener { adaterView, view, position, id -> val itemPos = adaterView.getItemAtPosition(position) val tmp = adaterView.getItemIdAtPosition(position) Log.d("Clicked: ", itemPos.toString() + " " + tmp.toString()) var intent : Intent? = null if (displayRec == true) intent = Intent(this, RecordActivity::class.java).apply { putExtra(REC_ID, itemPos.toString()) } else intent = Intent(this, CustomerActivity::class.java).apply { putExtra(CUS_ID, itemPos.toString()) } this.startActivity(intent) } } fun viewCustomers(view: View) { val databaseHandler = DatabaseHandler(this) val customers: List = databaseHandler.viewCustomers() val cusIds = Array(customers.size) {-1} val cusNames = Array(customers.size) {"null"} var index = for (customer in customers) { cusIds[index] = customer.cusId cusNames[index] = customer.cusName ++index } val customerAdapter = CustomerAdapter(this, cusIds, cusNames) listView.adapter = customerAdapter } fun viewRecords(view: View) { val databaseHandler = DatabaseHandler(this) val records: List = databaseHandler.viewRecords() val recIds = Array(records.size) {-1} val cusNames = Array(records.size) {"null"} val days = Array(records.size) {"null"} var index = for (record in records) { recIds[index] = record.recId cusNames[index] = databaseHandler.findCustomerName(record.cusId) days[index] = record.day ++index } val recordAdapter = RecordAdapter(this, recIds, cusNames, days) listView.adapter = recordAdapter } } 129 4.2.11 maninfests/AndroidManifest.xml CHAPTER VI GOOGLE FIREBASE GOOGLE FIREBASE Firebase is a mobile application development platform from Google with powerful features for developing, handling, and enhancing applications Firebase is fundamentally a collection of tools developers can rely on, creating applications and expanding them based on demand Firebase aims to solve three main problems for developers:  Build an app, fast  Release and monitor an app with confidence  Engage users Developers relying on this platform get access to services that they would have to develop themselves, and it enables them to lay focus on delivering robust application experiences 130 Some of the Google Firebase platform’s standout features include databases, authentication, push messages, analytics, file storage, and much more Since the services are cloud-hosted, developers can smoothly perform on-demand scaling without any hassle Firebase is currently among the top app development platforms relied upon by developers across the globe [14] 131 REFERENCES [1] "Android - Application Components," Turtorialspoint, 2021 [Online] Available: https://www.tutorialspoint.com/android/android_application_components.htm [Accessed 2021] [2] "Project Overview | Android Developers," 2021 [Online] https://developer.android.com/studio/projects [Accessed 2021] Available: [3] Praveenruhil, "Androi Project Folder Structure," 2021 [Online] Available: https://www.geeksforgeeks.org/android-project-folder-structure/ [Accessed 2021] [4] A Chugh, "Android Studio Project Structure, Compiler, ProGuard," Joural Dev, 2016 [Online] Available: https://www.journaldev.com/9319/android-studioproject-structure-compiler-proguard [Accessed 2021] [5] Treehouse, "How to Make an Android App for Beginners," Youtube, 21 2018 [Online] Available: https://youtu.be/EOfCEhWq8sg [Accessed 2020] [6] "Creat an Android project | Android Developers," [Online] Available: https://developer.android.com/training/basics/firstapp/creating-project [Accessed 2021] [7] "Android Layout and Views – Types and Examples," DataFlair , 2020 [Online] Available: https://data-flair.training/blogs/android-layout-and-views/ [Accessed 2021] [8] "FrameLayout | Android Devlopers," [Online] Available: https://developer.android.com/reference/android/widget/FrameLayout [Accessed 2021] [9] "Dots per inch - Wikipedia," Wikipedia, 23 2021 [Online] Available: https://en.wikipedia.org/wiki/Dots_per_inch [Accessed 2021] [10] "Top Android UI Controls that you must know about!," Data Flair, [Online] Available: https://data-flair.training/blogs/android-ui-controls/ [Accessed 2021] [11] "Android Event Handling – Manage the Action of Users Interaction," Data Flair, [Online] Available: https://data-flair.training/blogs/android-event-handling/ [Accessed 2021] [12] "Android Custom ListView (Adding Images, sub-title)," javaTpoint, [Online] Available: https://www.javatpoint.com/android-custom-listview [Accessed 2021] [13] "Android SQLite Tutorial," javaTpoint, [Online] https://www.javatpoint.com/android-sqlite-tutorial [Accessed 2021] Available: [14] G Batschinski, "What is Firebase? All secrets unlocked," 2020 [Online] Available: https://blog.back4app.com/firebase/ [Accessed 2021] 132 [15] "Android Application Components with Implementation & Examples," Data Flair, 2021 [Online] Available: https://data-flair.training/blogs/android-applicationcomponents/ [Accessed 20121] [16] "Developer Guides | Android Developers," 2021 https://developer.android.com/guide [Accessed 2021] [Online] Available: [17] Praveenruhil, "Android UI Layouts," GeeksforGeeks, 11 11 2019 [Online] Available: https://www.geeksforgeeks.org/android-ui-layouts/ [Accessed 2020] [18] "ConstraintLayout Tutorial for Android: Complex Layouts," 2021 [Online] Available: https://www.raywenderlich.com/9475-constraintlayout-tutorial-forandroid-complex-layouts [Accessed 2021] 133 ... maninfests/AndroidManifest.xml ...

Ngày đăng: 30/08/2021, 14:58

TỪ KHÓA LIÊN QUAN

w