Luca Bedogni Dipartimento di Informatica: Scienza e Ingegneria - - PowerPoint PPT Presentation

luca bedogni
SMART_READER_LITE
LIVE PREVIEW

Luca Bedogni Dipartimento di Informatica: Scienza e Ingegneria - - PowerPoint PPT Presentation

Programming with Android: SDK install and initial setup Luca Bedogni Dipartimento di Informatica: Scienza e Ingegneria Universit di Bologna SDK and initial setup: Outline Today: How to setup a machine to start developing Android


slide-1
SLIDE 1

Programming with Android: SDK install and initial setup

Luca Bedogni

Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

slide-2
SLIDE 2

Luca Bedogni - Programming with Android – SDK install and initial setup

2

SDK and initial setup: Outline ØToday:

§ How to setup a machine to start developing Android applications § An overview of an Android project § Some useful tools § Your first Android application

  • Maybe on a real device!
slide-3
SLIDE 3

Luca Bedogni - Programming with Android – SDK install and initial setup

3

Two options ØHistorically Android development was in Eclipse ØDownload the SDK ØInstall the Android plugin ØNow there is Android Studio ØCustomized environment

slide-4
SLIDE 4

Luca Bedogni - Programming with Android – SDK install and initial setup

4

Which one? ØFor LAM, it’s the same ØIf you already use and love Eclipse, go with it ØYou might see examples done in both platforms

ØYou can always import an Eclipse project into Android Studio ØThe inverse is difficult

slide-5
SLIDE 5

Luca Bedogni - Programming with Android – SDK install and initial setup

5

Android Studio

slide-6
SLIDE 6

Luca Bedogni - Programming with Android – SDK install and initial setup

6

Where and how to get it ØGo to http://developer.android.com/sdk/installing/studio.html ØDownload Android Studio and the SDK ØInstall it and you’re done!

slide-7
SLIDE 7

Luca Bedogni - Programming with Android – SDK install and initial setup

7

Basic requirements ØHow to develop Android applications? ØLinux/Mac OS X/Windows? Doesn’t matter ØA real device is not mandatory ØCode your application in the IDE ØTest it with the emulator ØDeploy it on a real device

slide-8
SLIDE 8

Luca Bedogni - Programming with Android – SDK install and initial setup

8

SDK tools

Ø Android tool Ø Used to get APIs and add-ons Ø You can also start it from Android Studio

slide-9
SLIDE 9

Luca Bedogni - Programming with Android – SDK install and initial setup

9

SDK tools

Ø Android tool Ø Used to get APIs and add-ons Ø You can also start it from Android Studio

slide-10
SLIDE 10

Luca Bedogni - Programming with Android – SDK install and initial setup

10

SDK tools

Ø Android tool Ø Used to get APIs and add-ons Ø You can also start it from Android Studio

slide-11
SLIDE 11

Luca Bedogni - Programming with Android – SDK install and initial setup

11

Your first Android application ØGo to File > New Project

slide-12
SLIDE 12

Luca Bedogni - Programming with Android – SDK install and initial setup

12

Your first Android application ØGo to File > New Project

slide-13
SLIDE 13

Luca Bedogni - Programming with Android – SDK install and initial setup

13

Your first Android application ØGo to File > New Project

slide-14
SLIDE 14

Luca Bedogni - Programming with Android – SDK install and initial setup

14

Your first Android application ØGo to File > New Project

slide-15
SLIDE 15

Luca Bedogni - Programming with Android – SDK install and initial setup

15

Your first Android application

slide-16
SLIDE 16

Luca Bedogni - Programming with Android – SDK install and initial setup

16

Testing on the emulator ØSelect Run > Run App

slide-17
SLIDE 17

Luca Bedogni - Programming with Android – SDK install and initial setup

17

Creating an emulator

Ø Can configure several

  • ptions

Ø You can create as many as you want

slide-18
SLIDE 18

Luca Bedogni - Programming with Android – SDK install and initial setup

18

Did everything went fine?

Ø Test in on the emulator Ø You should see something similar to this

slide-19
SLIDE 19

Luca Bedogni - Programming with Android – SDK install and initial setup

19

Hello world, Android! ØAnatomy of an application ØActivity: what is started ØView: what is seen ØIntent: how to communicate with others ØMix of XML and Java ØGenerally XML for layouts ØJava for the app logic

slide-20
SLIDE 20

Luca Bedogni - Programming with Android – SDK install and initial setup

20

The java and res folders ØAll the code of your application ØThe java folder contains… the java code! ØInside res there are a lot of resources ØImages ØLayouts ØXml files ØAndroidManifest.xml

slide-21
SLIDE 21

Luca Bedogni - Programming with Android – SDK install and initial setup

21

AndroidManifest.xml ØMandatory file for every application ØContains: ØApplication declaration ØPermissions ØIntent filters ØTargets

slide-22
SLIDE 22

Luca Bedogni - Programming with Android – SDK install and initial setup

22

How to test ØVia an AVD

ØFast, possible to have different resolutions, APIs ØNot a real device

ØOn a real device

ØYou get exactly what is deployed ØMust own a real device

ØSo?

ØTest in on AVDs. ØWhen you feel that the application is ready, go with a real device

slide-23
SLIDE 23

Luca Bedogni - Programming with Android – SDK install and initial setup

23

How to deploy ØAndroid applications must be signed before installing them on a real device Ø You need a key for this Ø and you can generate one Ø from the menu.