Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Android Studio Tutorial For Beginners -2 | Android Development Tutorial | Android Training | Edureka

This Android Studio tutorial will help you learn the basics of Android App development. It is ideal for both beginners and professionals who wants to learn or brush up the basics of Android. This android tutorial is a two part session, and this is the second session where following topics have been discussed:

1. Event Listeners
2. Intents

  • Login to see the comments

Android Studio Tutorial For Beginners -2 | Android Development Tutorial | Android Training | Edureka

  1. 1. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
  2. 2. Copyright © 2017, edureka and/or its affiliates. All rights reserved. Agenda ✓ What is Android Studio? ✓ Android Stack ✓ Installation ✓ What is an Activity? ✓ Activity Life Cycle ✓ Event Listeners ✓ Intents
  3. 3. Copyright © 2017, edureka and/or its affiliates. All rights reserved. Event Listeners Let’s look at various event listeners in an activity
  4. 4. Copyright © 2017, edureka and/or its affiliates. All rights reserved. Event Listeners  An event listener is an interface in the View class that contains a single callback method.  These are the tickets to capture the user interaction with your UI. This is called when the user either touches the item when in touch mode.  onClick() This is called when the user navigates onto or away from the item, using the navigation-keys or trackball.  onFocusChange() 1 2
  5. 5. Copyright © 2017, edureka and/or its affiliates. All rights reserved. Event Listeners  onLongClick()  onKey()  onTouch() The user either touches and holds the item when in touch mode. Say it holds the suitable "enter" key and holds down on the trackball (for one second). This is called when the user is focused on the item and presses or releases a hardware key on the device. This is called when the user performs an action qualified as a touch event, including a press, a release, or any movement gesture on the screen (within the bounds of the item). 3 4 5
  6. 6. Copyright © 2017, edureka and/or its affiliates. All rights reserved. Intents
  7. 7. Copyright © 2017, edureka and/or its affiliates. All rights reserved. Intents An intent is a messaging object you can use to request an action from another app component. ➢ Methods are used to deliver intents to different components: • context.startActivity() • context.startService() • context.sendBroadcast()
  8. 8. Copyright © 2017, edureka and/or its affiliates. All rights reserved. Intents  An intent can carry data bundle to perform any activity  For example if an activity has to launch an email operation, we can use an intent with ACTION_SEND. Types of Intent: Implicit Intent Explicit Intent 1 2
  9. 9. Copyright © 2017, edureka and/or its affiliates. All rights reserved. Implicit Intent Implicit intent is when the target component is not defined in the intent and the android system has to evaluate the registered components based on the intent data. Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.edureka.co")); startActivity(i); Action Specification
  10. 10. Copyright © 2017, edureka and/or its affiliates. All rights reserved. Explicit Intent Explicit intent is when an application defines the target component directly in the intent. Intent i = new Intent(this, ActivityTwo.class); i.putExtra("Value1", "This is ActivityTwo "); i.putExtra("Value2", "This value two for ActivityTwo"); startActivity(i); Target component
  11. 11. Slide 11 Course Url

×