1 of 100

2 of 100

Hackathon

App in 20 hours

11

3 of 100

3

¬

Today’s

questions

How do I prepare?

What instruments to use?

What to consider while coding?

Will there be food?

What if I

want to sleep?

How to divide responsibilities?

What I need to win?

What architecture should I use?

What I shouldn’t do?

How to choose idea?

Where to find tools?

How to make everything in 20 hours?

What are limitations?

Why I should go?

What is important?

What is a hackathon?

How to generate ideas?

How to setup project?

Where to write tasks?

What results are expected?

4 of 100

4

What is a hackathon?

5 of 100

5

HACKATHON

Result

20

Working prototype +

Astonishing presentation +

FUN

hours

of hard work

and determination

Motivation

Very personal

Test your skills,

win prizes, eat free food

Team

Work together, but

divide responsibilities

Use strong sides

hack + marathon

Time

6 of 100

6

Find idea

Find employees

Learn

Popularize

technology

WHY?

7 of 100

7

Test skills

Communicate

Learn

Win

WHY?

8 of 100

8

hackathon

Hash Code

9 of 100

9

>2 screens

Runtime

Permission

<50% mocks

Requirements

10 of 100

10

Working prototype

Presentation

Get prize and have fun!

End result

=

+

11 of 100

11

20 hours

How do I

make it

in only

12 of 100

12

Make presentation

Code

prototype

Find

libraries

Make

a plan

Find

an idea

Setup

project

Your

roadmap

13 of 100

13

ANY QUESTIONS?

14 of 100

14

1

Find an idea

If you already have one, great — just check that team likes it

If not — use brainstorming

15 of 100

15

Memory is not ideal,

but because of this we can create associations

Eric Kandel

16 of 100

16

Brainstorm technic

Cooperate with your team.

Try to generate ideas for 15 minutes — without any critique. Just generate and write down.

If you have trouble with that, try to imagine what problems do you have to solve every day and start from that

Now filter your ideas.

Consider this: idea must be creative, useful and

realistic. And fun for you to work on it.

Something that people will be delighted to use. You can ask around, if you’re not sure.

17 of 100

17

);

18 of 100

18

Inspiration

Or look up free APIs

19 of 100

19

Now your

turn

(interactive, 15 min)

20 of 100

20

2

Make a plan

Good plan is half of success. You don’t have too much time, so use it wisely!

Discuss and write down what

you need to do.

Divide responsibilities in your team — who

will do backed, design, etc

21 of 100

21

Less

is

E

Only handful of features are important

M

O

R

22 of 100

22

MVP

Model View Presenter

Minimal Viable Product

23 of 100

24 of 100

24

Example: app for splitting payment

Login with social networks

Sending money to others

Setting users and count their share

Chat between users

Notifications about payment

List of all previous setups

25 of 100

25

Example: app for splitting payment

Login with social networks

Sending money to others

Setting users and count their share

Chat between users

Notifications about payment

List of all previous setups

26 of 100

26

Example: app for splitting payment

Login with social networks

Sending money to others

Setting users and count their share

Chat between users

Notifications about payment

List of all previous setups

27 of 100

27

Teamwork

It’s important to not interfere each others work

Plan what to do beforehand

VCS is a necessity

Always first discuss

then do

Use tools to help you plan

Most hackathon

winners spend 4-6 hours discussing what and how they will work.

Idea and organisation is key to success

28 of 100

28

Write down

Trello

Google Drive

Github

Pen and paper

29 of 100

29

ANY QUESTIONS?

30 of 100

30

Try

(interactive, 10 min)

yourself

31 of 100

31

3

Setup project

You don’t want to spend time on stuff like .gitignore on hackathon. Prepare beforehand!

Make sure all teammates know how to use git and have rights to read / push to your repo

32 of 100

32

Base project setup

Create empty project in AS

Setup .gitignore

Clone repository

Get base project here:

OR

33 of 100

33

Template project

Glide

Retrofit

Firebase

RxJava

Jetpack

Design, lifecycle, persistency

Background

Firebase

Network

Images

34 of 100

34

Commit together to git

Bitbucket

Github

