SlideShare a Scribd company logo
Tips & Tricks
Android
Sebastian Świerczek
Tips & Tricks list
#1 Gradle libraries versions
#2 Android Support Annotations
#3 Dependencies conflicts resolving
#4 StrictMode
#5 Tools Attributes
Gradle libraries
versions
#1
Versions for single module
def libVersion = [
support : "23.0.1",
supportTest: "0.4"
]
dependencies {
compile "com.android.support:appcompat-v7:${libVersion.support}"
compile "com.android.support:recyclerview-v7:${libVersion.support}"
androidTestCompile "com.android.support.test:runner:${libVersion.supportTest}"
androidTestCompile "com.android.support.test:rules:${libVersion.supportTest}"
}
#1 Gradle libraries versions
root
> appModule
> build.gradle
> module2
> build.gradle
> build.gradle
Versions for all modules
ext {
libVersion = [
support : "23.0.1",
supportTest: "0.4"
]
libDependencies = [
recyclerView : "com.android.support:recyclerview-v7:${libVersion.support}",
appCompat : "com.android.support:appcompat-v7:${libVersion.support}",
supportTestRunner : "com.android.support.test:runner:${libVersion.supportTest}",
supportTestRules : "com.android.support.test:rules:${libVersion.supportTest}"
]
}
#1 Gradle libraries versions
root
> appModule
> build.gradle
> module2
> build.gradle
> build.gradle
Versions for all modules
dependencies {
compile libDependencies.recyclerView
compile libDependencies.appCompat
androidTestCompile libDependencies.supportTestRunner
androidTestCompile libDependencies.supportTestRules
}
#1 Gradle libraries versions
root
> appModule
> build.gradle
> module2
> build.gradle
> build.gradle
Android Support
Annotations
#2
#2 Android Support Annotations
Resource Type Annotations
public void passStringResource(@StringRes int stringResId){...}
public void passColorResource(@ColorRes int colorResId){...}
public void passDrawable(@DrawableRes int drawableResId){...}
public void passColorRgbInt(@ColorInt int rgbColor){...}
public void passStringOrColor(@StringRes @ColorRes int
stringOrColorResId){...}
#2 Android Support Annotations
Resource Type Annotations
passStringResource(R.string.app_name);
passStringResource(R.color.black);
passStringResource(1234);
#2 Android Support Annotations
Resource Type Annotations
passStringOrColorResource(R.string.app_name);
passStringOrColorResource(android.R.color.white);
passStringOrColorResource(R.drawable.ic_launcher);
#2 Android Support Annotations
Resource Type Annotations
passColorRgbInt(resources.getColor(R.color.white));
passColorRgbInt(0xFFFFFFFF);
passColorRgbInt(R.color.white);
#2 Android Support Annotations
Typedef Annotations
@IntDef ({
DOWNLOAD_IDLE,
DOWNLOAD_IN_PROGRESS})
public @interface DownloadStatus {}
public static final int DOWNLOAD_IDLE = 0;
public static final int DOWNLOAD_IN_PROGRESS = 1;
#2 Android Support Annotations
Typedef Annotations
public void setDownloadStatus(@DownloadStatus int status)
{...}
#2 Android Support Annotations
Typedef Annotations
setDownloadStatus(DOWNLOAD_IDLE);
setDownloadStatus(DOWNLOAD_IN_PROGRESS);
setDownloadStatus(1234);
Dependencies
conflicts resolving
#3
#3 Dependencies conflicts resolving
Google Play Services dependencies conflict
Error:Execution failed for task ':app:processDebugResources'.
> Error: more than one library with package name
'com.google.android.gms'
You can temporarily disable this error with
android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
#3 Dependencies conflicts resolving
Dependencies
compile 'com.google.android.gms:play-services-maps:8.1.0'
compile 'co.realtime:messaging-android:2.1.52'
#3 Dependencies conflicts resolving
androidDependencies task to the rescue
./gradlew androidDependencies
#3 Dependencies conflicts resolving
androidDependencies task to the rescue
+--- com.google.android.gms:play-services-maps:8.1.0
| --- com.google.android.gms:play-services-base:8.1.0
| --- com.google.android.gms:play-services-basement:8.1.0
| --- com.android.support:support-v4:23.0.1
| --- LOCAL: internal_impl-23.0.1.jar
+--- co.realtime:messaging-android:2.1.52
| +--- LOCAL: json_simple-1.1.jar
| +--- LOCAL: httpcore-4.2.4.jar
| +--- com.google.android.gms:play-services:6.1.71
#3 Dependencies conflicts resolving
Fix the issue
compile 'com.google.android.gms:play-services:8.1.0'
compile 'co.realtime:messaging-android:2.1.52'
StrictMode
#4
#4 StrictMode
Detect UI Thread operations
if (DEBUG) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectAll()
.penaltyLog()
.build());
}
#4 StrictMode
Example output
StrictMode policy violation; ~duration=6193 ms:
android.os.StrictMode$StrictModeDiskReadViolation:
policy=31 violation=2
at (…) onReadFromDisk(StrictMode.java:1137)
(…)
at (…) (MainActivity.java:36)
Tools Attributes
#5
#5 Tools Attributes
Tools Layout Attributes
View in designer.
<FrameLayout (...)
xmlns:tools="http://schemas.android.com/tools">
<TextView (...)
android:text="@string/hello_world"
tools:text="@string/long_text" />
<Button
android:id="@+id/youCanSeeMeAtRuntime"(...)
android:visibility="visible"
tools:visibility="gone" />
</FrameLayout>
#5 Tools Attributes
Tools Layout Attributes
View at runtime.
#5 Tools Attributes
Tools Layout Pointer
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@+id/my_fragment"
android:name="com.example.user.exampleapp.MyFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/my_fragment_layout" />
</FrameLayout>
#5 Tools Attributes
Tools Layout Pointer
Without: With:

