SlideShare a Scribd company logo
App development with
Constraint layout, Kotlin
& Firebase
Agenda
What’s new in constraint layout
Kotlin, fun tool for programmer
Machine learning with firebase
Layouts
Constraint layout - To build an expressive UI
Linear layout - Useful for straightforward layouts
Coordinate layout - To use material design tools
Frame layout - Better use for dynamic fragment and for single view layout
Relative layout - Good time to switch to constraint layout
Grid layout - Views need to be shown in grids ( try recyclerview)
Absolute layout - RIP
App development with constraint layout, kotlin & firebase
Constraint layout
Circular Positioning
Position the corresponding view
with the current view by some angle
and distance - radius.
Barrier
A barrier adjust virtual guideline
at runtime based on maximum
size among various set of
views.
Group
A group acts on various set of
views and set their visibility as
VISIBLE, GONE or
INVISIBLE.
It acts by taking view
reference id.
<android.support.constraint.Group
android:id="@+id/group"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="gone"
app:constraint_referenced_ids="view1,view2" />
Placeholder
It’s use to dynamically set
content on screen where any
view can be set to placeholder
just by passing its id. If the view
exists on same screen as
placeholder than it’s visibility will
automatically be set to gone.
Dimension Constraint
It restrict view to be in the
defined constraint even when
view width/height is wrap
content.
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello this is an example with constraint width"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="@+id/guideline_50"/>
App development with constraint layout, kotlin &amp; firebase
● Kotlin is a statically typed language by Jetbrains.
● It’s a JVM dependent language.
● Available for multiplatform projects - JavaScript and Java.
● Kotlin native for iOS app development.
Introduction
Features of kotlin
Null Safety
Extension function
Higher Order Function
Default & Named Arguments
Data Class
Null Safety
val length
if(city != null) {
length = city.length
}
val length = city?.length
Extension Function
fun TextView.setCurrency(money: Double){
val numFormat = NumberFormat.getCurrencyInstance()
this.text = numFormat.format(money)
}
textView.setCurrency(100.50)
Higher Order Function
fun AppCompatActivity.networkCheck(
errorMessage: String = "Unable to connect, please try again later",
networkFun: () -> Unit) {
if(isNetworkAvailable) {
networkFun()
} else {
Toast.makeText(this, errorMessage, Toast.LENGTH_SHORT).show()
}
}
Default Argument
Default & Named Argument
fun updateAddress(city: String = "Hyderabad",
state: String = "Telangana") {
.....
}
updateAddress(city = "Mumbai",
state = "Maharashtra")
updateAddress(state = "Maharashtra",
city = "Mumbai")
Data Class
//If empty constructor needed
class Address {
val city: String = ""
val state: String = ""
val country: String = ""
}
data class Address(val city:
String, val state: String, val
country: String)
App development with constraint layout, kotlin &amp; firebase
App development with constraint layout, kotlin &amp; firebase
Cloud Firestore
A NoSQL database with a great querying capability.
Auto scale & Multi region database.
It’s based on Collection and Document.
Can build a serverless application using cloud firestore.
Collection & Document
Collection
Collections are like a container which itself
doesn’t store any data but contains
document which in turn stores data.
Document
It’s the smallest unit to store data in the
database more set of data type are now
supported with document
App development with constraint layout, kotlin &amp; firebase
ML kit
ML Kit lets you to bring powerful machine learning features in
your app whether it's for Android or iOS.
There's no need to have deep knowledge of neural network
or model optimization to get started.
https://bit.ly/2s9T0W8
Landmark
recognition
On Cloud
Text recognition On Device On Cloud
Image labeling On Device On Cloud
Face detection On Device
Barcode scanning On Device
Custom model
inference -
Tensorflow Lite
On Device
If ML Kit's APIs doesn’t cover your use cases, you can
always bring your own existing TensorFlow Lite models.
Just upload your model to Firebase, and it will be taken
care for hosting and serving it to your app.
ML Kit acts as an API layer to your custom model, making
it simpler to run and use.
Recognize Text
val firebaseVision = FirebaseVisionImage.fromBitmap(bitmap)
val textDetector = FirebaseVision.getInstance().visionTextDetector
textDetector.detectInImage(firebaseVision).addOnCompleteListener {
task -> if (task.isSuccessful) {
for (block in task.result.blocks) {
print(block.text)
}
}
}
Face Detection
val options = FirebaseVisionFaceDetectorOptions.Builder()
.setModeType(FirebaseVisionFaceDetectorOptions.ACCURATE_MODE)
.setLandmarkType(FirebaseVisionFaceDetectorOptions.ALL_LANDMARKS)
.build()
val detector = FirebaseVision.getInstance().getVisionFaceDetector(options)
val firebaseVision = FirebaseVisionImage.fromBitmap(bitmap)
detector.detectInImage(firebaseVision).addOnCompleteListener { task ->
if (task.isSuccessful) {
for(face in task.result) {
print(face. smilingProbability)
}
}
}
Thank You
Pankaj Rai
https://medium.com/@pankaj.rai16
https://www.linkedin.com/in/pankajrai16/