Gitlab

git

use any

35 of 100

35

Source Tree

36 of 100

36

GitKraken

gitkraken.com/git-client

37 of 100

37

ANY QUESTIONS?

38 of 100

38

4

Find feature libraries

Think — what will help you build project? Look for libraries that implement features from you plan

Use time before to try them out and learn how to use them, so you won’t spend precious time on it during hackathon

39 of 100

39

Android Development Toolbox

40 of 100

40

Database

Authentication

Cloud Messaging

and growing

20

features

Cloud Storage

41 of 100

41

42 of 100

42

43 of 100

43

44 of 100

44

45 of 100

45

46 of 100

46

47 of 100

47

48 of 100

48

49 of 100

49

50 of 100

50

51 of 100

51

52 of 100

52

53 of 100

53

54 of 100

54

Google Play Services

Google Account Login

Google Actions, Base Client Library

Google Sign In

Google Cast

Google Cloud Messaging

Google Drive

Google Fit

Google Location and Activity Recognition

Google Maps

Google Places

Mobile Vision

Google Nearby

Google Panorama Viewer

Google Play Game services

Google Pay

Wear OS by Google

With Google Play services, your app can take advantage of the latest, Google-powered features such as Maps, Drive, Pay, and more. Integrate your app with Google to it’s finest

55 of 100

55

Rx

Permissions

final RxPermissions rxPermissions =

new RxPermissions(this);

// where this is an Activity or Fragment instance

rxPermissions

.request(Manifest.permission.CAMERA,

Manifest.permission.READ_PHONE_STATE)

.subscribe(granted -> {

if (granted) {

// All permissions are granted

} else {

// At least one denied

}

});

If you like to use rx and hate boilerplate use this library to request permissions from user.

56 of 100

56

Rx Location

This library wraps the Location APIs in Observables, Singles, Maybes and Completables. No more managing GoogleApiClients! Also, the resolution of the location settings check is optionally handled by the lib.

// Create one instance and share it

RxLocation rxLocation = new RxLocation(context);

LocationRequest locationRequest = LocationRequest.create()

.setPriority(

LocationRequest.PRIORITY_HIGH_ACCURACY)

.setInterval(5000);

rxLocation.location().updates(locationRequest)

.flatMap(location ->

rxLocation.geocoding()

.fromLocation(location)

.toObservable())

.subscribe(address -> {

/* do something */

});

57 of 100

57

EasyImage

EasyImage allows you to easily capture images from the gallery, camera or documents without creating lots of boilerplate.

<uses-permission android:name="android.permission.

WRITE_EXTERNAL_STORAGE" />

Taking image straight from camera

  • EasyImage.openCamera(

Activity activity, int type);

  • EasyImage.openCamera(

Fragment fragment, int type);

Taking image from gallery or the gallery picker if there is more than 1 gallery app

  • EasyImage.openGallery(

Activity activity, int type);

  • EasyImage.openGallery(

Fragment fragment, int type);

58 of 100

58

Butterknife

Field and method binding for Android views which uses annotation processing to generate boilerplate code for you.

  • Eliminate findViewById calls by using @BindView on fields.
  • Eliminate anonymous inner-classes for listeners by annotating methods with @OnClick and others.

class ExampleActivity extends Activity {

@BindView(R.id.title) TextView title;

@BindView(R.id.footer) TextView footer;

@Override public void onCreate(

Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(

R.layout.simple_activity);

ButterKnife.bind(this);

// TODO Use fields...

}

}

59 of 100

59

Parceler

📦 Android Parcelables made easy through code generation.

�It is a code generation library that generates the Android Parcelable boilerplate source code. No longer do you have to implement the Parcelable interface, the writeToParcel() or createFromParcel() or the public static final CREATOR.

@Parcel

public class Example {

String name;

int age;

public Example() {}

public Example(int age, String name) {

this.age = age;

this.name = name;

}

public String getName() {

return name;

}

public int getAge() { return age; }

}

Parcelable wrapped = Parcels.wrap(

new Example("Andy", 42));

60 of 100

60

Switcher

Library that allows you to easily switch between your content, progress, empty placeholder view. It does it with smooth crossfade animation.