More Related Content

What's hot

The AngularJS way
The AngularJS wayThe AngularJS way
The AngularJS way
Boyan Mihaylov
 
5 angularjs features
5 angularjs features5 angularjs features
5 angularjs features
Alexey (Mr_Mig) Migutsky
 
Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)
Gabi Costel Lapusneanu
 
Angular js
Angular jsAngular js
Angular js
Manav Prasad
 
Getting your app ready for android n
Getting your app ready for android nGetting your app ready for android n
Getting your app ready for android n
Sercan Yusuf
 
Android N Highligts
Android N HighligtsAndroid N Highligts
Android N Highligts
Sercan Yusuf
 
Built to last javascript for enterprise
Built to last   javascript for enterpriseBuilt to last   javascript for enterprise
Built to last javascript for enterprise
Marjan Nikolovski
 
Struts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsStruts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web Applications
JavaEE Trainers
 
준비하세요 Angular js 2.0
준비하세요 Angular js 2.0준비하세요 Angular js 2.0
준비하세요 Angular js 2.0
Jeado Ko
 
MVVM Light Toolkit Works Great, Less Complicated
MVVM Light ToolkitWorks Great, Less ComplicatedMVVM Light ToolkitWorks Great, Less Complicated
MVVM Light Toolkit Works Great, Less Complicatedmdc11
 
Intro into MVC 1.0
Intro into MVC 1.0Intro into MVC 1.0
Intro into MVC 1.0
Maurice de Château
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
Wei Ru
 
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSKarlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Philipp Burgmer
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
Luigi De Russis
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developersKai Koenig
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
Raghubir Singh
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
Joonas Lehtinen
 
AngularJS Workshop
AngularJS WorkshopAngularJS Workshop
AngularJS Workshop
Gianluca Cacace
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
Bipin
 

What's hot (20)

The AngularJS way
The AngularJS wayThe AngularJS way
The AngularJS way
 
5 angularjs features
5 angularjs features5 angularjs features
5 angularjs features
 
Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)
 
Angular js
Angular jsAngular js
Angular js
 
Getting your app ready for android n
Getting your app ready for android nGetting your app ready for android n
Getting your app ready for android n
 
Android N Highligts
Android N HighligtsAndroid N Highligts
Android N Highligts
 
