withCompose)Android Basics with Compose is a self-paced,
onlinecourseonhow to build Android apps using the latest best practices. It coversthebasics of building apps with Jetpack Compose, the recommendedtoolkitfor building user interfaces on Android. A) Intoduction of Android Basics with Compose: It is an introductory course designed by Googletohelpnewdevelopers get started with building Android apps usingJetpackCompose. This Compose is a modern fully declarativeUItoolkitforAndroid which simplifies UI development by allowingdeveloperstodefine user interface in a more intuitive Kotlin-basedlanguage.Course assumes little to no prior Android development experience&is perfect for those who want to learn howto create appsfromscratchusing latest tools & best practices. In this course, you will learn the key componentsofJetpackCompose, such as: Navigation: Creating intuitive app navigation withJetpackCompose’s navigation component. B) Course Goals: State Management: Handling user interactionandupdatingtheUI dynamically. Layouts: Ways to arrange composables on the screen, includingtools like Column, Row, and Box. Composables: Reusable UI components that makeiteasytodefine the app's layout. 1. Understand the fundamentals of Kotlin and JetpackCompose.2. Build a series of basic Android apps. 3. Use Android app architecture, Jetpack libraries andworkwithdataaccording to Modern Android Development practices. C) Prequisities: 1. Basic computer skills. 2. Basic math skills. 3. A computer that can run Android Studio (see systemrequirements)(Optional) Android device. | 8 Units | 5 Unit - 1 Your first AndroidAppLearn programming basics and create your first Android app. 1. Write simple Kotlin programs that display text output. 2. Download and install Android Studio. 3. Build App with a simple user interface that displays text &images. 4. Run the app on a device or emulator. | 3 Pathways | 1.1 Introduction to Programming in Kotlin: This course is for people who want to learn howto build AndroidappsintheKotlin programming language using the latest best practices recommendedbyGoogle.You will build a series of apps using Jetpack Compose, which is the modernwaytocreate beautiful user interfaces (UIs) in your Android apps. You'll work through codelabs which are step-by-step codinginstructionsforhow to build an app or a feature for an app. If you're more of a visual learnerwhowants to watch how it's done first, some of these codelabs are accompaniedbycode-along videos. There are also practice problems to reinforce what youlearned&projects that provide you with the opportunity to experiment and learnmoreonyourown. Learning is a personal experience that's different for everyone. Dependingonyour background & experience there are several options for howyoucannavigatethiscourse effectively. 1.2 Setup Android Studio: Install Android Studio on your computer if you haven't donesoalready.Check that your computer meets the system requirements required for runningAndroidStudio (located at bottom of download page). If you need more detailedinstructionsonthe setup process, refer to Download and install Android Studio codelab. In this codelab, you create your first Android app with a project templateprovided by Android Studio. You use Kotlin & Jetpack Compose tocustomizeyourapp. Note that Android Studio gets updated & sometimes the UI changessoitisokayif your Android Studio looks a little different than screenshots in this codelab. 1.3 Build a Basic Layout: Jetpack Compose is a modern toolkit for building AndroidUI. JetpackCompose simplifies and accelerates UI development on Androidwithlesscode,powerful tools, and intuitive Kotlin APIs. The user interface (UI) of anappiswhatyousee on the screen: text, images, buttons, and many other types of elements. Composablefunctions are the basic building block of Compose. A composable function is a function that describes some part ofyourUI.Composable function is annotated with @Composable annotationthisannotationinforms Compose compiler that this function is intended to convert dataintoUI.3basic standard layout elements in Compose are Column, Row&Box. TheyareComposable functions that take Composable content so you can placeitemsinside.Example each child within a Row will be placed horizontally next to eachother. ***** 6 Unit 2 Building AppUI Continue learning fundamentals of Kotlin & start building more interactiveapps.1. Use conditional, function type, classe & lambda expression in Kotlin. 2. Understand how composition and recomposition works. 3. Add a button to an app UI and respond to user taps. 4. Create an app that works with data entered by the user. 5. Learn how to use state to display data & reflect changes automaticallywhendatagets updated. 6. Write unit tests to test isolated functions | 3 Pathways | 2.1 Kotlin Fundamentals: Your trafficLightColor program looks more complexwithmultipleconditions, also known as branching. You may wonder whether youcansimplifyaprogram with an even larger number of branches. In Kotlin, when you deal with multiple branches, you canusethewhenstatement instead of the if/else statement because it improves readability, whichrefers to how easy it is for human readers, typically developers, toreadthecode.It'svery important to consider readability when you write your code becauseit'slikelythat other developers need to review and modify your code throughout itslifetime.Good readability ensures that developers can correctly understandyourcodeanddon't inadvertently introduce bugs into it. when statements are preferredwhenthereare more than two branches to consider. 2.2 Add a Button to an App: - Define composable functions. - Create layouts with Compositions. - Create a button with the Button composable. - Import drawable resources. - Display an image with the Image composable. - Make an interactive UI with composables. - Use remember composable to store objects in Composition to memory. - Refresh UI with the mutableStateOf()function to make an observable. 2.3 Interacting with UI & State: This codelab teaches you about state, and howit canbeusedandmanipulated by Jetpack Compose. At its core, state in an app is any value that can change over time.Thisdefinition is very broad and includes everything froma database toavariableinyour app. You learn more about databases in a later unit, but for nowall youneedtoknow is that a database is an organized collection of structured information, suchasthe files on your computer. ***** 7 Unit 3 Display Lists &Use Material DesignBuild apps that display a list of data & learn howto make yourappsmorebeautiful with Material Design. 1. Use data classes, functions, and collections in Kotlin. 2. Create a scrollable list in an app that displays both text and images. 3. Add click listeners to interact with list items. 4. Add an app bar to the app and modify the app theme. 5. Use Material Design to build modern and intuitive user interfaces, usingcolors,shapes & typography. | 3 Pathways | 3.1 More Kotlin Fundamentals: Over the decades, programmers devised several programminglanguagefeatures to help you write better code— expressing the same idea withlesscode,abstraction to express complex ideas, and writing code that preventsotherdevelopers from accidentally making mistakes are just a fewexamples. TheKotlinlanguage is no exception, and there are a number of features intendedtohelpdevelopers write more expressive code. Unfortunately, these features can make things tricky if thisisyourfirsttime programming. While they might sound useful, the extent of their usefulnessand the problems they solve may not always be apparent. Chancesareyou'vealready seen some features used in Compose and other libraries. 3.2 Build a Scrollable List: In this codelab, you learn how to make a scrollable list inyourappusingJetpack Compose. You will be working with the Affirmations app, whichdisplaysalistofaffirmations paired with beautiful images to bring positivity to your day. Thedataisalready there, all you need to do is take that data and display it in theUI. 3.3 Build Beautiful Apps: Material Design is a design system built and supportedbyGoogledesigners and developers to build high- quality digital experiences for Android,aswell as other mobile and web platforms. It provides guidelines onhowtobuildyourapp UI in a readable, attractive, and consistent manner. In this codelab, you learn about Material Theming, whichallowsyoutouse Material Design in your app, with guidance on customizing colors, typography,and shapes. You can customize as little, or as much, as you like for yourapp.Youalso learn how to add a top app bar to display the app's name and icon. ***** 8 Unit 4 Navigation &App ArchitectureLearn the best practices of app architecturetobuildmorecomplex apps. Enhance your users' ability to navigateacross, intoandback out from the various screens within your app for aconsistentandpredictable user experience. - Explain activities and their lifecycles. - Understand Modern Android architecture. - Use StateFlow & UDF pattern to work with state andevents. - Add a ViewModel to save data and state. - Set up and use the Navigation component with Compose. - Understand what responsive UI is. - Use window class sizes to build for different screensizes. - Add a navigation drawer to an app. | 3 Pathways | 4.1 Architecture Components: In this codelab, you learn about a fundamental part ofAndroid:the activity lifecycle. During its lifetime, an activitytransitionsthrough, and sometimes back to, various states. This transitioningofstates is known as the activity lifecycle. In Android, anactivityistheentry point for interacting with the user. In the past, one activity would display one screeninanapp.With current best practices, one activity might displaymultiplescreens by swapping them in and out as needed. The activitylifecycleextends from the creation of the activity to its destruction, whenthesystem reclaims that activity's resources. As a user navigatesinandout of an activity, each activity transitions betweendifferentstatesinthe activity lifecycle. As an Android developer, you need to understandtheactivitylifecycle. If your activities do not correctly respondtolifecyclestatechanges, your app can generate strange bugs, confusingbehaviorforyour users, or use too many Android systemresources. Understandingthe Android lifecycle and responding correctlytolifecyclestatechanges is an important part of Android development. 9 4.2 Navigation in Jetpack Compose: Up until this point, the apps you've workedonconsistedofa single screen. However, a lot of the apps youuseprobablyhavemultiple screens that you can navigate through. For example,theSettings app has many pages of content spreadacrossdifferentscreens.In modern Android development, multiscreenappsarecreated using the Jetpack Navigation component. TheNavigationCompose component allows you to easily buildmulti screenappsin Compose using a declarative approach, just likebuildinguserinterfaces. This codelab introduces the essentials of theNavigationCompose component, how to make the AppBar responsive,andhow to send data from your app to another appusingintents-allwhile demonstrating best practices in an increasinglycomplexapp. 4.3 Adapt for Different Screen Sizes: One of the great advantages of developingyourappintheAndroid platform is the vast opportunity to reachusersindifferentkinds of form factors, such as wearables, foldables, tablets,desktop, and even TV. When using an app, your usersmaywantto use the same app on large screen devices totakeadvantageofthe increased real estate. Increasingly, Androidusersusetheirapps on multiple devices of varying screen sizes, andexpectahigh-quality user experience across all devices. So far, you learned to make apps primarilyformobiledevices. In this codelab, you'll learn howto transformyourappstomake them adaptive to other screen sizes. You'll useadaptivenavigation layout patterns that are beautiful andusableforbothmobile and large screen devices, such as foldables, tablets,anddesktop. ***** 10 Unit 5 Connect to The Internet Use Kotlin coroutines to perform multiple tasks at once, andlearnabout HTTP and REST to get data from the internet using Retrofit. Thenusethe Coil library to display images in your app. 1. Describe basics of concurrency & how to use coroutines inanAndroidapp.2. Define and understand the data layer in Modern Android apparchitecture.3. Implement a repository to centralize data access. 4. Use Retrofit to retrieve data from a remote server. 5. Load and display images using the Coil library. 6. Implement dependency injection to decouple the classes, makingit easiertotest, maintain & scale the app. | 2 Pathways | 5.1 Get Data From The Internet: This codelab introduces you to concurrency, which is a critical skillforAndroid developers to understand in order to deliver a great user experience.Concurrency involves performing multiple tasks in your app at thesametime.Forexample, your app can get data from a web server or save user dataonthedevice,while responding to user input events and updating the UI accordingly. To do work concurrently in your app, you will be usingKotlincoroutines.Coroutines allow the execution of a block of code to be suspendedandthenresumedlater, so that other work can be done in the meantime. Coroutines makeit easiertowrite asynchronous code, which means one task doesn't need tofinishcompletelybefore starting the next task, enabling multiple tasks to run concurrently. This codelab walks you through some basic examples intheKotlinPlayground, where you get hands-on practice with coroutines tobecomemorecomfortable with asynchronous programming. 5.2 Load & Display Images From The Internet: In the previous codelab, you learned how to get data fromawebservicebyhaving the ViewModel retrieve the URLs of Mars photos fromthe networkusinganAPI service. While this approach works and is simple to implement, it doesnotscale well as your app grows and needs to work with more than onedatasource.Toaddress this issue, Android architecture best practices recommendseparatingoutyour UI layer and data layer. In this codelab, you will refactor the Mars Photos app intoseparateUIanddata layers. You will learn how to implement the repositorypatternandusedependency injection. Dependency injection creates a more flexible codingstructurethat helps with development and testing. ***** 11 Unit 6 Data PersistenceLearn how to store data locally on the deviceandkeepyour apps working through any network disruptionsforasmoothand consistent user experience. 1. Learn basics of SQL to insert, update &deletedatafromaSQLite database. 2. Use the Room library to add a database to anAndroidapp.3. Use Database Inspector to test and debug databaseissues.4. Use Preference DataStore to store user preferences. | 3 Pathways | 6.1 Introduction to SQL: Many of the apps you use store data directlyonthedevice.The Clock app stores your recurring alarms, the GoogleMapsappsaves a list of your recent searches, and the Contactsappletsyouadd, edit, and remove your contacts' information. Data persistence- storing or persisting dataonthedeviceis a big part of Android development. Persistent dataensuresuser-generated content isn't lost when the appis closed, ordatadownloaded from the internet is saved so it doesn't needtoberedownloaded later. SQLite is a common way provided bytheAndroidSDKfor Android apps to persist data. SQLite providesarelationaldatabase that allows you to represent data in a similar waytohowyou structure data with Kotlin classes. This codelabteachesthefundamentals of SQL—Structured Query Language—which,while not an actual programming language, providesasimpleandflexible way to read and modify a SQLite databasewithjustafewlines of code. After you gain a fundamental knowledge of SQL, you'llbeprepared to use the Room library to add persistencetoyourappslater in this unit. 12 6.2 Use Room for Data Persistence: Most production-quality apps have data that theappneedstopersist. For example, the app might store a playlist of songs, itemsonato-do list, records of expenses and income, a catalogof constellations,or a history of personal data. For such use cases, youuseadatabasetostore this persistent data. Room is a persistence library that's part of AndroidJetpack.Room is an abstraction layer on top of a SQLite database. SQLiteusesaspecialized language (SQL) to performdatabase operations. Insteadofusing SQLite directly, Room simplifies the chores of databasesetup,configuration, and interactions with the app. Roomalsoprovidescompile-time checks of SQLite statements. An abstraction layer is a set of functions that hidetheunderlying implementation/complexity. It provides aninterfacetoanexisting set of functionality, like SQLite in this case. The image below shows how Room, as a data source, fitsinwiththeoverall architecture recommended in this course. RoomisaDataSource. 6.3 Store & Access Data Using Keys with DataStore:In this unit, you have learned howto use SQL&Roomtosavedata locally on a device. SQL & Room are powerful tools. However,incases where you don't need to store relational data, DataStorecanprovide a simple solution. DataStore Jetpack Component isagreatwayto store small & simple data sets with lowoverhead. DataStorehastwodifferent implementations, Preferences DataStore &ProtoDataStore.Preferences DataStore stores key-value pairs. ThevaluescanbeKotlin's basic data types, such as String, Boolean, andInteger. Itdoesnot store complex datasets. It does not require a predefinedschema.Theprimary use case of the Preferences Datastore is tostoreuserpreferences on their device. Proto DataStore stores customdata types. It requiresapredefined schema that maps proto definition withobject structures.Only Preferences DataStore is covered in this codelab, but youcanreadmore about Proto DataStore in DataStore documentation. PreferencesDataStore is a great way to store user-controlled settings, &inthiscodelab, you learn how to implement DataStore to doexactlythat.***** 13 Unit 7 WorkManager Use Android Jetpack's WorkManager API to schedulenecessarybackground work, such as data backups or fresh content downloadsthatkeeps running even if the app exits or device restarts. 1. Define long running tasks that need to run in backgroundwork. 2. Add WorkManager to an Android app. 3. Create a Worker object and enqueue work. 4. Create constraints on WorkRequests. 5. Use Background TaskInspector to inspect &debug WorkManager.| 1 Pathways | 7.1 Schedule Tasks with WorkManager: WorkManager is part of Android Jetpack andanArchitectureComponent for background work that needs a combinationofopportunistic and guaranteed execution. Opportunistic executionmeansthat WorkManager does your background work as soonasitcan.Guaranteed execution means that WorkManager takes careof thelogictostart your work under a variety of situations, even if younavigateawayfrom your app. *****Unit 8 Compose withViews Learn how to use Compose and the older UI toolkit basedonViews side-by-side in the same app. In this unit, youwilllearninteroperability APIs and best practices to add a newfeaturetoanexistingapp in Views, use an existing library that uses Views, oruseaUIcomponent that is not yet available in Compose. 1. Understand the View-based UI toolkit and build appUI usingXML.2. Add a composable in an app built with Views. 3. Add Navigation component to app & use it to navigateb/wfragments.4. Use AndroidView to display views. 5. Add existing View-based UI components in a Composeapp. 14 | 2 Pathways | 8.1 Android Views and Compose in Views: So far, you learned all about building Android apps withCompose.That'sa good thing! Compose is a very powerful tool that can simplifythedevelopmentprocess. However, Android apps were not always built withdeclarativeUIs.Compose is a very recent tool in the history of Android Apps. AndroidUIswereoriginally built with Views. As such, it's highly likely that you will encounterViewsas you continue your journey as an Android developer. In this codelab, youlearnthebasics of how Android apps were built before Compose —with XML, Views,ViewBindings & Fragments. 8.2 Views in Compose: Conclusion of Android Basics with Compose:At this point in the course you are well versed in buildingappswithCompose and have some knowledge of building apps with XML, Views,ViewBindings, and Fragments. After building apps with Views, you might havecometoappreciate the conveniences of building apps with a declarative UI likeCompose.However, there might be some cases where it makes sense to use ViewsinsteadofCompose. In this codelab, you learn how to use ViewInterops toaddViewcomponents into a modern Compose app. At time of writing this codelab UI components you are set tocreatearenotyet available in Compose. This is perfect opportunity to utilize ViewInterop. Android Basics with Compose is play crucial roles inenhancingorganizational efficiency & important to keep accessibility in mindasyoucreatenew apps & add new features to existing apps. By integrating accessibilityfeatures& services you can improve your app's usability, particularlyfor userswithdisabilities. You just created your first Material app! You createdacustomcolorpalette for both light and dark themes, created shapes for different components,downloaded fonts and added them to the app, and created a beautiful topbartotieitall together. Take the skills you learned in this codelab and changecolors, shapes,and typography to make apps completely your own! In conclusion, Integration of Android Basics with Composeempowersorganizations to optimize operations, drive innovation &staycompetitiveinarapidly evolving digital landscape. This synergy enables data drivendecisionmaking & efficient resource utilization, fostering growth &adaptability