More Related Content

What's hot (16)

PPTX
Finding new Customers using D&B and Excel Power Query
Lynn Langit
 
PDF
An introduction to predictionIO
Jackson dos Santos Olveira
 
PDF
Machine Learning Software Design Pattern with PredictionIO
Turi, Inc.
 
PDF
Building Data Lakes with Apache Airflow
Gary Stafford
 
PDF
AWS Community Day Nordics 2018 - Aino Health: Transition to serverless and le...
Rolf Koski
 
PDF
Cloud Developer Days - BigQuery
Wlodek Bielski
 
PDF
[2C2]PredictionIO
NAVER D2
 
PPTX
Big data in Azure
Venkatesh Narayanan
 
PDF
Azure Databricks—Apache Spark as a Service with Sascha Dittmann
Databricks
 
PPTX
Getting to 1.5M Ads/sec: How DataXu manages Big Data
Qubole
 
PDF
Artificial intelligence in actions: delivering a new experience to Formula 1 ...
GoDataDriven
 
PPTX
Analytics in the Cloud
Ross McNeely
 
PPTX
Spot at qubole
Ajaya Agrawal
 
PPTX
Google cloud
vipin ojha
 
PDF
Big Data Analytics with Amazon Web Services
Amazon Web Services
 
PPTX
For linked in part 1
Pankaj Tomar
 
Finding new Customers using D&B and Excel Power Query
Lynn Langit
 
An introduction to predictionIO
Jackson dos Santos Olveira
 
Machine Learning Software Design Pattern with PredictionIO
Turi, Inc.
 
Building Data Lakes with Apache Airflow
Gary Stafford
 
AWS Community Day Nordics 2018 - Aino Health: Transition to serverless and le...
Rolf Koski
 
Cloud Developer Days - BigQuery
Wlodek Bielski
 
[2C2]PredictionIO
NAVER D2
 
Big data in Azure
Venkatesh Narayanan
 
Azure Databricks—Apache Spark as a Service with Sascha Dittmann
Databricks
 
Getting to 1.5M Ads/sec: How DataXu manages Big Data
Qubole
 
Artificial intelligence in actions: delivering a new experience to Formula 1 ...
GoDataDriven
 
Analytics in the Cloud
Ross McNeely
 
Spot at qubole
Ajaya Agrawal
 
Google cloud
vipin ojha
 
Big Data Analytics with Amazon Web Services
Amazon Web Services
 
For linked in part 1
Pankaj Tomar
 

Similar to App development with constraint layout, kotlin &amp; firebase (20)

PPTX
Digibury: Getting your web presence mobile ready - David Walker
Lizzie Hodgson
 
PPTX
Adapter and adapter views that are used in android
JinalBhagat2
 
PDF
OCCIware: extensible and standard-based XaaS platform to manage everything in...
OW2
 
PDF
OCCIware@OW2con 2016
Marc Dutoo
 
PDF
OCCIware: extensible and standard-based XaaS platform to manage everything in...
OCCIware
 
PDF
Best Practices for Android UI by RapidValue Solutions
RapidValue
 
