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

PDF
Cloud Computing
PPTX
dashDB: the GIS professional’s bridge to mainstream IT systems
PDF
AWS Community Day Nordics 2018 - Saku Vaittinen (VR): Data driven public tran...
PPTX
Cloud computing
PPTX
Big Data with hadoop, Spark and BigQuery (Google cloud next Extended 2017 Kar...
PPTX
Introduction to PredictionIO
PDF
.Net development with Azure Machine Learning (AzureML) Nov 2014
PDF
AWS Machine Learning & Google Cloud Machine Learning
Cloud Computing
dashDB: the GIS professional’s bridge to mainstream IT systems
AWS Community Day Nordics 2018 - Saku Vaittinen (VR): Data driven public tran...
Cloud computing
Big Data with hadoop, Spark and BigQuery (Google cloud next Extended 2017 Kar...
Introduction to PredictionIO
.Net development with Azure Machine Learning (AzureML) Nov 2014
AWS Machine Learning & Google Cloud Machine Learning

What's hot (16)

PPTX
Finding new Customers using D&B and Excel Power Query
PDF
An introduction to predictionIO
PDF
Machine Learning Software Design Pattern with PredictionIO
PDF
Building Data Lakes with Apache Airflow
PDF
AWS Community Day Nordics 2018 - Aino Health: Transition to serverless and le...
PDF
Cloud Developer Days - BigQuery
PDF
[2C2]PredictionIO
PPTX
Big data in Azure
PDF
Azure Databricks—Apache Spark as a Service with Sascha Dittmann
PPTX
Getting to 1.5M Ads/sec: How DataXu manages Big Data
PDF
Artificial intelligence in actions: delivering a new experience to Formula 1 ...
PPTX
Analytics in the Cloud
PPTX
Spot at qubole
PPTX
Google cloud
PDF
Big Data Analytics with Amazon Web Services
PPTX
For linked in part 1
Finding new Customers using D&B and Excel Power Query
An introduction to predictionIO
Machine Learning Software Design Pattern with PredictionIO
Building Data Lakes with Apache Airflow
AWS Community Day Nordics 2018 - Aino Health: Transition to serverless and le...
Cloud Developer Days - BigQuery
[2C2]PredictionIO
Big data in Azure
Azure Databricks—Apache Spark as a Service with Sascha Dittmann
Getting to 1.5M Ads/sec: How DataXu manages Big Data
Artificial intelligence in actions: delivering a new experience to Formula 1 ...
Analytics in the Cloud
Spot at qubole
Google cloud
Big Data Analytics with Amazon Web Services
For linked in part 1
Ad

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

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

Recently uploaded (20)

PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Institutional Correction lecture only . . .
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
Pharma ospi slides which help in ospi learning
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
RMMM.pdf make it easy to upload and study
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
O5-L3 Freight Transport Ops (International) V1.pdf
A systematic review of self-coping strategies used by university students to ...
STATICS OF THE RIGID BODIES Hibbelers.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Institutional Correction lecture only . . .
Anesthesia in Laparoscopic Surgery in India
Microbial diseases, their pathogenesis and prophylaxis
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Pharma ospi slides which help in ospi learning
O7-L3 Supply Chain Operations - ICLT Program
Final Presentation General Medicine 03-08-2024.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Supply Chain Operations Speaking Notes -ICLT Program
RMMM.pdf make it easy to upload and study
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Computing-Curriculum for Schools in Ghana
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3

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) } } }