Built to last javascript for enterprise
Built to last   javascript for enterpriseBuilt to last   javascript for enterprise
Built to last javascript for enterprise
 
Struts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsStruts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web Applications
 
준비하세요 Angular js 2.0
준비하세요 Angular js 2.0준비하세요 Angular js 2.0
준비하세요 Angular js 2.0
 
MVVM Light Toolkit Works Great, Less Complicated
MVVM Light ToolkitWorks Great, Less ComplicatedMVVM Light ToolkitWorks Great, Less Complicated
MVVM Light Toolkit Works Great, Less Complicated
 
Intro into MVC 1.0
Intro into MVC 1.0Intro into MVC 1.0
Intro into MVC 1.0
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSKarlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developers
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
 
AngularJS Workshop
AngularJS WorkshopAngularJS Workshop
AngularJS Workshop
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
 

Viewers also liked

Łebski Development czyli kiedy i dlaczego tworzyć oprogramowanie pod klucz i ...
Łebski Development czyli kiedy i dlaczego tworzyć oprogramowanie pod klucz i ...Łebski Development czyli kiedy i dlaczego tworzyć oprogramowanie pod klucz i ...
Łebski Development czyli kiedy i dlaczego tworzyć oprogramowanie pod klucz i ...
Wojciech Sznapka
 
心经
心经心经
心经
yonglun
 
Казка виноградар і змія
Казка виноградар і зміяКазка виноградар і змія
Казка виноградар і змія
Рита Скитер
 
Projektowanie systemów IT w chmurach obliczeniowych (AMG.net Tech Cafe)
Projektowanie systemów IT w chmurach obliczeniowych (AMG.net Tech Cafe)Projektowanie systemów IT w chmurach obliczeniowych (AMG.net Tech Cafe)
Projektowanie systemów IT w chmurach obliczeniowych (AMG.net Tech Cafe)
Michal Balinski
 
Prueba
PruebaPrueba
Prueba
3118386896
 
San jose del avila detalle rejas ventanas
San jose del avila detalle rejas ventanasSan jose del avila detalle rejas ventanas
San jose del avila detalle rejas ventanasAntonio Cazorla
 
Electricity in the United Kingdom
Electricity in the United KingdomElectricity in the United Kingdom
Electricity in the United Kingdom
ReportLinker.com
 
Wyniki konsultacji programu współpracy Miasta Mielec z NGO na 2016 rok
Wyniki konsultacji programu współpracy Miasta Mielec z NGO na 2016 rokWyniki konsultacji programu współpracy Miasta Mielec z NGO na 2016 rok
Wyniki konsultacji programu współpracy Miasta Mielec z NGO na 2016 rok
Obywatelski Aktywny Mielec
 
WIOŚ w sprawie Kronospanu do mieszkańca Mielca
WIOŚ w sprawie Kronospanu do mieszkańca MielcaWIOŚ w sprawie Kronospanu do mieszkańca Mielca
WIOŚ w sprawie Kronospanu do mieszkańca Mielca
HejMielec
 
2
22
Antyk - źródło kultury europejskiej
Antyk - źródło kultury europejskiejAntyk - źródło kultury europejskiej
Coś o service fabric, architekturze, i bardzo skalowalnych aplikacjach
Coś o service fabric, architekturze, i bardzo skalowalnych aplikacjachCoś o service fabric, architekturze, i bardzo skalowalnych aplikacjach
Coś o service fabric, architekturze, i bardzo skalowalnych aplikacjach
Tomasz Kopacz
 
Pompa strzykawkowa Alaris PK, instrukcja obsługi
Pompa strzykawkowa Alaris PK, instrukcja obsługiPompa strzykawkowa Alaris PK, instrukcja obsługi
Pompa strzykawkowa Alaris PK, instrukcja obsługiPolanest
 
Newton Raphson-ejercicios resueltos.
Newton Raphson-ejercicios resueltos.Newton Raphson-ejercicios resueltos.
Newton Raphson-ejercicios resueltos.
Eliaquim Oncihuay Salazar
 
