Greetings From GDSC BCE Patna✨✨
So after a series of great sessions we are again back with something really interesting in *Android*🤩....
This time let's explore some coolest features related to UI & Navigation 🔥😁.
So come and join this very interesting session on Navigation in Android and implement some amazing stuffs on your application 🤩🤩🥳....
🗓️Date: 12th October 2022
🕗Time: 7:30 PM IST
📍 Venue: Google Meet
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
Compose camp 4.pptx
1. Stargazing at State
Migration Meadow
Testing Trails
Performance Peak
Layout Lake
Material Tents
Google Developer Student Clubs
Bakhtiyarpur College Of Engineering - Patna
2. This work is licensed under the Apache 2.0 License
Compose Camp #4
App Architecture,
Navigation & Adaptivity
Google Developer Student Clubs
Bakhtiyarpur College Of Engineering - Patna
22nd September, 2022
3. This work is licensed under the Apache 2.0 License
App Architecture
A typical Android app contains multiple app components, including activities, fragments, services, content
providers, and broadcast receivers.
Activity : It is that window in which the app draws its UI. One activity implements one screen in an app.
Fragments : A Fragment represents a reusable portion of your app's UI. Also known as sub-activity. This
adds modularity to your App.
Services : It is an application component that can perform long-running operations in the background. It
does not provide a user interface. Once started, a service might continue running for some time,
even after the user switches to another application. Eg: Location tracer, Audio Recorder, etc.
Content Providers : It manages access to a central repository of data. Eg- Phone Numbers saved in your
contacts can be accessed by 3rd party applications like Whatsapp, Telegram,
etc
Broadcast Receivers : It is an Android component which allows you to send or receive Android system or
application events.
An application architecture describes the patterns and techniques used to design and build an
application. The architecture gives you a roadmap and best practices to follow when building an
application, so that you end up with a well-structured app.
4. This work is licensed under the Apache 2.0 License
Recommended app architecture
Each application should have at least two layers:
● The UI layer that displays application data on the screen.
● The data layer that contains the business logic of your
app and exposes application data.
You can add an additional layer called the domain layer to
simplify and reuse the interactions between the UI and data
layers.
5. This work is licensed under the Apache 2.0 License
UI layer
The role of the UI layer (or presentation layer) is to display the
application data on the screen. Whenever the data changes,
either due to user interaction (such as pressing a button) or
external input (such as a network response), the UI should
update to reflect the changes.
The UI layer is made up of two things:
● UI elements that render the data on the screen. You
build these elements using Views or Jetpack Compose
functions.
● State holders (such as ViewModel classes) that hold
data, expose it to the UI, and handle logic.
6. This work is licensed under the Apache 2.0 License
Data layer
The data layer of an app contains the business logic. The
business logic is what gives value to your app—it's made of
rules that determine how your app creates, stores, and
changes data.
For example, you might create a NotesRepository class for
storing notes on your application, or a PaymentsRepository
class for data related to payments.
Repository classes are used for :
● Exposing data to the rest of the app.
● Centralizing changes to the data.
● Resolving conflicts between multiple data sources.
● Containing business logic.
7. This work is licensed under the Apache 2.0 License
Benefits of Architecture
Having a good Architecture implemented in your app brings a lot of
benefits to the project and engineering teams:
● It improves the maintainability, quality and robustness of the
overall app.
● It allows the app to scale. More people and more teams can
contribute to the same codebase with minimal code conflicts.
● It helps with onboarding. As Architecture brings consistency to
your project, new members of the team can quickly get up to
speed and be more efficient in less amount of time.
● It is easier to test. A good Architecture encourages simpler types
which are generally easier to test.
● Bugs can be investigated methodically with well defined
processes.
8. This work is licensed under the Apache 2.0 License
Navigation occurs between your’s app destination-
that is , anywhere in your app to which users can
navigate. These destinations are connected via
actions. A navigation graph is a resource file that
contains all of your destinations and actions. The
graph represents all of your app's navigation paths.
Navigation :-
9. This work is licensed under the Apache 2.0 License
Figure shows a visual representation of a navigation graph for
a sample app containing six destinations connected by five
actions. Each destination is represented by a preview
thumbnail, and connecting actions are represented by arrows
that show how users can navigate from one destination to
another.
Structure of navigation implementation
10. This work is licensed under the Apache 2.0 License
11. This work is licensed under the Apache 2.0 License
Adaptive Android
Apps
Android devices come in a variety of shapes, sizes, and form factors. You should design your app
to run on these different types of devices, from small screen devices to larger screen devices.
Your app must have a flexible layout. Instead of defining your layout with rigid dimensions that
assume a certain aspect ratio and screen size, your layout should be able to gracefully adapt
to various screen sizes and orientations. The same principle applies when your app is running
on a foldable device where the screen size and aspect ratio may change while your app is
running.
12. This work is licensed under the Apache 2.0 License
App Demo by Himanshu Raj (21CS28)
BCE - Mart
13. This work is licensed under the Apache 2.0 License
App Demo by Sandesh Kumar (21CS37)
Web - Devil
14. This work is licensed under the Apache 2.0 License
Compose Camp Week #4 Content
https://d
Architecture Components Adapt for different sizes
Navigation in Jetpack Compose
15. This work is licensed under the Apache 2.0 License
Week 4 content
Architecture Components Navigation in jetpack compose
Adapt for different screen sizes
● Built an adaptive app with
dynamic navigation
● Stages of the activity
lifecycle
● Intro to app architecture
● Architecture: The UI
layer
and many more…..
● Navigate between screens
with compose
● Test the cupcake app
● Add navigation
● and many more….
16. This work is licensed under the Apache 2.0 License
THANK
YOU
Google Developer Student Clubs
Bakhtiyarpur College Of Engineering - Patna