Presentation is loading. Please wait.

Presentation is loading. Please wait.

Android SDK & App Development

Similar presentations


Presentation on theme: "Android SDK & App Development"— Presentation transcript:

1 Android SDK & App Development
CSE651C, B.Ramamurthy 4/5/2019

2 Simple Interaction + using Images
From the Internet get images for the four season or any sequential events. Saves these as image0, image1, image2, image3 drawable folder We will use LinearLayout where items are stacked as they come Now add a simple ImageView to display the image0 We will discuss how to add images into the “drawable” folder CSE651C, B.Ramamurthy 4/5/2019

3 ImageView <ImageView android:layout_height="250dp" android:layout_width="match_parent" android:layout_weight="1" android:scaleType="centerCrop" /> CSE651C, B.Ramamurthy 4/5/2019

4 Button Next add a button to create an event to transform the images in the drawable folder <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" android:text="Whats Next?" android:onClick="springToFall"/> CSE651C, B.Ramamurthy 4/5/2019

5 Study the xml items added
Understand the various elements defined in the XML file CSE651C, B.Ramamurthy 4/5/2019

6 Lets add function We will add a Java function that responds to the button thus providing interaction.. Add this function to Java code: public void springToFall(View vw) { ImageView sw = (ImageView) findViewById(R.id.springView); sw.setImageResource(R.drawable.fall); } Execute the program and see it transform from one image to another. CSE651C, B.Ramamurthy 4/5/2019

7 Summary We added interaction to our app We also worked with images
Using this simple example you can build an app that will be carousel of your set of photos for a specific occasion or a specific time period. Next we will look at dealing with numeric data CSE651C, B.Ramamurthy 4/5/2019


Download ppt "Android SDK & App Development"

Similar presentations


Ads by Google