"Prioritizing Adaptation Actions in Ghana using the Akuapim Approach" by Antw...
"Prioritizing Adaptation Actions in Ghana using the Akuapim Approach" by Antw..."Prioritizing Adaptation Actions in Ghana using the Akuapim Approach" by Antw...
"Prioritizing Adaptation Actions in Ghana using the Akuapim Approach" by Antw...
OECD Environment
 

Viewers also liked (16)

Łebski Development czyli kiedy i dlaczego tworzyć oprogramowanie pod klucz i ...
Łebski Development czyli kiedy i dlaczego tworzyć oprogramowanie pod klucz i ...Łebski Development czyli kiedy i dlaczego tworzyć oprogramowanie pod klucz i ...
Łebski Development czyli kiedy i dlaczego tworzyć oprogramowanie pod klucz i ...
 
心经
心经心经
心经
 
Казка виноградар і змія
Казка виноградар і зміяКазка виноградар і змія
Казка виноградар і змія
 
Projektowanie systemów IT w chmurach obliczeniowych (AMG.net Tech Cafe)
Projektowanie systemów IT w chmurach obliczeniowych (AMG.net Tech Cafe)Projektowanie systemów IT w chmurach obliczeniowych (AMG.net Tech Cafe)
Projektowanie systemów IT w chmurach obliczeniowych (AMG.net Tech Cafe)
 
Prueba
PruebaPrueba
Prueba
 
San jose del avila detalle rejas ventanas
San jose del avila detalle rejas ventanasSan jose del avila detalle rejas ventanas
San jose del avila detalle rejas ventanas
 
Electricity in the United Kingdom
Electricity in the United KingdomElectricity in the United Kingdom
Electricity in the United Kingdom
 
Wyniki konsultacji programu współpracy Miasta Mielec z NGO na 2016 rok
Wyniki konsultacji programu współpracy Miasta Mielec z NGO na 2016 rokWyniki konsultacji programu współpracy Miasta Mielec z NGO na 2016 rok
Wyniki konsultacji programu współpracy Miasta Mielec z NGO na 2016 rok
 
Tangerine
TangerineTangerine
Tangerine
 
WIOŚ w sprawie Kronospanu do mieszkańca Mielca
WIOŚ w sprawie Kronospanu do mieszkańca MielcaWIOŚ w sprawie Kronospanu do mieszkańca Mielca
WIOŚ w sprawie Kronospanu do mieszkańca Mielca
 
2
22
2
 
Antyk - źródło kultury europejskiej
Antyk - źródło kultury europejskiejAntyk - źródło kultury europejskiej
Antyk - źródło kultury europejskiej
 
Coś o service fabric, architekturze, i bardzo skalowalnych aplikacjach
Coś o service fabric, architekturze, i bardzo skalowalnych aplikacjachCoś o service fabric, architekturze, i bardzo skalowalnych aplikacjach
Coś o service fabric, architekturze, i bardzo skalowalnych aplikacjach
 
Pompa strzykawkowa Alaris PK, instrukcja obsługi
Pompa strzykawkowa Alaris PK, instrukcja obsługiPompa strzykawkowa Alaris PK, instrukcja obsługi
Pompa strzykawkowa Alaris PK, instrukcja obsługi
 
Newton Raphson-ejercicios resueltos.
Newton Raphson-ejercicios resueltos.Newton Raphson-ejercicios resueltos.
Newton Raphson-ejercicios resueltos.
 
"Prioritizing Adaptation Actions in Ghana using the Akuapim Approach" by Antw...
"Prioritizing Adaptation Actions in Ghana using the Akuapim Approach" by Antw..."Prioritizing Adaptation Actions in Ghana using the Akuapim Approach" by Antw...
"Prioritizing Adaptation Actions in Ghana using the Akuapim Approach" by Antw...
 

Similar to Tips & Tricks Android

Hands on the gradle
Hands on the gradleHands on the gradle
Hands on the gradle
Kostiantyn Zghirovskyi
 
AndroidX Google Extended I/O BKK 2018
AndroidX Google Extended I/O BKK 2018 AndroidX Google Extended I/O BKK 2018
AndroidX Google Extended I/O BKK 2018
Theerasan Tonthongkam
 
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Somkiat Khitwongwattana
 
