48
Developing Apps for Android Alan German Ottawa PC Users’ Group

Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Developing Apps for Android

Alan German

Ottawa PC Users’ Group

Page 2: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Get the “How-to” from Youtube

Writing your first Android app – everything you need to know

https://www.youtube.com/watch?v=mAJeK283j0I

Gary Sims, Android Authority

Page 3: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Download Android Studio

https://developer.android.com/studio

Page 4: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Installation Instructions

Page 5: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Ctrl-C to cut

from web page

Ctrl-Shift-V

to paste into

Terminal

Page 6: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

• Ignore Youtube download (JDK) and setup steps

• Unpack zip file to create the folder android-studio

• Run sudo caja (give file manager root access)

• Move android-studio to /usr/local

• Run /usr/local/android-studio/bin/studio.sh

Linux Installation

navigate to the android-studio/bin/ directory, and execute studio.sh

Page 7: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 8: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Leave all defaults:

• Installation type = Standard

• Verify Settings

• Emulator Settings

• Download Components

(e.g. SDK, Android Emulator)

Setup Wizard

Download and installation of multiple components

takes several minutes - eventually we get to the…

Page 9: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Main Menu!

Page 10: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 11: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 12: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 13: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 14: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Menu – Programming – Android Studio

(and… Add to desktop)

Page 15: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Click to display the Event Log

Page 16: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 17: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Project

tree

Page 18: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Code editor and design

Page 19: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Message area

Page 20: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 21: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Palette (Widgets) Properties

Design/Text

Page 22: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Text Mode

Preview

Page 23: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Edit text directly in

the XML file or in

the preview window

Page 24: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 25: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 26: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 27: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

So, what are people

going to do?

Page 28: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

So, what are people

going to do?

…let’s prepare a

response!

Page 29: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 30: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

public void onButtonTap(View v) {

Toast myToast = Toast.makeText(

getApplicationContext(),

“Some text in response",

Toast.LENGTH_LONG);

myToast.show();

}

Add a toast*

*A “toast” is a message that is

briefly displayed on the screen

Page 31: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 32: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 33: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 34: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 35: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 36: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 37: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 38: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Run the current project

(app) in the emulator

Page 39: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Press!

Page 40: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 41: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 42: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Build a Release Version

Page 43: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 44: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 45: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Fix? - Remove the line:

android:layout_below="@+id/textView"

Page 46: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare
Page 47: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

touchy_button.apk

Page 48: Developing Apps for Android - OPCUG · Edit text directly in the XML file or in the preview window . So, what are people going to do? So, what are people going to do? …let’s prepare

Available from the aStore

or from the Pl-a-y Store

App Now Available!

Touchy Button

$0.01