PPTX
Apache Hadoop India Summit 2011 talk "Making Hadoop Enterprise Ready with Am...
Yahoo Developer Network
 
PPTX
Android_Bootcamp_PPT_GDSC_ITS_Engineering
ShivanshSeth6
 
PDF
Tuning and optimizing webcenter spaces application white paper
Vinay Kumar
 
PPTX
Building N Tier Applications With Entity Framework Services 2010
David McCarter
 
PDF
Schema-based multi-tenant architecture using Quarkus &amp; Hibernate-ORM.pdf
seo18
 
PPTX
Cepta The Future of Data with Power BI
Kellyn Pot'Vin-Gorman
 
PPT
Lecture Slides for List Views [Android ]
Nehil Jain
 
PPTX
Build a professional weather app - Sunshine
Marwan Zouinkhi
 
PPTX
Big Data on Azure Tutorial
rustd
 
PPTX
Azure Data.pptx
FedoRam1
 
PPTX
Architecting multi-cloud ready applications
Swaminathan Vetri
 
PDF
Social data visualization
Cristina Serban
 
PPTX
QuadTree_Visualizer_Major-Project-II_CS-73.pptx
AbhishekDwivedi253
 
PDF
Case study on Cloud Platforms
nik_053
 
Digibury: Getting your web presence mobile ready - David Walker
Lizzie Hodgson
 
Adapter and adapter views that are used in android
JinalBhagat2
 
OCCIware: extensible and standard-based XaaS platform to manage everything in...
OW2
 
OCCIware@OW2con 2016
Marc Dutoo
 
OCCIware: extensible and standard-based XaaS platform to manage everything in...
OCCIware
 
Best Practices for Android UI by RapidValue Solutions
RapidValue
 
Apache Hadoop India Summit 2011 talk "Making Hadoop Enterprise Ready with Am...
Yahoo Developer Network
 
Android_Bootcamp_PPT_GDSC_ITS_Engineering
ShivanshSeth6
 
Tuning and optimizing webcenter spaces application white paper
Vinay Kumar
 
Building N Tier Applications With Entity Framework Services 2010
David McCarter
 
Schema-based multi-tenant architecture using Quarkus &amp; Hibernate-ORM.pdf
seo18
 
Cepta The Future of Data with Power BI
Kellyn Pot'Vin-Gorman
 
Lecture Slides for List Views [Android ]
Nehil Jain
 
Build a professional weather app - Sunshine
Marwan Zouinkhi
 
Big Data on Azure Tutorial
rustd
 
Azure Data.pptx
FedoRam1
 
Architecting multi-cloud ready applications
Swaminathan Vetri
 
Social data visualization
Cristina Serban
 
QuadTree_Visualizer_Major-Project-II_CS-73.pptx
AbhishekDwivedi253
 
Case study on Cloud Platforms
nik_053
 
Ad

Recently uploaded (20)

PPTX
CONVULSIVE DISORDERS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PDF
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PPTX
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
PPT on the Development of Education in the Victorian England
Beena E S
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
PPTX
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PDF
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPTX
LEGAL ASPECTS OF PSYCHIATRUC NURSING.pptx
PoojaSen20
 
PPTX
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
CONVULSIVE DISORDERS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
community health nursing question paper 2.pdf
Prince kumar
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPT on the Development of Education in the Victorian England
Beena E S
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
LEGAL ASPECTS OF PSYCHIATRUC NURSING.pptx
PoojaSen20
 
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Ad