Making the Most of Your Gradle Builds
Making the Most of Your Gradle BuildsMaking the Most of Your Gradle Builds
Making the Most of Your Gradle Builds
Egor Andreevich
 
Hacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfHacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdf
ShaiAlmog1
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Xavier Hallade
 
Getting started with building your own standalone Gradle plugin
Getting started with building your own standalone Gradle pluginGetting started with building your own standalone Gradle plugin
Getting started with building your own standalone Gradle plugin
tobiaspreuss
 
Intro to Gradle + How to get up to speed
Intro to Gradle + How to get up to speedIntro to Gradle + How to get up to speed
Intro to Gradle + How to get up to speed
Reid Baker
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in Rails
Jim Jeffers
 
Cleaning your architecture with android architecture components
Cleaning your architecture with android architecture componentsCleaning your architecture with android architecture components
Cleaning your architecture with android architecture components
Debora Gomez Bertoli
 
Native Payment - Part 2 - Transcript.pdf
Native Payment - Part 2 - Transcript.pdfNative Payment - Part 2 - Transcript.pdf
Native Payment - Part 2 - Transcript.pdf
ShaiAlmog1
 
Synapseindia android apps intro to android development
Synapseindia android apps  intro to android developmentSynapseindia android apps  intro to android development
Synapseindia android apps intro to android developmentSynapseindiappsdevelopment
 
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Nicolas HAAN
 
Droidcon Berlin Barcamp 2016
Droidcon Berlin Barcamp 2016Droidcon Berlin Barcamp 2016
Droidcon Berlin Barcamp 2016
Przemek Jakubczyk
 
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
Dicoding
 
Android classes in mumbai
Android classes in mumbaiAndroid classes in mumbai
Android classes in mumbai
Vibrant Technologies & Computers
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
Tariqul islam
 
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideAndroid Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start Guide
Sergii Zhuk
 
不只自動化而且更敏捷的Android開發工具 gradle
不只自動化而且更敏捷的Android開發工具 gradle不只自動化而且更敏捷的Android開發工具 gradle
不只自動化而且更敏捷的Android開發工具 gradle
sam chiu
 
Reproducible component tests using docker
Reproducible component tests using dockerReproducible component tests using docker
Reproducible component tests using docker
Pavel Rabetski
 

Similar to Tips & Tricks Android (20)

Hands on the gradle
Hands on the gradleHands on the gradle
Hands on the gradle
 
AndroidX Google Extended I/O BKK 2018
AndroidX Google Extended I/O BKK 2018 AndroidX Google Extended I/O BKK 2018
AndroidX Google Extended I/O BKK 2018
 
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
 
Making the Most of Your Gradle Builds
Making the Most of Your Gradle BuildsMaking the Most of Your Gradle Builds
Making the Most of Your Gradle Builds
 
Hacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfHacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdf
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
 
Getting started with building your own standalone Gradle plugin
Getting started with building your own standalone Gradle pluginGetting started with building your own standalone Gradle plugin
Getting started with building your own standalone Gradle plugin
 
Intro to Gradle + How to get up to speed
Intro to Gradle + How to get up to speedIntro to Gradle + How to get up to speed
Intro to Gradle + How to get up to speed
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in Rails
 
Cleaning your architecture with android architecture components
Cleaning your architecture with android architecture componentsCleaning your architecture with android architecture components
Cleaning your architecture with android architecture components
 
Native Payment - Part 2 - Transcript.pdf
Native Payment - Part 2 - Transcript.pdfNative Payment - Part 2 - Transcript.pdf
Native Payment - Part 2 - Transcript.pdf
 
Synapseindia android apps intro to android development
Synapseindia android apps  intro to android developmentSynapseindia android apps  intro to android development
Synapseindia android apps intro to android development
 
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
 
Droidcon Berlin Barcamp 2016
Droidcon Berlin Barcamp 2016Droidcon Berlin Barcamp 2016
Droidcon Berlin Barcamp 2016
 
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
 