You only show content, progress or error view. The switcher finds out what's currently visible and hides it.

61 of 100

61

PhotoView

Simple pinch-to-zoom, rotations and more for your gallery. Works perfectly when used in a scrolling parent (such as ViewPager).

62 of 100

62

Bottom

Sheets

BottomSheet is an Android component which presents a dismissible view from the bottom of the screen. BottomSheet can be a useful replacement for dialogs and menus but can hold any view so the use cases are endless. 

63 of 100

63

Google Maps

Charts

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, dragging and animations.

64 of 100

64

Ultimate RecyclerView

UltimateRecyclerView is a RecyclerView(advanced and flexible version of ListView) with pulling to refresh, loading more, swiping to dismiss, draging and drop, animations ,sticky header,show or hide toolbar and FAB when scrolling and many other features.

65 of 100

65

RecyclerView Animators

An Android Animation library which easily add itemanimator to RecyclerView items. Supports ~20 item state change type animation types and even scrolling animations.

66 of 100

66

Transitions Everywhere

Backport and somewhat bug fix for Transition Animations API.

Read more: https://medium.com/@andkulikov/animate-all-the-things-transitions-in-android-914af5477d50

67 of 100

67

Design resources

68 of 100

68

Where to find more libraries?

Maven Repository

Main artifact location. Contains almost everything.

Android Arsenal

Giant collection of android libraries. Categorized.

List of nice Android UI libraries

69 of 100

69

ANY QUESTIONS?

70 of 100

70

5

Focus on features

Time is precious. Write only code that will help you show idea — not beautiful architecture.

Don’t reinvent wheels — use tools you prepared to get things done.

71 of 100

71

You don’t have time to implement everything

Use mocks

when you need them

72 of 100

72

Free APIs and

server mocks

apilist.fun

…or just mock retrofit responses

73 of 100

73

How to write

code

faster

74 of 100

74

1. Use

hotkeys

75 of 100

75

Ctrl + Shift + A

Cmd + Shift + A

Win/Linux

MacOS

Find action

76 of 100

76

Alt + Insert

Cmd + N

Win/Linux

MacOS

Generate code

77 of 100

77

Alt + Enter

Alt + Enter

Win/Linux

MacOS

Quick fix

78 of 100

78

Double Shift

Win/Linux

MacOS

Search everywhere

Double Shift

79 of 100

79

Alt + J

Win/Linux

MacOS

Multicursor <3

Ctrl + G

80 of 100

80

2. Use live templates

81 of 100

81

Live

Templates

Location

82 of 100

82

Live

Templates

Location

83 of 100

83

84 of 100

84

3. Speed up your

IDE

85 of 100

85

Give more memory

to VM

86 of 100

86

Give more memory

to VM

87 of 100

87

Speed up

gradle

88 of 100

88

Speed up

gradle

89 of 100

89

Optimize build

android {

  defaultConfig {  

minSdkVersion 21

    crunchPngs false

}

90 of 100

90

Don’t do this on hackathon!

Do nitty-gritty stuff

Create beautiful architecture

Write tests

Use hard technology

Make real life app

Dispute and interfere

91 of 100

91

Mentors Role

WILL:

WON’T:

Help with API options

Write code for you

Help if AS not working

Review code

Give you shoulder and good word

Make decisions

92 of 100

92

ANY QUESTIONS?

93 of 100

93

6

Present your idea

You need to present your idea. Be quick, make some slides and tell us what you’ve learnt.

It’s very important part on every hackathon, but don’t spend all your time on it. Short video is great to show-and-tell.

94 of 100

94

Remember

to:

Take laptop and charge

Take passport

Check-in with family

Take life necessities

Sleep well!

95 of 100

95

Example Timeline

18:30

18:55

96 of 100

96

19:00

20:00

23:00

97 of 100

97

03:00

07:30

10:00

98 of 100

98

12:00

14:00

15:00

16:00

99 of 100

99

Next: Advanced Course

It’s just a beginning

100 of 100

100

CODE TOGETHER

ON HACKATHON

15.12-16.12

Avito

Лесная, 7