Slide 1

Slide 1 text

Mastering Android Studio Template Creation Chandrasekar K github.com/TakeoffAndroid medium.com/@takeoffandroid twitter.com/takeoffandroid facebook.com/takeoffandroid CHICAGO ROBOTO 2018

Slide 2

Slide 2 text

Lazy coder THOUGHTWORKS ANDROID GEEK CHENNAI, INDIA 1ST TIME SPEAKER WHO AM I ?

Slide 3

Slide 3 text

00 WHY AM I HERE ? Implementation, application and creation of templates Improve developer’s productivity Video Demo

Slide 4

Slide 4 text

POP QUIZ Used Android Studio Templates before ? Ever created templates on your own? 1 2

Slide 5

Slide 5 text

Predefined code which are generated based on the user input data. What is a template ? By default, Android studio provides set of templates like Basic Activity, Bottom Navigation Activity, Empty Activity, etc. 1 2 Reference : https://developer.android.com/studio/projects/templates.html

Slide 6

Slide 6 text

HOW TO ACCESS TEMPLATE

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Getting Started? Go to Applications \ Android Studio \ Right click \ Show Package Contents \ Plugins \ android \ lib \ templates. C:\ Program Files \ Android \ Android Studio \ Plugins \ android \ lib \ templates

Slide 9

Slide 9 text

How do we create Templates?

Slide 10

Slide 10 text

What is FreeMarker (.ftl) ? 2 1 3 Apache FreeMarker is a template engine A Java library to generate source code based on templates and changing data Reference : https:// freemarker.apache.org/

Slide 11

Slide 11 text

FREEMARKER PROJECT STRUCTURE

Slide 12

Slide 12 text

There is no secret ingredient. It’s just you Ingredients for template creation ?

Slide 13

Slide 13 text

` templates .xml GLOBALS .xml RECIPES .xml It transforms Freemarker code (.ftl) to java, kotlin or xml files. It holds all the gradle dependencies. It holds all the global contents like text, slashed package, directory path. 2 1 It is responsible for creation of UI elements like Textbox, Dropdown and checkbox components.

Slide 14

Slide 14 text

templates .xml GLOBALS .xml RECIPES .xml Android Studio Templates

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

How to create Textbox (EditText) in templates.xml?

Slide 17

Slide 17 text

How to create Textbox (EditText) in templates.xml?

Slide 18

Slide 18 text

How to create Checkbox in templates.xml?

Slide 19

Slide 19 text

How to create Dropdown in templates.xml?

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

How recipes.xml work ?

Slide 22

Slide 22 text

Instantiate Merge Dependency Copy Open

Slide 23

Slide 23 text

INSTANTIATE AndroidManifest.xml

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

strings.xml in Template Project strings.xml in Android Project MERGE

Slide 27

Slide 27 text

strings.xml in Template Project strings.xml in Android Project MERGE

Slide 28

Slide 28 text

COPY

Slide 29

Slide 29 text

OPEN

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

Video Demo

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Medium https://medium.com/androidstarters/mastering-android-studio-templates-ed8fdd98cb78 https://medium.com/androidstarters/creating-android-studio-ide-template-for-recyclerviews-a8b6d4925f3f Github https://github.com/TakeoffAndroid/LoginTemplates https://github.com/TakeoffAndroid/RecyclerViewTemplate https://github.com/TakeoffAndroid/MaterialTabsTemplate References ?

Slide 35

Slide 35 text

APPLICATION IMPLEMENTATION CREATION BUILD VERIFIED TAKE OFF

Slide 36

Slide 36 text

what why where when who how Q&A