Android classes in mumbai
Android classes in mumbaiAndroid classes in mumbai
Android classes in mumbai
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideAndroid Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start Guide
 
不只自動化而且更敏捷的Android開發工具 gradle
不只自動化而且更敏捷的Android開發工具 gradle不只自動化而且更敏捷的Android開發工具 gradle
不只自動化而且更敏捷的Android開發工具 gradle
 
Reproducible component tests using docker
Reproducible component tests using dockerReproducible component tests using docker
Reproducible component tests using docker
 

More from intive

Rok z Android MVVM
Rok z Android MVVMRok z Android MVVM
Rok z Android MVVM
intive
 
Don't Forget About the Layout
Don't Forget About the LayoutDon't Forget About the Layout
Don't Forget About the Layout
intive
 
You Don't Need Dependency Injection
You Don't Need Dependency InjectionYou Don't Need Dependency Injection
You Don't Need Dependency Injection
intive
 
OWASP Open SAMM
OWASP Open SAMMOWASP Open SAMM
OWASP Open SAMM
intive
 
Porównanie architektur MVVM i MVC (iOS)
Porównanie architektur MVVM i MVC (iOS)Porównanie architektur MVVM i MVC (iOS)
Porównanie architektur MVVM i MVC (iOS)
intive
 
Wprowadzenie do CoreBluetooth
Wprowadzenie do CoreBluetoothWprowadzenie do CoreBluetooth
Wprowadzenie do CoreBluetooth
intive
 
.Net anywhere
.Net anywhere.Net anywhere
.Net anywhere
intive
 
Front end - advanced development for beginners
Front end - advanced development for beginnersFront end - advanced development for beginners
Front end - advanced development for beginners
intive
 
Kotlin, Spek and tests
Kotlin, Spek and testsKotlin, Spek and tests
Kotlin, Spek and tests
intive
 
Patronage 2016 Windows 10 Warsztaty
Patronage 2016 Windows 10 WarsztatyPatronage 2016 Windows 10 Warsztaty
Patronage 2016 Windows 10 Warsztaty
intive
 
Techniczna organizacja zespołu cz 2
Techniczna organizacja zespołu cz 2Techniczna organizacja zespołu cz 2
Techniczna organizacja zespołu cz 2
intive
 
Techniczna organizacja zespołu
Techniczna organizacja zespołuTechniczna organizacja zespołu
Techniczna organizacja zespołu
intive
 
Organizacja zespołu
Organizacja zespołuOrganizacja zespołu
Organizacja zespołu
intive
 
Nie tylko C# - Ekosystem Microsoft dla programistów
Nie tylko C# - Ekosystem Microsoft dla programistówNie tylko C# - Ekosystem Microsoft dla programistów
Nie tylko C# - Ekosystem Microsoft dla programistów
intive
 
Apple Watch - Getting Started
Apple Watch - Getting StartedApple Watch - Getting Started
Apple Watch - Getting Started
intive
 
Clean architecture: Android
Clean architecture: AndroidClean architecture: Android
Clean architecture: Androidintive
 
CoreLocation (iOS) in details
CoreLocation (iOS) in detailsCoreLocation (iOS) in details
CoreLocation (iOS) in details
intive
 
Developer Job in Practice
Developer Job in PracticeDeveloper Job in Practice
Developer Job in Practice
intive
 
Java Script - Object-Oriented Programming
Java Script - Object-Oriented ProgrammingJava Script - Object-Oriented Programming
Java Script - Object-Oriented Programming
intive
 
Internet of Things
Internet of ThingsInternet of Things
Internet of Things
intive
 

More from intive (20)

Rok z Android MVVM
Rok z Android MVVMRok z Android MVVM
Rok z Android MVVM
 
Don't Forget About the Layout
Don't Forget About the LayoutDon't Forget About the Layout
Don't Forget About the Layout
 
You Don't Need Dependency Injection
You Don't Need Dependency InjectionYou Don't Need Dependency Injection
You Don't Need Dependency Injection
 
OWASP Open SAMM
OWASP Open SAMMOWASP Open SAMM
OWASP Open SAMM
 
