android studio

54
Android studio #Android meetup

Upload: zeljko-plesac

Post on 15-Jul-2015

398 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Android studio

Android studio

#Android meetup

Page 2: Android studio

Željko PlesacAndroid developer at

Infinum

[email protected]

Page 3: Android studio

long time ago, in a galaxy far, far away…

Page 4: Android studio

• Eclipse IDE - official IDE for Android development

• ADT plugin

• Apache Ant for building projects

Page 5: Android studio

Reality

Page 6: Android studio

• ADT plugin was buggy and unstable

• frequent crashes

• agony and crying after updates

• no multi-flavour support

• slow

• Clear project -> Restart -> Crying -> Clear project -> Restart -> Praying to God -> Clear project…

Page 7: Android studio

…so Google said…

Page 8: Android studio

and so, Android studio was born!

Page 9: Android studio

• officially announced at Google I/0 2013 Conference

• early alpha release was published in July, 2013

• quickly got attention of Android developers

Page 10: Android studio
Page 11: Android studio

Android studio #1

Basic info

Page 12: Android studio

• as of December 2014, official IDE for Android development (Eclipse ADT plugin is deprecated)

• based on IntelliJ platform

• uses Gradle build system

• free for usage

• Windows, Linux, Mac

• available at http://developer.android.com/sdk/index.html

Page 13: Android studio

• 3 release channels

1. Canary - most recent changes, subject to bugs. Latest version is 1.1. Preview 1

2. Beta - changes which are tested, but still not ready for production. Latest version is 1.0.2.

3. Stable - official, production channel. Latest version is 1.0.2.

Page 14: Android studio

Android studio #2

Migrating from Eclipse

Page 15: Android studio

• To migrate existing Android projects, simply import them using Android Studio:

1. Generate Gradle files in Eclipse (Export -> Generate Gradle files)

2. In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window.

3. Click Import Non-Android Studio project.

4. Locate the project you exported from Eclipse, expand it, select the build.gradle file and click OK.

5. In the following dialog, leave Use gradle wrapper selected and click OK. (You do not need to specify the Gradle home.)

Page 16: Android studio

AND DANCE THE VICTORY DANCE!!!

Page 17: Android studio
Page 18: Android studio

Also, don’t forget to delete Eclipse.

Page 19: Android studio

Android studio #3

Project structure

Page 20: Android studio

Project & project modules

Page 21: Android studio

The traditional project view (left) and the Android project view (right).

Page 22: Android studio

Build types: • debug, test, release…

Product flavour groups and flavours: • architecture, free/paid…

Page 23: Android studio

Android studio #4

Gradle

Page 24: Android studio

• Gradle is project automation tool which is used for build our Android apps

• based upon concepts of Apache Ant and Apache Maven

• uses Groovy-based domain-specific-language (DSL)

• your new best friend and worst enemy

Page 25: Android studio

Default and signing configuration

Page 26: Android studio

Build types

Page 27: Android studio

Lint options

Page 28: Android studio

Repositories and external dependencies

Page 29: Android studio

• Gradle also has a few drawbacks:

• speed of execution - it’s slower than Apache Ant

• work in progress - every new version brings a lot of changes

• still has some bugs

Page 30: Android studio

Android studio #5

Sexy features

Page 31: Android studio

Translations editor

Page 32: Android studio

Layout preview(which actually works)

Page 33: Android studio

Preview layout on different devices…

Page 34: Android studio

… and for different device images, display densities, UI modes, locales, and Android versions (multi-API version rendering)

Logo

Page 35: Android studio

Organize resources and assets

Page 36: Android studio

• bitmap rendering in the debugger

• image and color preview

• support for version control systems

• style extraction

• deep code analysis

Page 37: Android studio

Android studio #6

Tips and tricks

Page 38: Android studio

Surround withWrap a block of code in

some structure.

Mac: Cmd+Alt+T Windows/Linux: Ctrl+Alt+T

Page 39: Android studio

Quick Definition Lookup

Finds the implementation of a method or class but don't

want to lose your current context

Mac: Cmd+space Windows/Linux: Ctrl+shift+i

Page 40: Android studio

Analyze Data flow to HereTake the current variable,

parameter or field and show the path it has taken to get

here

Menu: Analyze → Analyze Data Flow to Here

Find action: Analyze Data Flow to Here

Page 41: Android studio

Compare With Branch (Git)

Compare the current file or folder with another branch.

Menu : VCS -> Git -> Compare With Branch

Find Actions: Compare With Branch

Page 42: Android studio

Compare With Clipboard

Take the current selection and do a diff with the content of

your clipboard.

Mouse: right-click the selection and select Compare With

Clipboard Find action: compare with

clipboard

Page 43: Android studio

Extract Method

Extract a code block in a new method.

Mac: Cmd+Alt+M Windows/Linux: Ctrl+Alt+M

Page 44: Android studio

Live Templates

Quickly insert a snippet of code.

Mac: Cmd+J Windows/Linux: Ctrl+J

Page 45: Android studio

Parameter Info

Same list of parameter names as the one that appears when you are writing a method call

Mac: Cmd+P windows/linux: Ctrl+P

Page 46: Android studio

Recently Changed FilesLists files that were recently

modified locally

Mac: Cmd+Shift+E Windows/Linux: Ctrl+Shift+E

Page 47: Android studio

The File Structure

PopupShow an outline of the

current class and navigate in it.

Mac: Cmd+f12 Windows/Linux: Ctrl+f12

Page 48: Android studio

The SwitcherAllows you to navigate to a tab or a

panel. Once it is opened, as long as you hold the ctrl key, you can navigate quickly

by using the number or letter shortcut. You can also close a tab or a panel by

pressing backspace when it is selected.

Mac: Ctrl+Tab Windows/Linux: Ctrl+Tab

Page 49: Android studio

Suggested plugins• Parcelable Generator - for generating parceable code

• Genymotion

• Crashlytics

• ButterKnifeZelezny - one-click creation of Butterknife view injections.

• would like to find some good database management plugin

Page 50: Android studio

Android studio #7

Additional info

Page 51: Android studio

Infinum #swag

• read our blog - a lot of cool stuff about technology https://www.infinum.co/the-capsized-eight

• subscribe to our newsletter

• come and join us for Android talks www.infinum.co/android-talks

Page 52: Android studio

https://www.infinum.co/careers

Page 53: Android studio

Thanks!

Page 54: Android studio

[email protected]

skype: zeljko.plesac

twitter: @ZeljkoPlesac