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.
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.
Android UI adapters allow AdapterViews like ListView and Spinner to display data. AdapterViews rely on Adapters to provide Views for each data item. Adapters implement interfaces like ListAdapter and bind data to Views. ListActivity makes it easy to display a list using a ListAdapter like ArrayAdapter. Spinner displays a single child and uses a SpinnerAdapter to provide its dropdown options.
Android Training (AdapterView & Adapter)Khaled Anaqwa
The AdapterView is a ViewGroup that displays data through an Adapter. Common subclasses are ListView, Spinner, and Gallery. The Adapter provides the data and Views for each item. AdapterView is responsible for displaying the items and handling user selection. ListActivity simplifies displaying a list bound to an Adapter. The Adapter populates the list and notifies the AdapterView of data changes.
The document discusses ListViews in Android, including introducing AdapterViews and common adapter types like ArrayAdapter. It covers implementing a basic ListView with an ArrayAdapter, using custom adapters, view holders for optimization, adding listeners, headers/footers, and using ListActivity for simplified list handling.
The document provides instructions for creating a custom list view in Android. It explains that a list view displays data items and uses an adapter to link the data to views. It demonstrates how to create a custom adapter class that extends BaseAdapter and overrides methods like getCount(), getItem(), and getView(). The getView() method is used to inflate a custom row layout and populate it with data for each list item. The document also shows how to set up the list view in an activity's layout, populate it with sample data, and assign the custom adapter.
Lecture Slides for List Views [Android ]Nehil Jain
The document discusses list views and adapters for software development on portable devices. It describes the problem of loading large lists inefficiently and solutions like populating views on demand. It explains Android list views and adapters, including how they recycle views to reduce object churn. It provides examples of using list activities with different adapter types and layouts, and discusses optimizing performance by reusing views and using a view holder pattern.
This post will walk you through Android ListView Tutorial for building simple and customized ListView using different Android adapters.
List is one of the most common UI patterns, which is being used extensively to display the collection of data elements in rows. In android ListView is a view group that displays a list of scrollable items. The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array.
The document outlines key concepts for Android app code advancement including arrays, lists, array adapters, list views, and recycler views. It provides details on each concept, such as arrays being used to store multiple values of the same data type and array adapters acting as bridges between data sources and UI components. Additionally, it proposes a mini photo gallery app example and discusses the scope and future of Android development in Pakistan.
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.
Android UI adapters allow AdapterViews like ListView and Spinner to display data. AdapterViews rely on Adapters to provide Views for each data item. Adapters implement interfaces like ListAdapter and bind data to Views. ListActivity makes it easy to display a list using a ListAdapter like ArrayAdapter. Spinner displays a single child and uses a SpinnerAdapter to provide its dropdown options.
Android Training (AdapterView & Adapter)Khaled Anaqwa
The AdapterView is a ViewGroup that displays data through an Adapter. Common subclasses are ListView, Spinner, and Gallery. The Adapter provides the data and Views for each item. AdapterView is responsible for displaying the items and handling user selection. ListActivity simplifies displaying a list bound to an Adapter. The Adapter populates the list and notifies the AdapterView of data changes.
The document discusses ListViews in Android, including introducing AdapterViews and common adapter types like ArrayAdapter. It covers implementing a basic ListView with an ArrayAdapter, using custom adapters, view holders for optimization, adding listeners, headers/footers, and using ListActivity for simplified list handling.
The document provides instructions for creating a custom list view in Android. It explains that a list view displays data items and uses an adapter to link the data to views. It demonstrates how to create a custom adapter class that extends BaseAdapter and overrides methods like getCount(), getItem(), and getView(). The getView() method is used to inflate a custom row layout and populate it with data for each list item. The document also shows how to set up the list view in an activity's layout, populate it with sample data, and assign the custom adapter.
Lecture Slides for List Views [Android ]Nehil Jain
The document discusses list views and adapters for software development on portable devices. It describes the problem of loading large lists inefficiently and solutions like populating views on demand. It explains Android list views and adapters, including how they recycle views to reduce object churn. It provides examples of using list activities with different adapter types and layouts, and discusses optimizing performance by reusing views and using a view holder pattern.
This post will walk you through Android ListView Tutorial for building simple and customized ListView using different Android adapters.
List is one of the most common UI patterns, which is being used extensively to display the collection of data elements in rows. In android ListView is a view group that displays a list of scrollable items. The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array.
The document outlines key concepts for Android app code advancement including arrays, lists, array adapters, list views, and recycler views. It provides details on each concept, such as arrays being used to store multiple values of the same data type and array adapters acting as bridges between data sources and UI components. Additionally, it proposes a mini photo gallery app example and discusses the scope and future of Android development in Pakistan.
An adapter is used to connect data from a data source to views in an AdapterView like a ListView. The adapter provides the views for each item in the data set by inflating a layout. To create a list with images, you make a custom ArrayAdapter subclass that overrides getView() to set the text and image for each item based on its name. You provide layout XML for each list item and start a ListActivity to display the list.
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.
AdRotator and AdRepeater Control in Asp.Net for Msc CSThanveen
The document describes the ASP.NET AdRotator control which is used to display a sequence of ad images randomly by selecting from a predefined list stored in an XML file. The XML file contains <Advertisements> and <Ad> tags to define each ad along with elements like <ImageUrl>, <NavigateUrl>, <AlternateText>, <Keyword> and <Impressions>. The AdRotator control presents ads each time a page loads and navigates to a new URL when ads are clicked. It can fetch ad information from a database or XML file and display ads randomly with the help of a Timer control.
This document discusses arrays and hashtables in PowerShell. It provides information on creating arrays, accessing and modifying array elements, sorting arrays, combining arrays, and removing elements from arrays. It also discusses creating hashtables or associative arrays and using them to define mappings between labels and items.
Indexes are optional database structures that improve the performance of queries on tables. Indexes work like the index in a book, allowing faster access to table data. The database automatically maintains indexes as the associated table data changes. Indexes can be created, dropped, or renamed as needed without affecting applications or other indexes.
This document discusses programming SQL Server data mining with Analysis Management Objects (AMO) and stored procedures. It describes how to create mining structures and models using AMO, including defining columns, updating objects, and processing models. It also explains how to create, execute, and debug stored procedures for adding business logic, including registering assemblies, setting permissions, and attaching to processes for debugging. The goal is to provide an overview of programming options for data mining with SQL Server.
This document discusses ListViews and ListActivities in Android application development. It covers:
- ListViews display scrollable lists via an Adapter that provides data and converts it to list fields. Standard adapters include ArrayAdapter and CursorAdapter.
- ListActivities simplify handling lists by extending the Activity class and providing list management methods like setListAdapter() and onListItemClick().
- Adapters can use default or custom layouts and the ListView recycles views for performance. Interacting with the underlying data model is also demonstrated.
This document provides information about various Android development topics including:
- ListAdapters and mapping models to UI using an MVVM-like pattern
- Creating custom lists
- Starting a new activity using an Intent and passing data between activities
- Understanding the Android activity lifecycle and methods like onPause() and onResume()
- Handling configuration changes that recreate the activity
- Working with permissions
The document discusses common patterns for working with lists, launching new screens, and handling activity state changes. It also provides code examples for starting a new activity, passing data between activities, and handling the activity lifecycle callbacks.
Day 8: Dealing with Lists and ListViewsAhsanul Karim
The document discusses ListViews and ListActivities in Android. It covers:
1) Using the ListView and ListActivity classes to display scrollable lists of data from an Adapter.
2) Developing custom Adapters by extending the BaseAdapter class to provide data and convert it to list item views.
3) Techniques like view recycling and ViewHolders to improve ListView performance with large datasets.
4) Examples of creating ListActivities with ArrayAdapters, custom row layouts, and handling click/long click events.
This quick start guide covers connecting to data sources, using report bands, adding dynamic elements like parameters and variables, creating subreports and subdatasets, configuring HTML5 charts, publishing reports to Jaspersoft Server, and information on additional training. The slides explain how to connect to databases, explore the project explorer and outline views, add different types of report bands, set up parameters, variables, and expressions, build subreports and subdatasets including within tables, configure charts, and publish and view reports on the Jaspersoft server. Training resources through the jaspersoft website are provided.
The document discusses different sorting algorithms and methods. It introduces the concept of sortable objects that implement the Comparable interface and defines sorting algorithms like insertion sort, shell sort, selection sort, bubble sort, and quicksort. It also describes how sorting is implemented for arrays and collections in Java and the classes and methods involved in the sorting process.
The document provides an overview of SAP Webi (Web Intelligence) reporting tools. It describes the history and architecture of Webi, how to create reports using various data sources, and how to use features like filters, formulas, and sending reports to other users. The document also discusses related tools like the Business Explorer (BEx) for strategic analysis and query functions.
This document provides details on developing a website for an automotive industry client using technologies like PHP, MySQL, HTML, CSS, JavaScript, AngularJS. It includes implementation of pie charts and bar graphs to visualize discrete data from a MySQL database. Responsive design and search/sort filters using AngularJS are also implemented. The website would have pages for Home, Services, Analysis, Clients, and Contact Us.
The document discusses using templates with list-bound controls like the Repeater and DataList in ASP.NET to display data. It describes creating the controls, binding them to a data source, setting properties, and using templates like ItemTemplate, FooterTemplate, and HeaderTemplate to display the data. As an example, it demonstrates using a DataList control to display data through templates.
Here i am sharing the details of collections classes in C# for learining similar kind of c# interview question you can refer this link http://skillgun.com/csharp/interview-questions-and-answers
This document provides an overview of data binding in WPF, including:
1) Simple data binding allows binding one control's property to one object's data property either one-way or two-way.
2) Complex data binding allows binding to lists of objects using data templates to display each object.
3) Validation, filtering, sorting and grouping of data is supported through collection views.
4) Data can be bound to XML, LINQ, ADO.NET, datasets or loaded directly from code behind.
Wildcards with extends allow flexibility when getting values out of a container by accepting subtypes, while wildcards with super allow flexibility when putting values into a container by accepting supertypes. The Get and Put Principle recommends using extends when only getting values, super when only putting values, and no wildcard when both getting and putting. Key limitations are that extends only allows null to be added and super only allows the Object type to be retrieved.
This document discusses creating custom usage reports in EPiServer. It describes setting up a basic report interface using an ASPX page and assigning an EPiServer master page. It also covers populating the report by overriding the OnLoad method, retrieving content type and usage data from repositories, and generating statistics on total, deleted, and published content for each type. The next steps mentioned are to create additional reports, extract them into a separate project, and package the reports as a Nuget package for sharing.
Disconnected Architecture and Crystal report in VB.NETEverywhere
This document discusses disconnected architecture in ADO.NET. It explains that ADO.NET uses a dataset object to enable disconnected data access through filling the dataset using a data adapter. The dataset acts as an in-memory cache of data and does not interact directly with the data source. Data tables within the dataset contain rows and columns of data. The data adapter acts as a bridge between the dataset and data source, using commands to fill the dataset from a query and update changes back to the source. Stored procedures can also be used to encapsulate database operations when working with a dataset in a disconnected manner.
ASP.NET 08 - Data Binding And RepresentationRandy Connolly
This document discusses different ways to represent and bind data in ASP.NET applications. It covers data binding controls to data sources, using .NET collections like ArrayList and Dictionary to store data, using generic collections, populating and using DataTable and DataSet objects to store and manipulate tabular data, and integrating data with XML.
An adapter is used to connect data from a data source to views in an AdapterView like a ListView. The adapter provides the views for each item in the data set by inflating a layout. To create a list with images, you make a custom ArrayAdapter subclass that overrides getView() to set the text and image for each item based on its name. You provide layout XML for each list item and start a ListActivity to display the list.
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.
AdRotator and AdRepeater Control in Asp.Net for Msc CSThanveen
The document describes the ASP.NET AdRotator control which is used to display a sequence of ad images randomly by selecting from a predefined list stored in an XML file. The XML file contains <Advertisements> and <Ad> tags to define each ad along with elements like <ImageUrl>, <NavigateUrl>, <AlternateText>, <Keyword> and <Impressions>. The AdRotator control presents ads each time a page loads and navigates to a new URL when ads are clicked. It can fetch ad information from a database or XML file and display ads randomly with the help of a Timer control.
This document discusses arrays and hashtables in PowerShell. It provides information on creating arrays, accessing and modifying array elements, sorting arrays, combining arrays, and removing elements from arrays. It also discusses creating hashtables or associative arrays and using them to define mappings between labels and items.
Indexes are optional database structures that improve the performance of queries on tables. Indexes work like the index in a book, allowing faster access to table data. The database automatically maintains indexes as the associated table data changes. Indexes can be created, dropped, or renamed as needed without affecting applications or other indexes.
This document discusses programming SQL Server data mining with Analysis Management Objects (AMO) and stored procedures. It describes how to create mining structures and models using AMO, including defining columns, updating objects, and processing models. It also explains how to create, execute, and debug stored procedures for adding business logic, including registering assemblies, setting permissions, and attaching to processes for debugging. The goal is to provide an overview of programming options for data mining with SQL Server.
This document discusses ListViews and ListActivities in Android application development. It covers:
- ListViews display scrollable lists via an Adapter that provides data and converts it to list fields. Standard adapters include ArrayAdapter and CursorAdapter.
- ListActivities simplify handling lists by extending the Activity class and providing list management methods like setListAdapter() and onListItemClick().
- Adapters can use default or custom layouts and the ListView recycles views for performance. Interacting with the underlying data model is also demonstrated.
This document provides information about various Android development topics including:
- ListAdapters and mapping models to UI using an MVVM-like pattern
- Creating custom lists
- Starting a new activity using an Intent and passing data between activities
- Understanding the Android activity lifecycle and methods like onPause() and onResume()
- Handling configuration changes that recreate the activity
- Working with permissions
The document discusses common patterns for working with lists, launching new screens, and handling activity state changes. It also provides code examples for starting a new activity, passing data between activities, and handling the activity lifecycle callbacks.
Day 8: Dealing with Lists and ListViewsAhsanul Karim
The document discusses ListViews and ListActivities in Android. It covers:
1) Using the ListView and ListActivity classes to display scrollable lists of data from an Adapter.
2) Developing custom Adapters by extending the BaseAdapter class to provide data and convert it to list item views.
3) Techniques like view recycling and ViewHolders to improve ListView performance with large datasets.
4) Examples of creating ListActivities with ArrayAdapters, custom row layouts, and handling click/long click events.
This quick start guide covers connecting to data sources, using report bands, adding dynamic elements like parameters and variables, creating subreports and subdatasets, configuring HTML5 charts, publishing reports to Jaspersoft Server, and information on additional training. The slides explain how to connect to databases, explore the project explorer and outline views, add different types of report bands, set up parameters, variables, and expressions, build subreports and subdatasets including within tables, configure charts, and publish and view reports on the Jaspersoft server. Training resources through the jaspersoft website are provided.
The document discusses different sorting algorithms and methods. It introduces the concept of sortable objects that implement the Comparable interface and defines sorting algorithms like insertion sort, shell sort, selection sort, bubble sort, and quicksort. It also describes how sorting is implemented for arrays and collections in Java and the classes and methods involved in the sorting process.
The document provides an overview of SAP Webi (Web Intelligence) reporting tools. It describes the history and architecture of Webi, how to create reports using various data sources, and how to use features like filters, formulas, and sending reports to other users. The document also discusses related tools like the Business Explorer (BEx) for strategic analysis and query functions.
This document provides details on developing a website for an automotive industry client using technologies like PHP, MySQL, HTML, CSS, JavaScript, AngularJS. It includes implementation of pie charts and bar graphs to visualize discrete data from a MySQL database. Responsive design and search/sort filters using AngularJS are also implemented. The website would have pages for Home, Services, Analysis, Clients, and Contact Us.
The document discusses using templates with list-bound controls like the Repeater and DataList in ASP.NET to display data. It describes creating the controls, binding them to a data source, setting properties, and using templates like ItemTemplate, FooterTemplate, and HeaderTemplate to display the data. As an example, it demonstrates using a DataList control to display data through templates.
Here i am sharing the details of collections classes in C# for learining similar kind of c# interview question you can refer this link http://skillgun.com/csharp/interview-questions-and-answers
This document provides an overview of data binding in WPF, including:
1) Simple data binding allows binding one control's property to one object's data property either one-way or two-way.
2) Complex data binding allows binding to lists of objects using data templates to display each object.
3) Validation, filtering, sorting and grouping of data is supported through collection views.
4) Data can be bound to XML, LINQ, ADO.NET, datasets or loaded directly from code behind.
Wildcards with extends allow flexibility when getting values out of a container by accepting subtypes, while wildcards with super allow flexibility when putting values into a container by accepting supertypes. The Get and Put Principle recommends using extends when only getting values, super when only putting values, and no wildcard when both getting and putting. Key limitations are that extends only allows null to be added and super only allows the Object type to be retrieved.
This document discusses creating custom usage reports in EPiServer. It describes setting up a basic report interface using an ASPX page and assigning an EPiServer master page. It also covers populating the report by overriding the OnLoad method, retrieving content type and usage data from repositories, and generating statistics on total, deleted, and published content for each type. The next steps mentioned are to create additional reports, extract them into a separate project, and package the reports as a Nuget package for sharing.
Disconnected Architecture and Crystal report in VB.NETEverywhere
This document discusses disconnected architecture in ADO.NET. It explains that ADO.NET uses a dataset object to enable disconnected data access through filling the dataset using a data adapter. The dataset acts as an in-memory cache of data and does not interact directly with the data source. Data tables within the dataset contain rows and columns of data. The data adapter acts as a bridge between the dataset and data source, using commands to fill the dataset from a query and update changes back to the source. Stored procedures can also be used to encapsulate database operations when working with a dataset in a disconnected manner.
ASP.NET 08 - Data Binding And RepresentationRandy Connolly
This document discusses different ways to represent and bind data in ASP.NET applications. It covers data binding controls to data sources, using .NET collections like ArrayList and Dictionary to store data, using generic collections, populating and using DataTable and DataSet objects to store and manipulate tabular data, and integrating data with XML.
1 MVC – Ajax and Modal Views AJAX stands for Asynch.docxhoney725342
1
MVC – Ajax and Modal Views
AJAX stands for Asynchronous JavaScript and XML. It is a client-side capability that allows
silent updates of parts of a web page. Every browser provides a component called
XmlHttpRequest that is invoked via Javascript and has the capability to make asynchronous calls
back to the web server from where the page was obtained. One can set up Javascript timers to
automate the periodic retrieval of data using the XmlHttpRequest object.
Even though we can program the XmlHttpRequest object directly using Javascript, JQuery
makes it a lot easier to set it up and issue an asynchronous request to the web server. ASP.Net
MVC also provides a server-side solution to AJAX via the Ajax.BeginForm extension method.
We will demonstrate the two approaches to AJAX i.e., via JQuery and serializable partial views,
and via the Ajax.BeginForm.
Using SQL Server Management Studo, create a database called ProductsDB. Add a table called
Categories with the folling data.
The CategoryId column is of type int, and the CategoryName column is of type carchar(50).
Add another table called Products with the following design.
Then put the following data in the Products table.
2
Using Visual Studio, create a new project. Choose the web type of project, and select the MVC
template as shown below.
Add the following connection string information to the web.config file. Replace ALPHA with
the name of your database server.
<configuration>
<connectionStrings>
<add name="PRODUCTSDB" connectionString="server=ALPHA;integrated
security=true;database=ProductsDB" />
</connectionStrings>
<appSettings>
Add a class to the Models folder called Category with the following code in it.
public class Category
{
public int CategoryId { get; set; }
public string CategoryName { get; set; }
}
3
Add a folder called DataLayer to the project. Then add an interface called IEntity to it with the
following code in it.
public interface IEntity
{ // any class that needs conversion to a List from a DataTable will implement this
void PopulateFields(DataRow dr);
}
Add a class called MyEntityBase to the Models folder with the following code in it. This class
uses reflection to populate the fields of a class from a given DataRow of a DataTable. All
repository methods that need to convert a DataTable to a list will indirectly use this method via
the generic DBList class..
public class MyEntityBase : IEntity
{
public void PopulateFields(DataRow dr)
{
// use reflection to populate the fields of this class from DataRow
Type tp = this.GetType();
foreach (PropertyInfo pi in tp.GetProperties())
pi.SetValue(this, dr[pi.Name]);
}
}
Add a class called DBList to the DataLayer folder with the following code in it.
class DBList
{
...
How to become an Android dev starting from iOS (and vice versa)Giuseppe Filograno
This document provides an overview of how to transition between iOS and Android development by comparing key concepts and technologies. It discusses native programming languages and data types, classes and structs/data classes, enums, extensions, optionals, lazy properties, frameworks like UIKit/Activity and their lifecycles, assets, intents/segues, tables/recyclers, dependency managers like CocoaPods/Gradle, and encourages staying curious across mobile platforms.
This document provides an overview of ADO.NET objects for accessing and manipulating data in a database. It describes the DataSet class which represents a subset of database data without a live connection. It contains DataTable objects which represent tables and DataRelation objects which define relationships between tables. The document also summarizes the DataTable class which represents database tables, the DataAdapter which acts as a mediator between the DataSet and database, the DataReader for read-only record access, and the DbCommand and DbConnection objects used to execute commands and represent connections.
This document provides steps for binding a RadGridView filter to a report viewer data source in Visual Studio 2012. It describes catching the grid view's filtering descriptor as a variable, running a binding search with the filter data variable, and binding the report viewer's data set to contain that binding filter. It includes code examples of getting the filter expression from the grid, creating a function to return a filtered data table, and connecting that to the report viewer's data source.
Procedures functions structures in VB.Nettjunicornfx
This document discusses procedures, functions, and structures in Visual Basic .NET. It defines procedures as blocks of code that can be invoked from other parts of a program and optionally accept arguments. Functions are similar but return a value. Structures allow user-defined data types. The document provides examples and explains how to declare, define parameters for, and call procedures and functions. It also covers argument passing mechanisms, built-in math and string functions, and variable scope.
Talk on how to think when building Android apps using a reactive Clean Architecture. This talk was held at the Stockholm Android Meetup group April 17 2018 at Developers bay.
The document provides instructions for creating a basic ToDo list Android application. It describes creating an Android project called ToDoList, modifying the main layout to include a list view, edit text, and button within a linear layout. It also covers getting references to these elements, creating an array list to store todo items and array adapter to populate the list view. Finally, it discusses adding an on click listener to the add button to add new items from the edit text to the array list and refresh the list view.
Custom UI Components at Android Only 2011Johan Nilsson
This document discusses creating custom UI components in Android. It begins by explaining that widgets and layouts are used to construct user interfaces. It then discusses reasons for building custom components, such as having more control over the UI. It provides examples of creating simple custom components by extending existing widgets and layouts. It also covers creating more complex "compound" custom components using layout inflation. The document discusses techniques for debugging and optimizing custom components. Finally, it discusses how to package custom components in a library project so they can be shared across applications.
The document discusses various aspects of using the GridView control in ASP.NET such as binding data to the GridView, handling paging, sorting and editing. It describes properties like AllowPaging and events like PageIndexChanging. It provides code examples for binding data, handling sorting and paging. The document also discusses different field types that can be used in a GridView like BoundField, TemplateField and HyperLinkField.
This document provides an overview of ADO.NET and how to access relational data using it in Microsoft Visual Studio .NET. It covers key ADO.NET concepts like the object model, DataSets, and DataAdapters. It also demonstrates how to connect to a database, generate and populate a DataSet, and display dataset data in list-bound controls like a DataGrid. The document includes lessons, demonstrations, and a practice activity on these topics.
Part 3 of the SQL Tuning workshop examines the different aspects of an execution plan, from cardinality estimates to parallel execution and explains what information you should be gleaming from the plan and how it affects the execution. It offers insight into what caused the Optimizer to make the decision it did as well as a set of corrective measures that can be used to improve each aspect of the plan.
This document discusses the Open Data Protocol (OData) which aims to break down "data silos" by providing standard web APIs and allowing data from different sources to be accessed in a uniform way. OData defines a set of best practices for building and consuming RESTful APIs and provides conventions for querying and managing data over HTTP. The document outlines the basics of OData including URIs, query options, data types, expressions and service operations. It also discusses how OData can be implemented using various technologies and consumed by both web and native applications.
This document provides steps to create a custom ListView in Android. It involves creating a layout file for list item rows, a DataModel class to store list item data, a CustomAdapter class to populate the ListView, and adding code to the activity's onCreate method to initialize the ListView. The CustomAdapter inflates the custom row layout, sets data from the DataModel, and adds an on click listener to each item. This allows clicking list items to display additional details in a Snackbar popup.
This document provides a cheat sheet for frequently used commands in Stata for data processing, exploration, transformation, and management. It highlights commands for viewing and summarizing data, importing and exporting data, string manipulation, merging datasets, and more. Keyboard shortcuts for navigating Stata are also included.
Redis is an in-memory data structure store that can be used as a database, cache, or message broker. It supports basic data structures like strings, hashes, lists, sets, sorted sets with ranges, and bitmaps. The Spring Data Redis library makes it easy to use Redis from Spring applications to store and retrieve objects and leverage features like pub/sub and caching.
The document discusses different data binding options in ADO.NET including the DataReader, DataSet, and DataAdapter. The DataReader retrieves data from a database in a forward-only manner. The DataSet stores a copy of database table data but cannot directly access the database, requiring a DataAdapter. The DataAdapter provides communication between the DataSet and data source. A DataView enables creating different views of data in a DataTable and can filter or sort the data.
Similar to Android App Development - 11 Lists, grids, adapters, dialogs and toasts (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 - 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 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.
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. ListViews, GridViews, Adapters, Dialogs and Toasts
A ListView or a GridView shows data in an array, a Collection or a
Cursor resulting from a DB query.
Contrary to what happens with the other View, the data entry is
done at runtime using an Adapter that tells the system how to
insert the data specifying the graphical interface of each element.
To simplify this management it provides lists of specialized
classes like ListActivity and ListFragment that add methods to
handle the ListView without recovering its reference from the
layout.
ListViews and GridViews
3. The main class that manages the View that make a list or a grid is
BaseAdapter.
The platform provides specializations of this class to simplify the
creation of the view that compose a list or grid, but restrict them
customization.
● ArrayAdapter<T>
● SimpleAdapter
● CursorAdapter
● SimpleCursorAdapter
Adapters
ListViews, GridViews, Adapters, Dialogs and Toasts
4. public class ExampleAdapter extends BaseAdapter {
@Override
public int getCount() {
return 0;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return null;
}
}
BaseAdapter
ListViews, GridViews, Adapters, Dialogs and Toasts
5. public class ExampleAdapter extends BaseAdapter {
private List<String> titles;
@Override
public int getCount() {
if (titles != null)
return titles.size();
return 0;
}
@Override
public String getItem(int position) {
return titles.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return convertView;
}
}
BaseAdapter
ListViews, GridViews, Adapters, Dialogs and Toasts
6. public class ExampleAdapter extends BaseAdapter {
private List<String> titles;
private LayoutInflater inflater;
public ExampleAdapter(Context context) {
inflater = LayoutInflater.from(context);
}
...
@Override
public View getView(int position, View convertView, ViewGroup parent) {
String title = getItem(position);
convertView = inflater.inflate(R.layout.example_item, null);
TextView titleView = (TextView) convertView
.findViewById(R.id.example_title);
titleView.setText(title);
return convertView;
}
}
BaseAdapter
ListViews, GridViews, Adapters, Dialogs and Toasts
7. All the times that you have to make a visible element of the list, a
call is made to Adapter.getView () on the Main Thread because
only this can change the graphical interface.
Whether to complex View or simple View, this may affect the
fluidity of the ListView and in the worst cases the entire
application. The cause of this is the call to View.findViewById ()
that search for reference of the instance of a View.
In most cases the View loaded for each element of the list is the
same, then all subsequent calls to the first to retrieve the View
can be eliminated by maintaining a reference to all of the Layout
View.
To do this you must use the View Holder Pattern.
BaseAdapter - Limits
ListViews, GridViews, Adapters, Dialogs and Toasts
8. A ViewHolder object stores a reference of each of the Layout
View in order to reuse it for all elements.
public class ExampleAdapter extends BaseAdapter {
private List<String> titles;
private LayoutInflater inflater;
...
@Override
public View getView(int position, View convertView, ViewGroup parent) {
String title = getItem(position);
ViewHolder holder;
if (convertView == null) {
convertView = inflater.inflate(R.layout.example_item, null);
holder = new ViewHolder();
holder.titleView = (TextView) convertView
.findViewById(R.id.example_title);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.titleView.setText(title);
return convertView;
}
static class ViewHolder {
TextView titleView;
}
}
View Holder Pattern
ListViews, GridViews, Adapters, Dialogs and Toasts
9. ArrayAdapter is a concrete class that allows the insertion of a
simple list in a ListView.
ArrayAdapter<String> itemsAdapter =
new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items);
By default, the text entered in the one TextView in the list is the
string returned by toString().
ArrayAdapter<T>
ListViews, GridViews, Adapters, Dialogs and Toasts
10. SimpleAdapter (as the ArrayAdapter) is a concrete class that
allows the insertion of a simple list in a ListView, but allows a
greater level of customization.
List<Map<String, String>> data = new ArrayList<Map<String, String>>();
data.add(new HashMap<String, String>() {
{
put("description", "10100");
put("title", "Torino");
}
});
...
ListAdapter adapter = new SimpleAdapter(this, data,
android.R.layout.simple_list_item_2, new String[] { "title",
"description" }, new int[] { android.R.id.text1,
android.R.id.text2 });
SimpleAdapter
ListViews, GridViews, Adapters, Dialogs and Toasts
11. CursorAdapter is an abstract class that simplifies the
management of data from a DataBase to show them in a
ListView.
It is not necessary to implement the ViewHolderPattern, because
the class manages the reuse of View.
public class ExampleCursorAdapter extends CursorAdapter {
private LayoutInflater inflater;
public ExampleCursorAdapter(Context context, Cursor c, boolean autoRequery) {
super(context, c, autoRequery);
inflater = LayoutInflater.from(context);
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
TextView titleText = (TextView) view.findViewById(R.id.example_title);
String title = cursor.getString(cursor.getColumnIndex("title"));
titleText.setText(title);
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
return inflater.inflate(R.layout.example_item, null);
}
}
CursorAdapter
ListViews, GridViews, Adapters, Dialogs and Toasts
12. Once you have created the adapter, it should be assigned to the
ListView or GridView with the method:
listView.setAdapter(adapter);
After you've assigned all'AdapterView, you no longer need to
instantiate a new one: if and when the data passed to the adapter
undergo a change, it is necessary and sufficient to invoke the
method Adapter.notifyDataSetChanged () to apply your changes
and force the update of the list.
adapter.notifyDataSetChanged();
N.B.: If you change the data, but the method
Adapter.notifyDataSetChanged() is not called, the system will
throw an IllegalStateException.
Data management
ListViews, GridViews, Adapters, Dialogs and Toasts
13. A Dialog is a small window that asks the user to make a selection
or enter additional information.
Dialog
ListViews, GridViews, Adapters, Dialogs and Toasts
14. The Dialog class is the base for the management of this type of
objects, but the platform makes available to the specialization for
certain purposes:
● AlertDialog: Dialog that shows a title, a message and up to 3
Button
● DatePickerDialog: Dialog with default layout that allows the
user to select a date
● TimePickerDialog: Dialog with default layout that allows the
user to select a time
● ProgressDialog: Dialog with title, message and a
ProgressBar to notify the user waiting for an operation of long
duration. Use of this Dialog is not recommended because it
prevents the user from interacting with the application.
Dialog
ListViews, GridViews, Adapters, Dialogs and Toasts
15. To create a Dialog you can create an instance and define the
graphical interface:
Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.example_dialog);
TextView title = (TextView) dialog.findViewById(R.id.example_title);
Button close = dialog.findViewById(R.id.example_close);
close.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
dialog.cancel();
}
});
title.setText("Title");
dialog.show();
Dialog
ListViews, GridViews, Adapters, Dialogs and Toasts
16. With the introduction of the Fragment, it was added the possibility
of extending DialogFragment to create Dialog. This allows you to
add it to an Activity or show it like a Dialog.
The DialogFragment class has pne more method than the
Fragment: it's used to create the instance of Dialog in which to
display the Fragment to the invocation of the method
DialogFragment.show()
public class ExampleDialogFragment extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog dialog = new Dialog(getActivity());
dialog.setContentView(R.layout.example_dialog_fragment);
return dialog;
}
}
DialogFragment
ListViews, GridViews, Adapters, Dialogs and Toasts
17. An AlertDialog is composed by 3 main components:
● Title: optional
● Content: a message, a list or a custom layout
● Actions: up to 3 buttons
AlertDialog
ListViews, GridViews, Adapters, Dialogs and Toasts
18. In order to create an AlertDialog, use an AlertDialog.Builder:
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setMessage(R.string.dialog_message).setTitle(
R.string.dialog_title);
// Add the buttons
builder.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// User clicked OK button
}
});
builder.setNegativeButton(R.string.cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// User cancelled the dialog
}
});
AlertDialog dialog = builder.create();
AlertDialog - Button
ListViews, GridViews, Adapters, Dialogs and Toasts
19. In order to create an AlertDialog, use an AlertDialog.Builder:
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.pick_color);
builder.setItems(R.array.colors_array,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// The 'which' argument contains the index position
// of the selected item
}
});
AlertDialog dialog = builder.create();
AlertDialog - List
ListViews, GridViews, Adapters, Dialogs and Toasts
20. In order to create an AlertDialog, use an AlertDialog.Builder:
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
mSelectedItems = new ArrayList<Integer>();
builder.setTitle(R.string.pick_color).setMultiChoiceItems(
R.array.toppings, null,
new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
if (isChecked) {
// If the user checked the item, add it to the
// selected items
mSelectedItems.add(which);
} else if (mSelectedItems.contains(which)) {
// Else, if the item is already in the array,
// remove it
mSelectedItems.remove(Integer.valueOf(which));
}
}
});
AlertDialog dialog = builder.create();
AlertDialog - MultiChoiceList
ListViews, GridViews, Adapters, Dialogs and Toasts
21. In order to create an AlertDialog, use an AlertDialog.Builder:
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setView(inflater.inflate(R.layout.dialog_signin, null))
// Add action buttons
.setPositiveButton(R.string.signin,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,int id){
// sign in the user ...
}
})
.setNegativeButton(R.string.cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id){
LoginDialogFragment.this.getDialog().cancel();
}
});
AlertDialog dialog = builder.create();
AlertDialog – Custom Layout
ListViews, GridViews, Adapters, Dialogs and Toasts
22. If you do not want to use the Dialog API to show windows, you
can assign a Dialog style to the Activity declaring it in the Manifest
file:
<activity
android:name="com.example.test.MainActivity"
android:theme="@android:style/Theme.Holo.Dialog" >
</activity>
Activity as a Dialog
ListViews, GridViews, Adapters, Dialogs and Toasts
23. A Toast shows the user a message for a short period of time
without interaction.
Toast
Context context = getApplicationContext();
CharSequence text = "Hello toast!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
ListViews, GridViews, Adapters, Dialogs and Toasts