Porównanie architektur MVVM i MVC (iOS)
Porównanie architektur MVVM i MVC (iOS)Porównanie architektur MVVM i MVC (iOS)
Porównanie architektur MVVM i MVC (iOS)
 
Wprowadzenie do CoreBluetooth
Wprowadzenie do CoreBluetoothWprowadzenie do CoreBluetooth
Wprowadzenie do CoreBluetooth
 
.Net anywhere
.Net anywhere.Net anywhere
.Net anywhere
 
Front end - advanced development for beginners
Front end - advanced development for beginnersFront end - advanced development for beginners
Front end - advanced development for beginners
 
Kotlin, Spek and tests
Kotlin, Spek and testsKotlin, Spek and tests
Kotlin, Spek and tests
 
Patronage 2016 Windows 10 Warsztaty
Patronage 2016 Windows 10 WarsztatyPatronage 2016 Windows 10 Warsztaty
Patronage 2016 Windows 10 Warsztaty
 
Techniczna organizacja zespołu cz 2
Techniczna organizacja zespołu cz 2Techniczna organizacja zespołu cz 2
Techniczna organizacja zespołu cz 2
 
Techniczna organizacja zespołu
Techniczna organizacja zespołuTechniczna organizacja zespołu
Techniczna organizacja zespołu
 
Organizacja zespołu
Organizacja zespołuOrganizacja zespołu
Organizacja zespołu
 
Nie tylko C# - Ekosystem Microsoft dla programistów
Nie tylko C# - Ekosystem Microsoft dla programistówNie tylko C# - Ekosystem Microsoft dla programistów
Nie tylko C# - Ekosystem Microsoft dla programistów
 
Apple Watch - Getting Started
Apple Watch - Getting StartedApple Watch - Getting Started
Apple Watch - Getting Started
 
Clean architecture: Android
Clean architecture: AndroidClean architecture: Android
Clean architecture: Android
 
CoreLocation (iOS) in details
CoreLocation (iOS) in detailsCoreLocation (iOS) in details
CoreLocation (iOS) in details
 
Developer Job in Practice
Developer Job in PracticeDeveloper Job in Practice
Developer Job in Practice
 
Java Script - Object-Oriented Programming
Java Script - Object-Oriented ProgrammingJava Script - Object-Oriented Programming
Java Script - Object-Oriented Programming
 
Internet of Things
Internet of ThingsInternet of Things
Internet of Things
 

Recently uploaded

Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 

Recently uploaded (20)

Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 

