JY Pathways: Program Android Apps with MIT App Inventor 2

33
Photo by astanush - Creative Commons Attribution-NonCommercial-ShareAlike License https://www.flickr.c Program Android Ap with MIT App Invento 2 Presents…

Transcript of JY Pathways: Program Android Apps with MIT App Inventor 2

Page 1: JY Pathways: Program Android Apps with MIT App Inventor 2

Photo by astanush - Creative Commons Attribution-NonCommercial-ShareAlike License https://www.flickr.com/photos/27965998@N00

Program Android Apps!with MIT App Inventor 2

Presents…

Page 2: JY Pathways: Program Android Apps with MIT App Inventor 2

MIT App Inventor 2:http://ai2.appinventor.mit.edu/

Page 3: JY Pathways: Program Android Apps with MIT App Inventor 2
Page 4: JY Pathways: Program Android Apps with MIT App Inventor 2
Page 5: JY Pathways: Program Android Apps with MIT App Inventor 2
Page 6: JY Pathways: Program Android Apps with MIT App Inventor 2

Add components from palette

Page 7: JY Pathways: Program Android Apps with MIT App Inventor 2

Adjust properties of components

Page 8: JY Pathways: Program Android Apps with MIT App Inventor 2

Drag and drop items into the blocks editor, and snap blocks together

Page 9: JY Pathways: Program Android Apps with MIT App Inventor 2

Now let’s create an app!

Page 10: JY Pathways: Program Android Apps with MIT App Inventor 2

First, start a new project

Page 11: JY Pathways: Program Android Apps with MIT App Inventor 2

Add a label to the screen(a label item shows up in the Components area)

Page 12: JY Pathways: Program Android Apps with MIT App Inventor 2

Add a button to the screen

Page 13: JY Pathways: Program Android Apps with MIT App Inventor 2

Select the Label1 component, and click on Rename.

Page 14: JY Pathways: Program Android Apps with MIT App Inventor 2

Rename Label1 to lblMessage and Button1 to btnEnter

Page 15: JY Pathways: Program Android Apps with MIT App Inventor 2

With lblMessage selected, Change BackgroundColor to Cyan

Change FontSize to 30

Change Height to 50 pixels

Change Width to Fill parent, and clear ‘Text for Label 1’ under Text

Page 16: JY Pathways: Program Android Apps with MIT App Inventor 2

With btnEnter selected, change FontSize to 30

Change Height to 50 pixels

Change Width to Fill parent

Change Text to ‘Click here’

Page 17: JY Pathways: Program Android Apps with MIT App Inventor 2
Page 18: JY Pathways: Program Android Apps with MIT App Inventor 2

In the Blocks editor, select btnEnter

Drag when btnEnter.click to the blank canvas

Page 19: JY Pathways: Program Android Apps with MIT App Inventor 2

Select lblMessage, and drag set lblMessage.Text over to the canvas

Page 20: JY Pathways: Program Android Apps with MIT App Inventor 2

Connect the blocks together

Page 21: JY Pathways: Program Android Apps with MIT App Inventor 2

Under the Built-in blocks, select Text, and drag the empty string “ ” block over to the canvas

Page 22: JY Pathways: Program Android Apps with MIT App Inventor 2

Snap the blocks together, and change the empty string to “Hello world!”

Page 23: JY Pathways: Program Android Apps with MIT App Inventor 2

Let’s test it out!

Page 24: JY Pathways: Program Android Apps with MIT App Inventor 2

Download the MIT AI2 Companion on your mobile phone

Page 25: JY Pathways: Program Android Apps with MIT App Inventor 2

On the upper right-hand side, click on Connect and AI Companion

Launch the MIT AI2 Companion on your mobile phone, and enter the QR Code to see the project in action

Page 26: JY Pathways: Program Android Apps with MIT App Inventor 2

No Android device? No problem!

Page 27: JY Pathways: Program Android Apps with MIT App Inventor 2

Download the App Inventor Setup Package:

http://appinventor.mit.edu/explore/ai2/mac.html

Page 28: JY Pathways: Program Android Apps with MIT App Inventor 2

Click on Connect and then Emulator

Let the Android Emulator load for a few minutes

Page 29: JY Pathways: Program Android Apps with MIT App Inventor 2

Click on the MIT AI2 Companion app on the phone(you may need to connect again to load the project)

Page 30: JY Pathways: Program Android Apps with MIT App Inventor 2

Viola! When the button is clicked, ‘Hello world!’ appears.

Page 31: JY Pathways: Program Android Apps with MIT App Inventor 2

Save the project as an .apk file, and open it up on your Android device

to launch the app

Page 32: JY Pathways: Program Android Apps with MIT App Inventor 2

Congratulations! You’ve successfully created an Android app.

Page 33: JY Pathways: Program Android Apps with MIT App Inventor 2

Questions?

Thank you!

“Like” us on Facebook!:www.bit.ly/jypathways

Follow us on Twitter: @jypathwayswww.jypathways.org