App development with constraint layout, kotlin &amp; firebase

  • 1. App development with Constraint layout, Kotlin & Firebase
  • 2. Agenda What’s new in constraint layout Kotlin, fun tool for programmer Machine learning with firebase
  • 3. Layouts Constraint layout - To build an expressive UI Linear layout - Useful for straightforward layouts Coordinate layout - To use material design tools Frame layout - Better use for dynamic fragment and for single view layout Relative layout - Good time to switch to constraint layout Grid layout - Views need to be shown in grids ( try recyclerview) Absolute layout - RIP
  • 6. Circular Positioning Position the corresponding view with the current view by some angle and distance - radius.
  • 7. Barrier A barrier adjust virtual guideline at runtime based on maximum size among various set of views.
  • 8. Group A group acts on various set of views and set their visibility as VISIBLE, GONE or INVISIBLE. It acts by taking view reference id. <android.support.constraint.Group android:id="@+id/group" android:layout_width="0dp" android:layout_height="0dp" android:visibility="gone" app:constraint_referenced_ids="view1,view2" />
  • 9. Placeholder It’s use to dynamically set content on screen where any view can be set to placeholder just by passing its id. If the view exists on same screen as placeholder than it’s visibility will automatically be set to gone.
  • 10. Dimension Constraint It restrict view to be in the defined constraint even when view width/height is wrap content.
  • 11. <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello this is an example with constraint width" app:layout_constrainedWidth="true" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="@+id/guideline_50"/>
  • 13. ● Kotlin is a statically typed language by Jetbrains. ● It’s a JVM dependent language. ● Available for multiplatform projects - JavaScript and Java. ● Kotlin native for iOS app development. Introduction
  • 14. Features of kotlin Null Safety Extension function Higher Order Function Default & Named Arguments Data Class
  • 15. Null Safety val length if(city != null) { length = city.length } val length = city?.length
  • 16. Extension Function fun TextView.setCurrency(money: Double){ val numFormat = NumberFormat.getCurrencyInstance() this.text = numFormat.format(money) } textView.setCurrency(100.50)
  • 17. Higher Order Function fun AppCompatActivity.networkCheck( errorMessage: String = "Unable to connect, please try again later", networkFun: () -> Unit) { if(isNetworkAvailable) { networkFun() } else { Toast.makeText(this, errorMessage, Toast.LENGTH_SHORT).show() } } Default Argument
  • 18. Default & Named Argument fun updateAddress(city: String = "Hyderabad", state: String = "Telangana") { ..... } updateAddress(city = "Mumbai", state = "Maharashtra") updateAddress(state = "Maharashtra", city = "Mumbai")
  • 19. Data Class //If empty constructor needed class Address { val city: String = "" val state: String = "" val country: String = "" } data class Address(val city: String, val state: String, val country: String)
  • 22. Cloud Firestore A NoSQL database with a great querying capability. Auto scale & Multi region database. It’s based on Collection and Document. Can build a serverless application using cloud firestore.
  • 23. Collection & Document Collection Collections are like a container which itself doesn’t store any data but contains document which in turn stores data. Document It’s the smallest unit to store data in the database more set of data type are now supported with document
  • 25. ML kit ML Kit lets you to bring powerful machine learning features in your app whether it's for Android or iOS. There's no need to have deep knowledge of neural network or model optimization to get started.
  • 27. Landmark recognition On Cloud Text recognition On Device On Cloud Image labeling On Device On Cloud Face detection On Device Barcode scanning On Device Custom model inference - Tensorflow Lite On Device
  • 28. If ML Kit's APIs doesn’t cover your use cases, you can always bring your own existing TensorFlow Lite models. Just upload your model to Firebase, and it will be taken care for hosting and serving it to your app. ML Kit acts as an API layer to your custom model, making it simpler to run and use.
  • 29. Recognize Text val firebaseVision = FirebaseVisionImage.fromBitmap(bitmap) val textDetector = FirebaseVision.getInstance().visionTextDetector textDetector.detectInImage(firebaseVision).addOnCompleteListener { task -> if (task.isSuccessful) { for (block in task.result.blocks) { print(block.text) } } }
  • 30. Face Detection val options = FirebaseVisionFaceDetectorOptions.Builder() .setModeType(FirebaseVisionFaceDetectorOptions.ACCURATE_MODE) .setLandmarkType(FirebaseVisionFaceDetectorOptions.ALL_LANDMARKS) .build() val detector = FirebaseVision.getInstance().getVisionFaceDetector(options) val firebaseVision = FirebaseVisionImage.fromBitmap(bitmap) detector.detectInImage(firebaseVision).addOnCompleteListener { task -> if (task.isSuccessful) { for(face in task.result) { print(face. smilingProbability) } } }