Tips & Tricks Android

  • 2. Tips & Tricks list #1 Gradle libraries versions #2 Android Support Annotations #3 Dependencies conflicts resolving #4 StrictMode #5 Tools Attributes
  • 4. Versions for single module def libVersion = [ support : "23.0.1", supportTest: "0.4" ] dependencies { compile "com.android.support:appcompat-v7:${libVersion.support}" compile "com.android.support:recyclerview-v7:${libVersion.support}" androidTestCompile "com.android.support.test:runner:${libVersion.supportTest}" androidTestCompile "com.android.support.test:rules:${libVersion.supportTest}" } #1 Gradle libraries versions root > appModule > build.gradle > module2 > build.gradle > build.gradle
  • 5. Versions for all modules ext { libVersion = [ support : "23.0.1", supportTest: "0.4" ] libDependencies = [ recyclerView : "com.android.support:recyclerview-v7:${libVersion.support}", appCompat : "com.android.support:appcompat-v7:${libVersion.support}", supportTestRunner : "com.android.support.test:runner:${libVersion.supportTest}", supportTestRules : "com.android.support.test:rules:${libVersion.supportTest}" ] } #1 Gradle libraries versions root > appModule > build.gradle > module2 > build.gradle > build.gradle
  • 6. Versions for all modules dependencies { compile libDependencies.recyclerView compile libDependencies.appCompat androidTestCompile libDependencies.supportTestRunner androidTestCompile libDependencies.supportTestRules } #1 Gradle libraries versions root > appModule > build.gradle > module2 > build.gradle > build.gradle
  • 8. #2 Android Support Annotations Resource Type Annotations public void passStringResource(@StringRes int stringResId){...} public void passColorResource(@ColorRes int colorResId){...} public void passDrawable(@DrawableRes int drawableResId){...} public void passColorRgbInt(@ColorInt int rgbColor){...} public void passStringOrColor(@StringRes @ColorRes int stringOrColorResId){...}
  • 9. #2 Android Support Annotations Resource Type Annotations passStringResource(R.string.app_name); passStringResource(R.color.black); passStringResource(1234);
  • 10. #2 Android Support Annotations Resource Type Annotations passStringOrColorResource(R.string.app_name); passStringOrColorResource(android.R.color.white); passStringOrColorResource(R.drawable.ic_launcher);
  • 11. #2 Android Support Annotations Resource Type Annotations passColorRgbInt(resources.getColor(R.color.white)); passColorRgbInt(0xFFFFFFFF); passColorRgbInt(R.color.white);
  • 12. #2 Android Support Annotations Typedef Annotations @IntDef ({ DOWNLOAD_IDLE, DOWNLOAD_IN_PROGRESS}) public @interface DownloadStatus {} public static final int DOWNLOAD_IDLE = 0; public static final int DOWNLOAD_IN_PROGRESS = 1;
  • 13. #2 Android Support Annotations Typedef Annotations public void setDownloadStatus(@DownloadStatus int status) {...}
  • 14. #2 Android Support Annotations Typedef Annotations setDownloadStatus(DOWNLOAD_IDLE); setDownloadStatus(DOWNLOAD_IN_PROGRESS); setDownloadStatus(1234);
  • 16. #3 Dependencies conflicts resolving Google Play Services dependencies conflict Error:Execution failed for task ':app:processDebugResources'. > Error: more than one library with package name 'com.google.android.gms' You can temporarily disable this error with android.enforceUniquePackageName=false However, this is temporary and will be enforced in 1.0
  • 17. #3 Dependencies conflicts resolving Dependencies compile 'com.google.android.gms:play-services-maps:8.1.0' compile 'co.realtime:messaging-android:2.1.52'
  • 18. #3 Dependencies conflicts resolving androidDependencies task to the rescue ./gradlew androidDependencies
  • 19. #3 Dependencies conflicts resolving androidDependencies task to the rescue +--- com.google.android.gms:play-services-maps:8.1.0 | --- com.google.android.gms:play-services-base:8.1.0 | --- com.google.android.gms:play-services-basement:8.1.0 | --- com.android.support:support-v4:23.0.1 | --- LOCAL: internal_impl-23.0.1.jar +--- co.realtime:messaging-android:2.1.52 | +--- LOCAL: json_simple-1.1.jar | +--- LOCAL: httpcore-4.2.4.jar | +--- com.google.android.gms:play-services:6.1.71
  • 20. #3 Dependencies conflicts resolving Fix the issue compile 'com.google.android.gms:play-services:8.1.0' compile 'co.realtime:messaging-android:2.1.52'
  • 22. #4 StrictMode Detect UI Thread operations if (DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyLog() .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog() .build()); }
  • 23. #4 StrictMode Example output StrictMode policy violation; ~duration=6193 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=31 violation=2 at (…) onReadFromDisk(StrictMode.java:1137) (…) at (…) (MainActivity.java:36)
  • 25. #5 Tools Attributes Tools Layout Attributes View in designer. <FrameLayout (...) xmlns:tools="http://schemas.android.com/tools"> <TextView (...) android:text="@string/hello_world" tools:text="@string/long_text" /> <Button android:id="@+id/youCanSeeMeAtRuntime"(...) android:visibility="visible" tools:visibility="gone" /> </FrameLayout>
  • 26. #5 Tools Attributes Tools Layout Attributes View at runtime.
  • 27. #5 Tools Attributes Tools Layout Pointer <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <fragment android:id="@+id/my_fragment" android:name="com.example.user.exampleapp.MyFragment" android:layout_width="match_parent" android:layout_height="match_parent" tools:layout="@layout/my_fragment_layout" /> </FrameLayout>
  • 28. #5 Tools Attributes Tools Layout Pointer Without: With: