The Action Bar is a graphical component at the top of an application that identifies the current section, provides user actions, and defines navigation. It can include tabs, a drop-down menu, or navigation drawer for navigation between sections. Actions are added via XML menu files and handled via callback methods. The Action Bar can be customized through styles and drawables to control its appearance and behavior.
This document provides a tutorial on using the Action Bar in Android applications. It discusses what the Action Bar is, how to add actions and menu items, customize the Action Bar, use navigation features like tabs and dropdown menus, and more advanced topics like custom views, contextual action modes, and action providers. Code examples are provided throughout to demonstrate various Action Bar features and capabilities.
The document provides tutorials for various user interface widgets in Android application development. It includes tutorials for date pickers, time pickers, spinners, buttons, text fields, checkboxes, radio buttons, toggle buttons, and rating bars. Each tutorial section describes how to add the widget to an app layout, populate it with data where applicable, and add click listeners or other logic to handle user interactions with the widget. The tutorials are intended to demonstrate how to correctly implement and use common UI elements in Android apps.
Fragments allow modularizing an app's UI into reusable components. A fragment represents a portion of UI within an activity and has its own lifecycle. Multiple fragments can be used within a single activity to create a multi-pane UI or reuse fragments across activities. Key advantages are modularity, ability to reuse fragments, and maintaining a back stack of fragment states. The document discusses implementing fragments in different screen types, writing fragment and activity classes, and including fragments in layouts. It also covers fragment types like ListFragment and DialogFragment and ensuring compatibility by adding the support library.
Fragments allow modular sections of an activity's UI to be reused across activities and configurations. A fragment must be embedded in an activity and shares its lifecycle. Fragments can be added or removed dynamically at runtime and their transactions can be added to a back stack. Activities can combine multiple fragments to build a multi-pane UI on tablets and reuse fragments across activities on handsets. To create a fragment, subclass Fragment and move code from activities into fragment lifecycle methods.
Android intents allow communication between application components like activities, services, and content providers. There are two main types of intents - implicit intents do not specify the component and rely on available system components, while explicit intents directly specify the component class. Intents are commonly used to start activities, services, display web pages or contacts, and broadcast messages. The example shows using an implicit intent to launch a web browser and explicit intents to start one activity from another and pass data between activities.
Fragments allow modularization of activities on larger screens like tablets. A fragment represents a behavior or UI portion and has its own lifecycle callbacks. Fragments can be placed in an activity layout via XML or added dynamically in code. Multiple fragments can be combined in a single activity to build a multi-pane UI. The activity lifecycle influences fragments, and fragments can be retained across configuration changes using setRetainInstance(true).
The document discusses application resources in Android. It covers externalizing resources from code, providing default and alternative resources for different configurations, and accessing resources in code and XML. Key points include placing resources in subdirectories under res/, specifying alternative resources using qualifiers like -hdpi, and referencing resources using IDs from the R class in code or XML syntax like @string/name.
This document discusses styles and themes in Android development. It explains that styles define the format and look of UI elements, and can be applied to individual views or whole activities. Themes are similar to styles but apply formatting to an entire layout or activity. The document provides examples of defining styles and themes in XML files, extending existing styles, and applying themes in the Android manifest. It also covers best practices for style hierarchy and customizing default themes.
This document provides a tutorial on using the Action Bar in Android applications. It discusses what the Action Bar is, how to add actions and menu items, customize the Action Bar, use navigation features like tabs and dropdown menus, and more advanced topics like custom views, contextual action modes, and action providers. Code examples are provided throughout to demonstrate various Action Bar features and capabilities.
The document provides tutorials for various user interface widgets in Android application development. It includes tutorials for date pickers, time pickers, spinners, buttons, text fields, checkboxes, radio buttons, toggle buttons, and rating bars. Each tutorial section describes how to add the widget to an app layout, populate it with data where applicable, and add click listeners or other logic to handle user interactions with the widget. The tutorials are intended to demonstrate how to correctly implement and use common UI elements in Android apps.
Fragments allow modularizing an app's UI into reusable components. A fragment represents a portion of UI within an activity and has its own lifecycle. Multiple fragments can be used within a single activity to create a multi-pane UI or reuse fragments across activities. Key advantages are modularity, ability to reuse fragments, and maintaining a back stack of fragment states. The document discusses implementing fragments in different screen types, writing fragment and activity classes, and including fragments in layouts. It also covers fragment types like ListFragment and DialogFragment and ensuring compatibility by adding the support library.
Fragments allow modular sections of an activity's UI to be reused across activities and configurations. A fragment must be embedded in an activity and shares its lifecycle. Fragments can be added or removed dynamically at runtime and their transactions can be added to a back stack. Activities can combine multiple fragments to build a multi-pane UI on tablets and reuse fragments across activities on handsets. To create a fragment, subclass Fragment and move code from activities into fragment lifecycle methods.
Android intents allow communication between application components like activities, services, and content providers. There are two main types of intents - implicit intents do not specify the component and rely on available system components, while explicit intents directly specify the component class. Intents are commonly used to start activities, services, display web pages or contacts, and broadcast messages. The example shows using an implicit intent to launch a web browser and explicit intents to start one activity from another and pass data between activities.
Fragments allow modularization of activities on larger screens like tablets. A fragment represents a behavior or UI portion and has its own lifecycle callbacks. Fragments can be placed in an activity layout via XML or added dynamically in code. Multiple fragments can be combined in a single activity to build a multi-pane UI. The activity lifecycle influences fragments, and fragments can be retained across configuration changes using setRetainInstance(true).
The document discusses application resources in Android. It covers externalizing resources from code, providing default and alternative resources for different configurations, and accessing resources in code and XML. Key points include placing resources in subdirectories under res/, specifying alternative resources using qualifiers like -hdpi, and referencing resources using IDs from the R class in code or XML syntax like @string/name.
This document discusses styles and themes in Android development. It explains that styles define the format and look of UI elements, and can be applied to individual views or whole activities. Themes are similar to styles but apply formatting to an entire layout or activity. The document provides examples of defining styles and themes in XML files, extending existing styles, and applying themes in the Android manifest. It also covers best practices for style hierarchy and customizing default themes.
The Browser Object Model (BOM) in JavaScript includes the properties and methods for JavaScript to interact with the web browser.
BOM provides you with window object, for example, to show the width and height of the window. It also includes the window.screen object to show the width and height of the screen.
The document describes how to build a simple two activity Android app in Android Studio. It includes steps to create a new project, add an empty activity, build a basic user interface with an EditText and Button, add logic to start a new activity on button click, and display data passed between activities. The steps demonstrate fundamental concepts of building Android apps such as activities, intents, and passing data.
A service in Android runs in the background without a user interface. It can be started and stopped to perform long-running operations like playing audio. A service is not a separate process or a thread but allows work to be done in the background even when the user is not interacting with the app. The document provides an example service app that runs a background service displaying a notification every 5 seconds until stopped. It demonstrates starting and stopping the service from an activity and handling the service lifecycle through onCreate(), onStart(), and onDestroy() methods.
The document discusses functions in C programming. The key points are:
1. A function is a block of code that performs a specific task. Functions allow code reusability and modularity.
2. main() is the starting point of a C program where execution begins. User-defined functions are called from main() or other functions.
3. Functions can take arguments and return values. There are different ways functions can be defined based on these criteria.
4. Variables used within a function have local scope while global variables can be accessed from anywhere. Pointers allow passing arguments by reference.
Android uses Views and ViewGroups to create user interfaces. Views occupy rectangular areas on screen and handle drawing and events. Common widgets like Buttons and TextViews are subclasses of View. Layouts like LinearLayout and RelativeLayout are ViewGroups that position child Views. Layout parameters specify how Views are positioned. Common event listeners include onClick and onTouch, which call registered event handlers when triggered by user interaction.
Dart is an object-oriented programming language developed by Google that can be used to build web, server, and mobile applications. Some key points about Dart include:
- It is influenced by languages like Smalltalk, JavaScript, Java and C#
- Dart was first released in 2013 and the latest version is 2.2 from 2019
- It supports concepts like classes, libraries, functions and operators
- Dart can be used to create single page web apps and has been used by Google for apps like Gmail and Google Maps
An introduction to resource management in Android. Namely, the presentation discusses how to correctly account for different screen densities and sizes.
This set of slides introduces the reader to the concepts of Android Activities and Views. After presenting these two concepts in general terms, it continues with a detailed description of the activity lifecycle. It follows a discussion on how to structure the user interface in terms of View and ViewGroup objects. Finally, the presentation shows how to frame Android application development within the dictates of the Model-View-Controller (MVC) pattern.
This document discusses different types of notifications in Android, including toast notifications, status bar notifications, and alarm manager notifications. It provides code examples for creating each type. Toast notifications display temporary messages on screen without user interaction. Status bar notifications add icons and messages to the status bar that expand when pulled down, and can launch an activity when clicked. The alarm manager allows triggering notifications at specific times in the future.
An adapter in Android acts as a bridge between an AdapterView and the underlying data for that view. The adapter provides access to the data items and is responsible for creating a view for each item. There are two main types of adapter views: ListView and Spinner. An AdapterView handles filling its layout with data through an adapter and handling user selections by setting an OnItemClickListener. Developers can use a ListActivity, which simplifies working with lists by automatically creating a ListView, or extend Activity and manually create the ListView.
1. Understanding Android Events
2. Event Listeners and Callback Methods
2.1 onClick()
2.2 onLongClick()
2.3 onFocusChange()
2.4 onKey()
2.5 onTouch()
2.6 Using a separate Listener class
2.7 Using a Named Inner Class for Event Handling
2.8 Handling Events by Having Main Activity Implement Listener Interface
2.9 Handling Events by Specifying the Event Handler Method in main.xml
2.10 Handling Events by Specifying the Event Handler Method in main.xml(cont.)
3. Exercise 5
This document provides an overview of basic object-oriented programming (OOP) concepts including objects, classes, inheritance, polymorphism, encapsulation, and data abstraction. It defines objects as entities with both data (characteristics) and behavior (operations). Classes are blueprints that are used to create objects. Inheritance allows objects to inherit properties from parent classes. Polymorphism allows code to take different forms. Encapsulation wraps data and functions into classes, hiding information. Data abstraction focuses on important descriptions without details.
The document discusses arrays in JavaScript. It defines arrays as data structures that can hold related items and notes they are dynamic. Arrays in JavaScript allow each element to be referenced by its index number starting from zero. Individual elements can be accessed using the name of the array, brackets, and the element index number. The length property allows arrays to know their size. Examples are provided for declaring, initializing, and manipulating arrays including using for loops and passing arrays to functions.
This document discusses different types of animations in Android including frame-by-frame animation, tween animation, interpolators, and layout animation. Frame-by-frame animation involves playing a sequence of images like a flipbook. Tween animation uses interpolators to transition properties like translation, rotation, scale, and alpha over time. Layout animation applies animations when views are added or removed from a layout. The document provides details on creating animation resources in XML and applying them through code.
JavaScript is a scripting language used to make web pages interactive. It was created in 1995 and standardized as ECMAScript. JavaScript can access and modify the content, structure, and style of documents. It is used to handle events, perform animations, and interact with forms on web pages. Common uses of JavaScript include form validation, navigation menus, lightboxes, and sliders on websites.
Fragments allow modular and reusable components in an Android application. They are portions of UI for an activity that have their own lifecycle and can be added or removed during runtime. The key aspects are:
- Fragments were introduced in Android 3.0 but can be used in older versions with the compatibility library.
- Their lifecycle is directly tied to the host activity - pausing/destroying the activity also pauses/destroys fragments.
- They are defined as subclasses of Fragment and implement lifecycle methods like onCreateView to define the UI.
- Fragments can be added to activities declaratively in XML layouts or programmatically using transactions.
The document discusses various types of user interfaces in Android. It describes the view hierarchy in Android using ViewGroups and Views as the basic building blocks. It explains common layouts like LinearLayout, RelativeLayout, TableLayout, GridLayout and ListView that can be used to arrange views. Key classes involved include View, ViewGroup, and different view subclasses that serve as widgets. The document also compares Java and Android approaches to designing user interfaces.
Android offers three types of application menus: options menus which appear when the user presses the menu button and contains the primary menu items for an activity; context menus which open with a long press on a view; and submenus which are nested menus that appear when an options menu item is selected. Options menus can be icon menus displaying the first six items or expanded menus showing additional items, and Android provides methods for creating, updating, and responding to selection of menu items. Context menus also allow registering views for long press context menus and handling item selection.
- Angular modules help organize an application into blocks of related functionality. Modules declare components, directives, pipes and services that belong to that module.
- There are different types of modules like root modules, feature modules, and shared modules. The root module launches the app. Feature modules extend functionality. Shared modules contain reusable constructs.
- Modules can import and export specific constructs to make them available to other modules. Services declared in a module are singletons app-wide unless the module is lazy loaded. Core modules contain global services imported by the root module only.
The document discusses several new features and APIs in Android 3.0 (Honeycomb) for tablets, including fragments which allow recomposing UI based on factors like screen size, loaders for asynchronously fetching content, an enhanced action bar for navigation and menus, hardware accelerated graphics, and the new holographic UI design. It also questions what some aspects of Android 3.0 may mean for future phone releases and how to detect "tablet-y" systems.
Android Support Library: Using ActionBarCompatcbeyls
A complete practical guide on how to implement an ActionBar for Android 2.1+ using the Android Support Library.
It also explains how to migrate to ActionBarCompat if you are already familiar with ActionBarSherlock.
Note: this presentation is suitable for AppCompat up to version 20. Instructions have changed a bit in the more recent versions.
The Browser Object Model (BOM) in JavaScript includes the properties and methods for JavaScript to interact with the web browser.
BOM provides you with window object, for example, to show the width and height of the window. It also includes the window.screen object to show the width and height of the screen.
The document describes how to build a simple two activity Android app in Android Studio. It includes steps to create a new project, add an empty activity, build a basic user interface with an EditText and Button, add logic to start a new activity on button click, and display data passed between activities. The steps demonstrate fundamental concepts of building Android apps such as activities, intents, and passing data.
A service in Android runs in the background without a user interface. It can be started and stopped to perform long-running operations like playing audio. A service is not a separate process or a thread but allows work to be done in the background even when the user is not interacting with the app. The document provides an example service app that runs a background service displaying a notification every 5 seconds until stopped. It demonstrates starting and stopping the service from an activity and handling the service lifecycle through onCreate(), onStart(), and onDestroy() methods.
The document discusses functions in C programming. The key points are:
1. A function is a block of code that performs a specific task. Functions allow code reusability and modularity.
2. main() is the starting point of a C program where execution begins. User-defined functions are called from main() or other functions.
3. Functions can take arguments and return values. There are different ways functions can be defined based on these criteria.
4. Variables used within a function have local scope while global variables can be accessed from anywhere. Pointers allow passing arguments by reference.
Android uses Views and ViewGroups to create user interfaces. Views occupy rectangular areas on screen and handle drawing and events. Common widgets like Buttons and TextViews are subclasses of View. Layouts like LinearLayout and RelativeLayout are ViewGroups that position child Views. Layout parameters specify how Views are positioned. Common event listeners include onClick and onTouch, which call registered event handlers when triggered by user interaction.
Dart is an object-oriented programming language developed by Google that can be used to build web, server, and mobile applications. Some key points about Dart include:
- It is influenced by languages like Smalltalk, JavaScript, Java and C#
- Dart was first released in 2013 and the latest version is 2.2 from 2019
- It supports concepts like classes, libraries, functions and operators
- Dart can be used to create single page web apps and has been used by Google for apps like Gmail and Google Maps
An introduction to resource management in Android. Namely, the presentation discusses how to correctly account for different screen densities and sizes.
This set of slides introduces the reader to the concepts of Android Activities and Views. After presenting these two concepts in general terms, it continues with a detailed description of the activity lifecycle. It follows a discussion on how to structure the user interface in terms of View and ViewGroup objects. Finally, the presentation shows how to frame Android application development within the dictates of the Model-View-Controller (MVC) pattern.
This document discusses different types of notifications in Android, including toast notifications, status bar notifications, and alarm manager notifications. It provides code examples for creating each type. Toast notifications display temporary messages on screen without user interaction. Status bar notifications add icons and messages to the status bar that expand when pulled down, and can launch an activity when clicked. The alarm manager allows triggering notifications at specific times in the future.
An adapter in Android acts as a bridge between an AdapterView and the underlying data for that view. The adapter provides access to the data items and is responsible for creating a view for each item. There are two main types of adapter views: ListView and Spinner. An AdapterView handles filling its layout with data through an adapter and handling user selections by setting an OnItemClickListener. Developers can use a ListActivity, which simplifies working with lists by automatically creating a ListView, or extend Activity and manually create the ListView.
1. Understanding Android Events
2. Event Listeners and Callback Methods
2.1 onClick()
2.2 onLongClick()
2.3 onFocusChange()
2.4 onKey()
2.5 onTouch()
2.6 Using a separate Listener class
2.7 Using a Named Inner Class for Event Handling
2.8 Handling Events by Having Main Activity Implement Listener Interface
2.9 Handling Events by Specifying the Event Handler Method in main.xml
2.10 Handling Events by Specifying the Event Handler Method in main.xml(cont.)
3. Exercise 5
This document provides an overview of basic object-oriented programming (OOP) concepts including objects, classes, inheritance, polymorphism, encapsulation, and data abstraction. It defines objects as entities with both data (characteristics) and behavior (operations). Classes are blueprints that are used to create objects. Inheritance allows objects to inherit properties from parent classes. Polymorphism allows code to take different forms. Encapsulation wraps data and functions into classes, hiding information. Data abstraction focuses on important descriptions without details.
The document discusses arrays in JavaScript. It defines arrays as data structures that can hold related items and notes they are dynamic. Arrays in JavaScript allow each element to be referenced by its index number starting from zero. Individual elements can be accessed using the name of the array, brackets, and the element index number. The length property allows arrays to know their size. Examples are provided for declaring, initializing, and manipulating arrays including using for loops and passing arrays to functions.
This document discusses different types of animations in Android including frame-by-frame animation, tween animation, interpolators, and layout animation. Frame-by-frame animation involves playing a sequence of images like a flipbook. Tween animation uses interpolators to transition properties like translation, rotation, scale, and alpha over time. Layout animation applies animations when views are added or removed from a layout. The document provides details on creating animation resources in XML and applying them through code.
JavaScript is a scripting language used to make web pages interactive. It was created in 1995 and standardized as ECMAScript. JavaScript can access and modify the content, structure, and style of documents. It is used to handle events, perform animations, and interact with forms on web pages. Common uses of JavaScript include form validation, navigation menus, lightboxes, and sliders on websites.
Fragments allow modular and reusable components in an Android application. They are portions of UI for an activity that have their own lifecycle and can be added or removed during runtime. The key aspects are:
- Fragments were introduced in Android 3.0 but can be used in older versions with the compatibility library.
- Their lifecycle is directly tied to the host activity - pausing/destroying the activity also pauses/destroys fragments.
- They are defined as subclasses of Fragment and implement lifecycle methods like onCreateView to define the UI.
- Fragments can be added to activities declaratively in XML layouts or programmatically using transactions.
The document discusses various types of user interfaces in Android. It describes the view hierarchy in Android using ViewGroups and Views as the basic building blocks. It explains common layouts like LinearLayout, RelativeLayout, TableLayout, GridLayout and ListView that can be used to arrange views. Key classes involved include View, ViewGroup, and different view subclasses that serve as widgets. The document also compares Java and Android approaches to designing user interfaces.
Android offers three types of application menus: options menus which appear when the user presses the menu button and contains the primary menu items for an activity; context menus which open with a long press on a view; and submenus which are nested menus that appear when an options menu item is selected. Options menus can be icon menus displaying the first six items or expanded menus showing additional items, and Android provides methods for creating, updating, and responding to selection of menu items. Context menus also allow registering views for long press context menus and handling item selection.
- Angular modules help organize an application into blocks of related functionality. Modules declare components, directives, pipes and services that belong to that module.
- There are different types of modules like root modules, feature modules, and shared modules. The root module launches the app. Feature modules extend functionality. Shared modules contain reusable constructs.
- Modules can import and export specific constructs to make them available to other modules. Services declared in a module are singletons app-wide unless the module is lazy loaded. Core modules contain global services imported by the root module only.
The document discusses several new features and APIs in Android 3.0 (Honeycomb) for tablets, including fragments which allow recomposing UI based on factors like screen size, loaders for asynchronously fetching content, an enhanced action bar for navigation and menus, hardware accelerated graphics, and the new holographic UI design. It also questions what some aspects of Android 3.0 may mean for future phone releases and how to detect "tablet-y" systems.
Android Support Library: Using ActionBarCompatcbeyls
A complete practical guide on how to implement an ActionBar for Android 2.1+ using the Android Support Library.
It also explains how to migrate to ActionBarCompat if you are already familiar with ActionBarSherlock.
Note: this presentation is suitable for AppCompat up to version 20. Instructions have changed a bit in the more recent versions.
This document discusses the Android action bar and fragment framework. It covers key action bar components like app icons, action buttons, and navigation modes. It also summarizes the fragment lifecycle callbacks and how to implement different navigation modes like standard, tabs and lists. Finally, it proposes interfaces for a container to manage fragments and a navigation interface for the action bar.
The document provides an overview of new features in Android Honeycomb (3.0) and Ice Cream Sandwich (4.0), including:
1) New UI metaphors like the ActionBar and onscreen adaptive menus.
2) Spec hardware changes like the lack of hard buttons on newer devices.
3) A new "Holographic" look and feel with glows, depth lines, and 3D transitions.
4) New APIs like Fragments, the ActionBar, enhanced widgets/notifications, drag and drop, peer-to-peer networking via NFC Android Beam and WiFi Direct.
The action bar is a window feature that identifies the application and user location, and provides user actions and navigation modes. A notification is a message you can display to the user outside of your application's normal UI. When you tell the system to issue a notification, it first appears as an icon in the notification area. In this unit we will discuss about the action bar and notification usage in Android.
After you’ve done all the UI optimizations recommended by UX designers, how do you make your interface even more engaging? That’s where the Samsung Mobile SDK can help. Part 1 of Advancing Your UI introduces you to three new technologies -- Look, Motion, and Gesture – that allow you to create an interface that engages your audience in ways you have not yet explored.
Android Sliding Menu dengan Navigation DrawerAgus Haryanto
The document discusses how to create an Android project using a navigation drawer to display a class schedule. It provides step-by-step instructions to set up the navigation drawer menu, fragments to display the schedule for each day, and classes to store and display the schedule data. Key aspects covered include creating layouts for the drawer menu, fragments and schedule items, adding sample schedule data, and using fragments and bundles to display the appropriate schedule based on the selected drawer menu item.
The action bar provides consistency across Android apps and allows adding navigation features, search, and other actions. It displays the activity title and app icon. To add an action bar, activities must extend ActionBarActivity if supporting older Android versions, or set the theme if supporting API 11+. Action buttons and menu items are defined in XML and inflated into the action bar. Clicking items calls onOptionsItemSelected() to handle the action. The up button navigates to the parent activity.
Android App Development - 04 Views and layoutsDiego Grancini
The document discusses views and layouts in Android. It covers the View and ViewGroup classes used to create graphical interfaces. Layouts can be defined in XML files and include common layouts like LinearLayout, RelativeLayout, and ScrollView. It also discusses how to create custom views by extending the View class and implementing common callback methods like onDraw(), onMeasure(), and event handlers. Optimizing custom views to minimize calls to methods like invalidate() and requestLayout() is also covered.
Improving android experience for both users and developersPavel Lahoda
Android UI and User Experience has changed dramatically in the recent version(s) and while users generally enjoy the new features, there are still several areas that are left to application-level-DIY-patterns. For developers, this is double challenge, they want to provide users with the bleeding edge UI patterns and at the same time, they have to deal with evolving API, that sometimes changes dramatically.
Presentation covers the gotchas developer might face dealing with ever-moving Android API, and how to utilize Java language and the tools it have to make the experience for developer more pleasant. Typical trends in the API will get analyzed and divided into several areas or "patterns", discussing typical scenarios how these components are designed and implemented.
This talk will propose several such UI patterns, that will compete to become "de facto" standards and details on the implementation, including possible impact on existing API as we have both end users and developers in mind.
The list of patterns/areas discussed in the talk include following :
ActionBar
ListView
TimePicker
KineticGestureComponent
The document discusses opportunities to improve the Android user experience through more flexible and responsive layouts, improved action bar designs, and innovative input methods like gesture and sensor-based interactions. It presents examples of custom view groups and adapters that provide flexible resizing and binding of data to views. The talk argues the action bar could be improved through more consistent behavior and use of available screen space. Ideas for new date/time pickers and gesture-based interactions are also proposed to enhance the Android experience.
With the introduction of the iPhone 6s and the iPhone 6s Plus, Apple added 3D Touch, a new dimension to the multi-touch user interface. This new technology senses how deeply users press the display and provides a new way to interact with the iPhone.
In iOS 9, Apple introduced several 3D Touch APIs. In this session I will explain in a practical way what is 3D Touch and how you can benefit from it in your app. I will cover home screen quick actions, peek and pop actions and also how to use the force properties of a UITouch event.
Design Patterns for Tablets and SmartphonesMichael Galpin
This is a talk I gave at AnDevCon. It talks about ways to take advantage of features introduced in Android 3.0 to create more modular and better looking apps.
The document discusses tween animation in Android. It explains that tween animation takes parameters like start/end values, duration, and rotation to animate an object. The Animation class is used to load animations from XML files using AnimationUtils. Example code shows how to create zoom in/out, rotate, and fade animations by defining XML files and starting the animations on a menu click.
This document provides an overview of key Android development concepts and techniques. It discusses fragments, the support library, dependency injection, image caching, threading and AsyncTask, notifications, supporting multiple screens, and optimizing ListView performance. The document also recommends several popular Android libraries and open source apps that demonstrate best practices.
This document contains notes from a presentation on navigation architecture components. It discusses navigation graphs, navigation hosts, navigation controllers, safe args for passing data between fragments, and deep linking. Code samples are provided for setting up navigation in activities, fragments, and navigation drawers. Issues and resources for further learning about navigation architecture are also listed.
A Single activity app with Jetpack's Navigation ComponentBoonya Kitpitak
Since Google I/O 2017, using the single-activity pattern along with Android Jetpack's Navigation Component has become a recommended way of developing Android applications. In this session I would like to share how the Android Navigation Component and the single-activity pattern make my life easier. The topics session include Why should we use the single-activity pattern, Essential navigation component concepts and features of Android navigation component.
The Mighty Power of the Accessibility Service - Guy Griv, PepperDroidConTLV
This document describes an accessibility service that displays podcast ratings in the Pocket Casts app. It discusses what accessibility services are and how they work, including retrieving UI information, responding to events, and drawing over other apps. It then provides details on how this specific service scans the Pocket Casts UI, searches for podcast ratings online, and displays them in a floating view over the app.
AngularJS is a JavaScript MVC framework created by Google to build maintainable web applications. It focuses on the HTML side of web apps and allows separating an application into different logical modules like controllers that handle application behavior and views that define what the user sees. The framework uses directives, templates, and controllers to structure an app and bind these to a model to power the application.
Similar to Android App Development - 05 Action bar (20)
Android App Development - 14 location, media and notificationsDiego Grancini
The document discusses location, media, and notifications in Android. It describes how to get the last known location using the LocationManager and register for location updates. It explains how to play audio and video using the MediaPlayer and VideoView classes. It also covers creating normal and big style notifications using the NotificationCompat builder and sending notifications via GCM.
Android App Development - 13 Broadcast receivers and app widgetsDiego Grancini
A Broadcast Receiver is a component that receives intents sent by Context.sendBroadcast() or Context.sendOrderedBroadcast(). It must be declared in the manifest and can receive intents at any time. An AppWidget is a widget that can be placed on home screens and receives regular updates from an AppWidgetProvider, which extends BroadcastReceiver. AppWidgets use RemoteViews to populate lists and allow click handling through pending intents.
The document discusses different animation systems available in Android including view animation, property animation, and drawable animation. View animation allows animating views and can translate, scale, rotate, and change opacity. Property animation applies animations to object properties and offers more flexibility. Drawable animation displays sequential drawables to create animation.
Android App Development - 11 Lists, grids, adapters, dialogs and toastsDiego Grancini
The document discusses different Android UI components including list views, grid views, adapters, dialogs, and toasts. It explains that list views and grid views display data from arrays or cursors using adapters. Adapters define how data is inserted and each element is displayed. Common adapter classes include ArrayAdapter, SimpleAdapter, and CursorAdapter. Dialogs create popup windows to prompt users for input. Standard dialogs include AlertDialog, DatePickerDialog, and ProgressDialog. Toasts briefly display short non-interactive messages on screen.
Android App Development - 10 Content providersDiego Grancini
A Content Provider manages access to a centralized database and allows other applications to query or modify this data through a common interface. It implements methods like query(), insert(), update(), and delete() to retrieve, modify and delete data in response to requests from other applications via a ContentResolver. The Content Provider must define an authority and URI paths to identify its data tables. It uses a SQLite database to manage the underlying data and a UriMatcher to route incoming requests to the correct methods.
The platform allows for different storage options based on needs: SharedPreferences stores key-value pairs for primitive data, internal storage stores generic private data, external storage stores public data, and SQLite DB provides private database storage. Network connection can also store data remotely on a server.
A service is a component that performs long-running operations in the background independently of any activity. There are two types of services: started services, which run indefinitely until stopped, and bound services, which are attached to components and stop when all components detach. Services must be declared in the manifest and have lifecycle methods like onStartCommand(), onBind(), onCreate(), and onDestroy().
The document discusses Android threading and processes. It explains that by default all components of an application run in the same process and thread, but components can be defined to run in separate processes. It describes how the system manages processes and process importance levels. It also discusses how to handle long operations to avoid blocking the UI thread, including using AsyncTask and Loaders to run operations asynchronously.
Fragments allow dividing the graphical interface of an activity into independent and reusable modules. A fragment has its own lifecycle and can be dynamically added or removed from an activity during runtime. Communication between a fragment and its activity can occur through interfaces or by accessing the activity from within the fragment. Fragments help create flexible and adaptable user interfaces for different screen sizes and configurations.
The document discusses how to use resources in Android applications. Resources such as layouts, drawables, strings, and other asset files are stored in the res folder. Alternative resources can be provided for different configurations by adding qualifier suffixes like -land (landscape layouts). The build process generates an R class containing IDs for all resources to access them from code.
Android App Development - 02 Activity and intentDiego Grancini
1. An Intent is used to communicate between components in Android and can be explicit or implicit. It contains an action, data, and optional extras.
2. An Activity provides a visual user interface and is started using an Intent. Each Activity has a lifecycle that must be managed by the developer.
3. The system uses Intent filters declared in the manifest to match Activities to Intents and start the correct Activity.
- Android is an open source operating system based on a Linux kernel that runs primarily on smartphones and tablets. It uses Java code and supports various hardware capabilities and input types.
- The Android SDK provides developers with tools like Android Studio, emulators, and debugging tools to develop and test Android applications.
- An Android application consists of code written in Java along with resources and a manifest file. The manifest declares app components, permissions, and configuration settings. Components allow the app to perform tasks like displaying UI and running background services.
2. ActionBar
The Action Bar is the graphical component of each application
that identifies the navigated section, provide the user with the
possible actions for that section and defines the type of
navigation.
Action Bar
1. Icon that identifies the application
2. Available Shares
3. Menu overflow to other actions
3. ActionBar
The ActionBar has been added with Android 3.0. To make its
functionality available for all versions of Android, you must:
● Integrate the support library v7 and use:
import android.support.v7.app.ActionBar;
instead of:
import android.app.ActionBar;
● Extend ActionBarActivity class
● Declare a compatible theme for the Activity:
<activity android:theme="@style/Theme.AppCompat.Light" >
You can show or hide the ActionBar using:
getSupportActionBar().show();
getSupportActionBar().hide();
Support Action Bar
4. ActionBar
In order to add actions on the Action Bar actions must be defined
in /res/menu folder with an .xml file:
<menu
xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/action_search"
android:icon="@drawable/ic_action_search"
android:title="@string/action_search"/>
<item android:id="@+id/action_compose"
android:icon="@drawable/ic_action_compose"
android:title="@string/action_compose" />
</menu>
In Activity class you must override the onCreateOptionMenu()
method:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.actions, menu);
return true;
}
Action Items
5. ActionBar
The management of the actions and their visibility are entrusted
to the system which calculates the available space and adds
them according to the definition of the xml file. Adding the
showAsAction attribute in the menu you can manage the actions:
●
never:it is never shown
●
ifRoom: it's shown if there is enaough space available,
otherwise it is added to the overflow
●
always: it's always shown
<item
android:id="@+id/action_compose"
android:icon="@drawable/ic_action_compose"
android:showAsAction="ifRoom"/>
Action Items
6. ActionBar
When the user interacts with the Action Items the
Activity.onOptionsItemSelected() method is invoked :
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_search:
openSearch();
return true;
case R.id.action_compose:
composeMessage();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
Action Items Selection
7. ActionBar
If the space for action is not enough, you can bring up an
extension on the bottom of the display in which Action Items are
shown.
To do so, you must add the following attribute to the Activity in the
Manifest:
android:uiOptions="splitActionBarWhenNarrow"
Split Action Bar
8. ActionBar
You can enable the up navigation by enabling the user to return to
a higher level of navigation. To do this, in onCreate() method it
must be entered:
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
This enables clicking on the home icon and show the arrow.
Pattern: up the navigation and click on the back of the system do
not always get the same result:
●Back navigation: it shows the order in reverse chronological
navigation
●Up navigation: it shows hierarchically the higher level navigation
Up Navigation
9. ActionBar
In order to define the result of the up navigation through Activity,
there are 2 alternatives:
● You can defines the ParentActivity in Manifest for each
Activity:
android:parentActivityName="com.example.myfirstapp.MainActivity"
● You can override:
@Override
public Intent getSupportParentActivityIntent() {
return super.getSupportParentActivityIntent();
}
Up Navigation
10. ActionBar
The Action View is a widget that replaces the icon when the user
interacts with it. In order to declare an Action View you must add
the following in the menu file:
● android:actionLayout="@layout/search_view"
● android:actionViewClass="android.support.v7.widget.Sea
rchView"
Action View
11. ActionBar
An Action Provider as a ActionView replaces the button, but it has
complete control of the behavior of the Action.
To insert a Action Provider on the Action Bar You must add the
following attribute inside the menu xml file (there are predefined
by the ActionProvider platform, as ShareActionProvider):
android:actionProviderClass="android.support.v7.widget.ShareActionProvider"
To define a custom Action Provider you must extend
ActionProvider. In these cases it is not necessary to enter the
event management in Activity.onOptionsItemSelected(), but you
can use the ActionProvider.onPerformDefaultAction().
Action Provider
12. ActionBar
In a Custom Action Provider you must:
● Pass the Context to the costructor:
public CustomActionProvider(Context context) {
super(context);
}
● Define the Action View:
@Override
public View onCreateActionView() {
LayoutInflater inflater = LayoutInflater.from(getContext());
View view = inflater.inflate(R.layout.activity_main, null);
return view;
}
● Define the action:
@Override
public boolean onPerformDefaultAction() {
Intent intent = new Intent(Intent.ACTION_SEND);
getContext().startActivity(intent);
return true;
}
Action Provider
13. ActionBar
The Action Bar allows you to define a 3-tier Application
Navigation:
● Navigation Tabs: the user navigates between sections with
horizontal swype
● Drop-Down Menu: the user selects the title of the Action Bar
and a drop down menu appears with a list of available
sections
● Navigation Drawer: the user selects the application icon on
the Action Bar and an additional menu appears to the left
where the developer can put any type of View.
Navigation
14. ActionBar
The graphical management of the placement of the Tab is given
to the system that decides whether to include them as part of the
Action Bar or in a separate space.
Navigation - Tabs
To integrate the Activity with this type of navigation:
● Declare the Tab Navigation in Activity.onCreate():
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
15. ActionBar
Navigation - Tabs
● Implement ActionBar.TabListener interface:
@Override
public void onTabReselected(Tab arg0, FragmentTransaction arg1) {
}
@Override
public void onTabSelected(Tab arg0, FragmentTransaction arg1) {
}
@Override
public void onTabUnselected(Tab arg0, FragmentTransaction arg1) {
}
● Add Tabs to the Action Bar in Activity.onCreate():
Tab tab = getSupportActionBar().newTab().setText(R.string.example)
.setTabListener(this);
getSupportActionBar().addTab(tab);
16. ActionBar
Navigation – DropDown Menu
The DropDown menu (or Spinner) is used when it is not
frequently change the contents of the Activity.
17. ActionBar
Navigation – DropDown Menu
In order to integrate it:
● Declare List Navigation in Activity.onCreate():
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
● Create a SpinnerAdapter:
SpinnerAdapter mSpinnerAdapter = ArrayAdapter.createFromResource(this,
R.array.action_list,
android.R.layout.simple_spinner_dropdown_item);
● Implements ActionBar.OnNavigationListener:
@Override
public boolean onNavigationItemSelected(int position, long itemId) {
return true;
}
● Set the callbacks to handle Action Bar click:
getSupportActionBar().setListNavigationCallbacks(spinnerAdapter,
navigationCallback);
18. ActionBar
Navigation – Drawer
The Navigation Drawer is a panel that appears to the left as the
user selects the icon for the Action Bar and shows you the
navigation options.
19. ActionBar
Navigation – Drawer
In order to integrate it:
● Insert a DrawerLayout as Activity layout root:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start" />
</android.support.v4.widget.DrawerLayout>
20. ActionBar
Navigation – Drawer
● Retrieve Activity DrawerLayout and ListView:
DrawerLayout mDrawerLayout = (DrawerLayout)
findViewById(R.id.drawer_layout);
ListView mDrawerList = (ListView) findViewById(R.id.left_drawer);
● Set an Adapter to the list:
mDrawerList.setAdapter(new ArrayAdapter<String>(this,
R.layout.drawer_list_item, mPlanetTitles));
● Handle the on item clicks of the list:
mDrawerList.setOnItemClickListener(this);
It is possible to handle the Navigation Drawer opening/closing
events:
ActionBarDrawerToggle mDrawerToggle = new ActionBarDrawerToggle(this,
mDrawerLayout, R.drawable.ic_drawer, R.string.drawer_open,
R.string.drawer_close) {
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
}
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
21. ActionBar
Action Bar Style
In order to customize the Action Bar you can use styles in
/res/values file.
<resources>
<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:actionBarTabTextStyle">@style/TabTextStyle</item>
<item name="android:actionMenuTextColor">@color/actionbar_text</item>
<item name="actionBarStyle">@style/MyActionBar</item>
<item name="actionBarTabTextStyle">@style/TabTextStyle</item>
<item name="actionMenuTextColor">@color/actionbar_text</item>
</style>
<style name="MyActionBar" parent="@style/Widget.AppCompat.ActionBar">
<item name="android:titleTextStyle">@style/TitleTextStyle</item>
<item name="android:background">@drawable/actionbar_background</item>
<item name="android:backgroundStacked">@drawable/actionbar_background</item>
<item name="android:backgroundSplit">@drawable/actionbar_background</item>
<item name="titleTextStyle">@style/TitleTextStyle</item>
<item name="background">@drawable/actionbar_background</item>
<item name="backgroundStacked">@drawable/actionbar_background</item>
<item name="backgroundSplit">@drawable/actionbar_background</item>
</style>
<style name="TitleTextStyle" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">@color/actionbar_text</item>
</style>
<style name="TabTextStyle" parent="@style/Widget.AppCompat.ActionBar.TabText">
<item name="android:textColor">@color/actionbar_text</item>
</style>
</resources>