With Launchers and Choosers in Windows Phone, 3rd party apps integrate more closely into the underlying operating system while allowing end-users to perform common tasks. With Launchers and Choosers you will provide more functionality to your end-users while still maintaining that consistent user experience that will make your app feel like a native app. In this session we’ll cover how to use Windows Phone resources including camera, video and Bing maps. We’ll also cover accessing contacts and calendar as well as sensors (including accelerometer, compass, gyroscope and motion).
The document provides examples for various methods that can be used to interact with and retrieve information from objects in a testing framework. It includes methods to activate, capture screenshots, click, close, drag and drop, exist, get and set properties, retrieve text, type, wait for properties, and more. The examples demonstrate how to use these methods to interact with dialog boxes, windows, and other objects.
This program displays, inserts, and updates staff information in a database table. It contains Java code to create a user interface with text fields to view, enter, and edit an employee's ID, name, address, city, state, and phone number. The program connects to a MySQL database, executes SQL statements to retrieve, add, and modify staff records, and includes validation of the user input fields.
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBtdc-globalcode
The document discusses implementing CQRS and event sourcing patterns using RavenDB for persistence. It begins with a simple employee management prototype and evolves it to use domain-driven design principles like separating commands from queries and modeling entities to emit domain events in response to state changes. The events are stored as documents in RavenDB and are used to update entity state and project read models. It also covers loading entities from their event streams and saving event streams back to documents in the database.
This document contains code for an inventory management system. It includes modules for connecting to a database, handling user login and permissions, and inputting/managing product data. The login module verifies user credentials and sets permission levels. The product input module provides functions for inserting, updating, deleting and searching for product records in the database. It establishes the database connection and uses SQL commands to manage the data.
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...tdc-globalcode
The document discusses concepts of functional programming in C# and .NET, including:
- Using functions as first-class citizens and higher-order functions like Map and Where
- Directing code towards immutability using concepts like Option and Either to represent failure
- Handling concurrency issues through immutable and referentially transparent functions
- Combining functions through combinators like Print and Time to add logging and profiling
This document contains code for a sales system application in Visual Basic. It includes code for forms to manage clients, products, invoices and users. It allows adding, editing, deleting and searching records in databases. It also includes code to launch other applications like Word, Excel and Calculator from the main form.
From java to kotlin beyond alt+shift+cmd+k - Droidcon italyFabio Collini
Kotlin is a first-class language for Android development since Google I/O 2017. And it’s here to stay!
Thanks to Android Studio it’s really easy to introduce Kotlin in an existing project, the configuration is trivial and then we can convert Java classes to Kotlin using a Alt+Shift+Cmd+K. But the new syntax is the just beginning, using Kotlin we can improve our code making it more readable and simpler to write.
In this talk we’ll see how to use some Kotlin features (for example data classes, collections, coroutines and delegates) to simplify Android development comparing the code with the equivalent “modern” Java code. It’s not fair to compare Kotlin code with plain Java 6 code so the Java examples will use lambdas and some external libraries like RxJava and AutoValue.
The document discusses three different ways to perform CRUD (create, read, update, delete) operations on a database using ADO.NET in Visual Basic.NET. It includes code examples showing how to connect to a SQL Server database, retrieve data from a table into a DataSet, display the data in a DataGridView, and search or filter the data. The examples demonstrate using DataAdapters, DataSets, DataViews and SqlDataReaders to connect to the database and perform queries to retrieve and manipulate the data.
The document provides examples for various methods that can be used to interact with and retrieve information from objects in a testing framework. It includes methods to activate, capture screenshots, click, close, drag and drop, exist, get and set properties, retrieve text, type, wait for properties, and more. The examples demonstrate how to use these methods to interact with dialog boxes, windows, and other objects.
This program displays, inserts, and updates staff information in a database table. It contains Java code to create a user interface with text fields to view, enter, and edit an employee's ID, name, address, city, state, and phone number. The program connects to a MySQL database, executes SQL statements to retrieve, add, and modify staff records, and includes validation of the user input fields.
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBtdc-globalcode
The document discusses implementing CQRS and event sourcing patterns using RavenDB for persistence. It begins with a simple employee management prototype and evolves it to use domain-driven design principles like separating commands from queries and modeling entities to emit domain events in response to state changes. The events are stored as documents in RavenDB and are used to update entity state and project read models. It also covers loading entities from their event streams and saving event streams back to documents in the database.
This document contains code for an inventory management system. It includes modules for connecting to a database, handling user login and permissions, and inputting/managing product data. The login module verifies user credentials and sets permission levels. The product input module provides functions for inserting, updating, deleting and searching for product records in the database. It establishes the database connection and uses SQL commands to manage the data.
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...tdc-globalcode
The document discusses concepts of functional programming in C# and .NET, including:
- Using functions as first-class citizens and higher-order functions like Map and Where
- Directing code towards immutability using concepts like Option and Either to represent failure
- Handling concurrency issues through immutable and referentially transparent functions
- Combining functions through combinators like Print and Time to add logging and profiling
This document contains code for a sales system application in Visual Basic. It includes code for forms to manage clients, products, invoices and users. It allows adding, editing, deleting and searching records in databases. It also includes code to launch other applications like Word, Excel and Calculator from the main form.
From java to kotlin beyond alt+shift+cmd+k - Droidcon italyFabio Collini
Kotlin is a first-class language for Android development since Google I/O 2017. And it’s here to stay!
Thanks to Android Studio it’s really easy to introduce Kotlin in an existing project, the configuration is trivial and then we can convert Java classes to Kotlin using a Alt+Shift+Cmd+K. But the new syntax is the just beginning, using Kotlin we can improve our code making it more readable and simpler to write.
In this talk we’ll see how to use some Kotlin features (for example data classes, collections, coroutines and delegates) to simplify Android development comparing the code with the equivalent “modern” Java code. It’s not fair to compare Kotlin code with plain Java 6 code so the Java examples will use lambdas and some external libraries like RxJava and AutoValue.
The document discusses three different ways to perform CRUD (create, read, update, delete) operations on a database using ADO.NET in Visual Basic.NET. It includes code examples showing how to connect to a SQL Server database, retrieve data from a table into a DataSet, display the data in a DataGridView, and search or filter the data. The examples demonstrate using DataAdapters, DataSets, DataViews and SqlDataReaders to connect to the database and perform queries to retrieve and manipulate the data.
From Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf MilanFabio Collini
Kotlin is a first-class language for Android development since Google I/O 2017. And it’s here to stay!
Thanks to Android Studio it’s really easy to introduce Kotlin in an existing project, the configuration is trivial and then we can convert Java classes to Kotlin using a Alt+Shift+Cmd+K. But the new syntax is the just beginning, using Kotlin we can improve our code making it more readable and simpler to write.
In this talk we’ll see how to use some Kotlin features (for example data classes, collections, coroutines and delegates) to simplify Android development comparing the code with the equivalent “modern” Java code. It’s not fair to compare Kotlin code with plain Java 6 code so the Java examples will use lambdas and some external libraries like RxJava and AutoValue.
The document describes MOBL, a programming language for building mobile web applications. MOBL aims to provide a small core language with large and extensible libraries. It includes built-in types, controls, and abstraction mechanisms like screens and functions. The language exposes low-level primitives while providing a native interface to external APIs. MOBL code can be deployed by concatenating, eliminating dead code, and minifying for client-side execution on mobile browsers. The language has been publicly released since January 2011 and sees over 1,000 visitors per day, with ongoing development focused on error handling, data evolution, documentation and libraries.
SISTEMA DE FACTURACION (Ejemplo desarrollado)Darwin Durand
The document describes the creation of a database in SQL Server to manage invoices and receipts. It includes tables for clients, employees, document headers, and document details. Stored procedures are created to insert data and a form is developed in Visual Studio .NET to manage documents. The form allows searching for clients and employees, adding product details, and printing reports using Crystal Reports.
Engaging users with live tiles and notificationsAlex Golesh
The document provides instructions for sending push notifications from a UWP application to Windows 10 devices using the Windows Notification Service (WNS). It includes steps to request the channel URI, register with a cloud service, authenticate with the service, and send badge, toast, tile, and secondary tile notifications. Code samples are provided to get an access token, create notification payloads, and send notifications to WNS.
The document contains code examples demonstrating various Scala programming concepts such as functions, pattern matching, traits, actors and more. It also includes links to online resources for learning Scala.
The document describes a new tool called Sifu that aims to simplify programming by allowing developers to write specifications for applications in a domain-specific language (DSL) called SifuDSL. The SifuCompiler checks these specifications for errors and applies best practices, and the SifuLinker transforms the specifications into maintainable code in the developer's choice of technology stack. The generated code can be freely changed and extended by developers and looks like code written by an experienced developer. Sifu specifications also serve as documentation that is always up to date. The tool claims developers can generate up to 90% of an application's codebase using Sifu alone.
Async code on kotlin: rx java or/and coroutines - Kotlin Night TurinFabio Collini
It’s never easy to write async code but luckily there are many libraries to manage asynchronicity without adding too much complexity. In the last years RxJava and the other ReactiveX libraries have been very popular but lately there is a new way to manage async code in Kotlin: the coroutines. In this talk we’ll pros and cons of there two approaches and how to leverage them to simplify asynchronous code on Android.
Do they solve the same problem? Can we use them together? Which one can be used to write functional code? How can we use them effectively in Android development?
Spoiler alert: They are both great!
In this talk we’ll see how to solve common problems using RxJava or Coroutines, starting from basic concepts (for example the Retrofit support and how to cancel a task) to some more advanced (like threading, error management and how to combine multiple tasks).
All example of the talk are available on this repository:
https://github.com/fabioCollini/RxJavaVsCoroutines
EclipseCon2011 Cross-Platform Mobile Development with EclipseHeiko Behrens
This document discusses cross-platform mobile development using Eclipse. It highlights that mobile devices now have more computing power than NASA did in 1969. It also covers developing for the diversity of mobile platforms like Java, C#, and Objective-C. The document discusses object-oriented principles like statelessness and the app anatomy of views, cells, navigation, and entities/content providers. It also introduces a DSL for defining mobile apps and demos cross-platform mobile development.
This document contains code for a VB.Net application for a hospital patient admission system. It includes code for login authentication, user management, registration, payment, and treatment functions. The code handles tasks like connecting to a database, generating unique identifiers, performing queries, and updating/inserting records.
303 TANSTAAFL: Using Open Source iPhone UI Codejonmarimba
This document discusses modifications made to improve the animation and behavior of an open source cover flow library called OpenFlow. The author hacked the code to have a scroll view handle animation instead of core animation for better control. Touch handling was also hijacked to directly control selection instead of relying on scroll view callbacks. Friction was reduced and reflection rendering was adjusted to better match Apple's implementation.
beyond tellerrand: Mobile Apps with JavaScript – There's More Than WebHeiko Behrens
abstract from http://2011.beyondtellerrand.com
Modern web technologies and responsive design aim at a platform independent code base while promising first-class experience on any mobile device. Even though purely web-based approaches can achieve stunning results, they (still) cannot compete with their native counterpart regarding platform features and integration.
In this talk, I will show you how we can use JavaScript to produce mobile apps that include features such as native UI, push notifications, sensors, and paid distribution. You can expect lots of live demos when I will compare the strengths and weaknesses of various frameworks.
This document summarizes Spring features for building loosely coupled, maintainable applications. It discusses how Spring promotes loose coupling through dependency injection and application events. It also describes how to implement workflows with jBPM and manage transactions declaratively in Spring.
The document discusses implementing CQRS and event sourcing patterns using RavenDB for persistence. It begins with an example employee management prototype and identifies issues with the initial approach. It then explores improving the model by defining commands, events, and having entities generate events in response to commands. Events are stored in RavenDB to rebuild entity state and allow queries to be answered from the event stream. The document provides examples of handling commands, generating and applying events, and saving events to documents in RavenDB.
The document discusses model-driven app development for iPhone and Android. It introduces some common issues in traditional software development like boring code, accidental complexity, and wrong levels of abstraction. It then presents model-driven development as an approach to address these issues by raising the level of abstraction and generating code from models. Domain-specific languages (DSLs) are presented as a tool for describing domains at a higher level of abstraction. The document demonstrates an example DSL for developing mobile apps and how concepts in the DSL like entities, data providers, views and actions can be mapped to generated code.
Laporan multiclient chatting berbasis grafis (gambar)Rara Ariesta
The document describes a program for a multi-client chatting application using Java as the programming language. It involves creating a client-server model with one server and multiple clients that can communicate in real-time. The listing includes the code for the ChatServer class which handles connections from multiple ClientThread objects and broadcasts messages. It also includes the code for the ChatClient class which allows a client to connect to the server, send and receive messages.
4Developers: Michał Szczepanik- Kotlin - Let’s ketchup itPROIDEA
Niektóre rzeczy trzeba dobrze przyprawić żeby były lepsze ... tak samo jest z pisaniem aplikacji na Androida. Jako programiści zaczynamy mieć czasami dość Javy i chcielibyśmy się przerzucić na coś lepszego i czytelniejszego. Takim rozwiązaniem może okazać się Kotlin. O zaletach języka i o tym jak może ułatwić pracę z Androidem dowiecie się podczas tego wykładu.
The document discusses various topics related to classes and objects in C++ including defining a class, accessing class members, defining member functions, static data members and functions, arrays of objects, passing objects as function arguments, returning objects from functions, friend functions, and more. It provides code examples for many of these concepts. The document is a chapter from a book or set of lecture notes on C++ classes and objects.
bbyopen/App_Code/.DS_Store
bbyopen/App_Code/VBCode/GoogleMapsAPIHelpers.vb
Imports Microsoft.VisualBasic
Imports System.Xml.Linq
Public Class GoogleMapsAPIHelpers
Public Shared Function GetGeocodingSearchResults(ByVal address As String) As XElement
'Use the Google Geocoding service to get information about the user-entered address
'See http://code.google.com/apis/maps/documentation/geocoding/index.html for more info...
Dim url = String.Format("http://maps.google.com/maps/api/geocode/xml?address={0}&sensor=false", HttpContext.Current.Server.UrlEncode(address))
'Load the XML into an XElement object (whee, LINQ to XML!)
Dim results = XElement.Load(url)
'Check the status
Dim status = results.Element("status").Value
If status <> "OK" AndAlso status <> "ZERO_RESULTS" Then
'Whoops, something else was wrong with the request...
Throw New ApplicationException("There was an error with Google's Geocoding Service: " & status)
End If
Return results
End Function
End Class
bbyopen/App_Data/StoreLocations.mdf
bbyopen/App_Data/StoreLocations_log.LDF
bbyopen/Bin/Microsoft.Web.GeneratedImage.dll
bbyopen/Default.aspx
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<asp:Content runat="server" ID="myHeadContent" ContentPlaceHolderID="head">
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
</script>
<script type="text/javascript">
function init_map(map_canvas_id, lat, lng, zoomLevel) {
var myLatLng = new google.maps.LatLng(lat, lng);
var options = {
zoom: zoomLevel,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.HYBRID
};
var map_canvas = document.getElementById(map_canvas_id);
var map = new google.maps.Map(map_canvas, options);
var marker=new google.maps.Marker({
position:myLatLng,
});
marker.setMap(map);
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h2>Welcome!</h2>
<p>
This demo shows how to use the <a href="http://code.google.com/apis/maps/">Google Maps API</a> to build a simple store locator
web application.
</p>
<p>
This demo site is powered by the <code>StoreLocations.mdf</code> database in the <code>App_Data</code> folder, which contains a single
table, <code>Stores</code>. This table has one record for each store, specifying the StoreId, address, city, , zip code, phone, hours,
and latitude and longitude coordinates. From the <a href="FindAStore.aspx">Find a Store ...
This document discusses various techniques for working with multimedia in Android applications, including detecting device capabilities, loading images from local storage and remote URLs, playing audio files from assets and raw resources, and improving performance through caching and asynchronous loading. It provides code examples for checking if a device has a front-facing camera, loading images while avoiding out of memory errors, playing audio files from assets, and using an AsyncTask to load images asynchronously to avoid blocking the UI. It also discusses potential memory leak issues and strategies for building an image cache.
1. The document discusses the evolution of the C# programming language from versions 1.0 through 4.0, highlighting new features introduced in each version such as generics, LINQ, dynamic programming, and covariance/contravariance.
2. It provides code examples to illustrate key concepts like generics, LINQ queries, dynamic binding, and how covariance/contravariance enables safer usage of generics.
3. The last section summarizes some of the main features introduced in each C# version from managed code to generics to dynamic programming.
From Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf MilanFabio Collini
Kotlin is a first-class language for Android development since Google I/O 2017. And it’s here to stay!
Thanks to Android Studio it’s really easy to introduce Kotlin in an existing project, the configuration is trivial and then we can convert Java classes to Kotlin using a Alt+Shift+Cmd+K. But the new syntax is the just beginning, using Kotlin we can improve our code making it more readable and simpler to write.
In this talk we’ll see how to use some Kotlin features (for example data classes, collections, coroutines and delegates) to simplify Android development comparing the code with the equivalent “modern” Java code. It’s not fair to compare Kotlin code with plain Java 6 code so the Java examples will use lambdas and some external libraries like RxJava and AutoValue.
The document describes MOBL, a programming language for building mobile web applications. MOBL aims to provide a small core language with large and extensible libraries. It includes built-in types, controls, and abstraction mechanisms like screens and functions. The language exposes low-level primitives while providing a native interface to external APIs. MOBL code can be deployed by concatenating, eliminating dead code, and minifying for client-side execution on mobile browsers. The language has been publicly released since January 2011 and sees over 1,000 visitors per day, with ongoing development focused on error handling, data evolution, documentation and libraries.
SISTEMA DE FACTURACION (Ejemplo desarrollado)Darwin Durand
The document describes the creation of a database in SQL Server to manage invoices and receipts. It includes tables for clients, employees, document headers, and document details. Stored procedures are created to insert data and a form is developed in Visual Studio .NET to manage documents. The form allows searching for clients and employees, adding product details, and printing reports using Crystal Reports.
Engaging users with live tiles and notificationsAlex Golesh
The document provides instructions for sending push notifications from a UWP application to Windows 10 devices using the Windows Notification Service (WNS). It includes steps to request the channel URI, register with a cloud service, authenticate with the service, and send badge, toast, tile, and secondary tile notifications. Code samples are provided to get an access token, create notification payloads, and send notifications to WNS.
The document contains code examples demonstrating various Scala programming concepts such as functions, pattern matching, traits, actors and more. It also includes links to online resources for learning Scala.
The document describes a new tool called Sifu that aims to simplify programming by allowing developers to write specifications for applications in a domain-specific language (DSL) called SifuDSL. The SifuCompiler checks these specifications for errors and applies best practices, and the SifuLinker transforms the specifications into maintainable code in the developer's choice of technology stack. The generated code can be freely changed and extended by developers and looks like code written by an experienced developer. Sifu specifications also serve as documentation that is always up to date. The tool claims developers can generate up to 90% of an application's codebase using Sifu alone.
Async code on kotlin: rx java or/and coroutines - Kotlin Night TurinFabio Collini
It’s never easy to write async code but luckily there are many libraries to manage asynchronicity without adding too much complexity. In the last years RxJava and the other ReactiveX libraries have been very popular but lately there is a new way to manage async code in Kotlin: the coroutines. In this talk we’ll pros and cons of there two approaches and how to leverage them to simplify asynchronous code on Android.
Do they solve the same problem? Can we use them together? Which one can be used to write functional code? How can we use them effectively in Android development?
Spoiler alert: They are both great!
In this talk we’ll see how to solve common problems using RxJava or Coroutines, starting from basic concepts (for example the Retrofit support and how to cancel a task) to some more advanced (like threading, error management and how to combine multiple tasks).
All example of the talk are available on this repository:
https://github.com/fabioCollini/RxJavaVsCoroutines
EclipseCon2011 Cross-Platform Mobile Development with EclipseHeiko Behrens
This document discusses cross-platform mobile development using Eclipse. It highlights that mobile devices now have more computing power than NASA did in 1969. It also covers developing for the diversity of mobile platforms like Java, C#, and Objective-C. The document discusses object-oriented principles like statelessness and the app anatomy of views, cells, navigation, and entities/content providers. It also introduces a DSL for defining mobile apps and demos cross-platform mobile development.
This document contains code for a VB.Net application for a hospital patient admission system. It includes code for login authentication, user management, registration, payment, and treatment functions. The code handles tasks like connecting to a database, generating unique identifiers, performing queries, and updating/inserting records.
303 TANSTAAFL: Using Open Source iPhone UI Codejonmarimba
This document discusses modifications made to improve the animation and behavior of an open source cover flow library called OpenFlow. The author hacked the code to have a scroll view handle animation instead of core animation for better control. Touch handling was also hijacked to directly control selection instead of relying on scroll view callbacks. Friction was reduced and reflection rendering was adjusted to better match Apple's implementation.
beyond tellerrand: Mobile Apps with JavaScript – There's More Than WebHeiko Behrens
abstract from http://2011.beyondtellerrand.com
Modern web technologies and responsive design aim at a platform independent code base while promising first-class experience on any mobile device. Even though purely web-based approaches can achieve stunning results, they (still) cannot compete with their native counterpart regarding platform features and integration.
In this talk, I will show you how we can use JavaScript to produce mobile apps that include features such as native UI, push notifications, sensors, and paid distribution. You can expect lots of live demos when I will compare the strengths and weaknesses of various frameworks.
This document summarizes Spring features for building loosely coupled, maintainable applications. It discusses how Spring promotes loose coupling through dependency injection and application events. It also describes how to implement workflows with jBPM and manage transactions declaratively in Spring.
The document discusses implementing CQRS and event sourcing patterns using RavenDB for persistence. It begins with an example employee management prototype and identifies issues with the initial approach. It then explores improving the model by defining commands, events, and having entities generate events in response to commands. Events are stored in RavenDB to rebuild entity state and allow queries to be answered from the event stream. The document provides examples of handling commands, generating and applying events, and saving events to documents in RavenDB.
The document discusses model-driven app development for iPhone and Android. It introduces some common issues in traditional software development like boring code, accidental complexity, and wrong levels of abstraction. It then presents model-driven development as an approach to address these issues by raising the level of abstraction and generating code from models. Domain-specific languages (DSLs) are presented as a tool for describing domains at a higher level of abstraction. The document demonstrates an example DSL for developing mobile apps and how concepts in the DSL like entities, data providers, views and actions can be mapped to generated code.
Laporan multiclient chatting berbasis grafis (gambar)Rara Ariesta
The document describes a program for a multi-client chatting application using Java as the programming language. It involves creating a client-server model with one server and multiple clients that can communicate in real-time. The listing includes the code for the ChatServer class which handles connections from multiple ClientThread objects and broadcasts messages. It also includes the code for the ChatClient class which allows a client to connect to the server, send and receive messages.
4Developers: Michał Szczepanik- Kotlin - Let’s ketchup itPROIDEA
Niektóre rzeczy trzeba dobrze przyprawić żeby były lepsze ... tak samo jest z pisaniem aplikacji na Androida. Jako programiści zaczynamy mieć czasami dość Javy i chcielibyśmy się przerzucić na coś lepszego i czytelniejszego. Takim rozwiązaniem może okazać się Kotlin. O zaletach języka i o tym jak może ułatwić pracę z Androidem dowiecie się podczas tego wykładu.
The document discusses various topics related to classes and objects in C++ including defining a class, accessing class members, defining member functions, static data members and functions, arrays of objects, passing objects as function arguments, returning objects from functions, friend functions, and more. It provides code examples for many of these concepts. The document is a chapter from a book or set of lecture notes on C++ classes and objects.
bbyopen/App_Code/.DS_Store
bbyopen/App_Code/VBCode/GoogleMapsAPIHelpers.vb
Imports Microsoft.VisualBasic
Imports System.Xml.Linq
Public Class GoogleMapsAPIHelpers
Public Shared Function GetGeocodingSearchResults(ByVal address As String) As XElement
'Use the Google Geocoding service to get information about the user-entered address
'See http://code.google.com/apis/maps/documentation/geocoding/index.html for more info...
Dim url = String.Format("http://maps.google.com/maps/api/geocode/xml?address={0}&sensor=false", HttpContext.Current.Server.UrlEncode(address))
'Load the XML into an XElement object (whee, LINQ to XML!)
Dim results = XElement.Load(url)
'Check the status
Dim status = results.Element("status").Value
If status <> "OK" AndAlso status <> "ZERO_RESULTS" Then
'Whoops, something else was wrong with the request...
Throw New ApplicationException("There was an error with Google's Geocoding Service: " & status)
End If
Return results
End Function
End Class
bbyopen/App_Data/StoreLocations.mdf
bbyopen/App_Data/StoreLocations_log.LDF
bbyopen/Bin/Microsoft.Web.GeneratedImage.dll
bbyopen/Default.aspx
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<asp:Content runat="server" ID="myHeadContent" ContentPlaceHolderID="head">
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
</script>
<script type="text/javascript">
function init_map(map_canvas_id, lat, lng, zoomLevel) {
var myLatLng = new google.maps.LatLng(lat, lng);
var options = {
zoom: zoomLevel,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.HYBRID
};
var map_canvas = document.getElementById(map_canvas_id);
var map = new google.maps.Map(map_canvas, options);
var marker=new google.maps.Marker({
position:myLatLng,
});
marker.setMap(map);
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h2>Welcome!</h2>
<p>
This demo shows how to use the <a href="http://code.google.com/apis/maps/">Google Maps API</a> to build a simple store locator
web application.
</p>
<p>
This demo site is powered by the <code>StoreLocations.mdf</code> database in the <code>App_Data</code> folder, which contains a single
table, <code>Stores</code>. This table has one record for each store, specifying the StoreId, address, city, , zip code, phone, hours,
and latitude and longitude coordinates. From the <a href="FindAStore.aspx">Find a Store ...
This document discusses various techniques for working with multimedia in Android applications, including detecting device capabilities, loading images from local storage and remote URLs, playing audio files from assets and raw resources, and improving performance through caching and asynchronous loading. It provides code examples for checking if a device has a front-facing camera, loading images while avoiding out of memory errors, playing audio files from assets, and using an AsyncTask to load images asynchronously to avoid blocking the UI. It also discusses potential memory leak issues and strategies for building an image cache.
1. The document discusses the evolution of the C# programming language from versions 1.0 through 4.0, highlighting new features introduced in each version such as generics, LINQ, dynamic programming, and covariance/contravariance.
2. It provides code examples to illustrate key concepts like generics, LINQ queries, dynamic binding, and how covariance/contravariance enables safer usage of generics.
3. The last section summarizes some of the main features introduced in each C# version from managed code to generics to dynamic programming.
Rhino Mocks is a .NET mocking framework that allows developers to easily create and setup mock objects to test interactions using unit tests. It generates both mocks, which allow expectations to be set and verified, and stubs, which simply return preset values without verification. The document provides examples of using Rhino Mocks to generate mocks and stubs of interfaces, set expectations on mocks, and verify mock interactions using the AAA (Arrange, Act, Assert) syntax. It also distinguishes between mocks and stubs.
Ever since we broke apart the front and back-end of our systems, we’ve longed to partially reunite them with a shared language. The benefits of code reuse and shared tooling are compelling but is this nirvana possible? In this session we will explore building both the front (mobile and web) and back-end of an application with a shared Kotlin codebase. You will learn how to setup the build, share code, and deploy the back-end as a serverless app.
In depth overview of the Flex data binding code generation. Provides info on accomplish data binding through actionscript as well as limitations of the process.
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo Ali Parmaksiz
This document summarizes a presentation about developing a MVP application using GWT, Spring Roo, and deploying it to CloudFoundry. The presentation covers MVP pattern in GWT, using activities and places for navigation, using Spring Roo for rapid development, and deploying the application to CloudFoundry. It provides code examples for implementing MVP using views, presenters, activities and places. It also outlines the steps to deploy an application to CloudFoundry including installing the vmc CLI and pushing the application.
The document discusses the capabilities of HTML5 for building offline applications. It mentions several HTML5 features that enable offline functionality, including application cache, manifest files, and offline events. Application cache allows caching assets defined in a manifest file so the application can work offline. The offline event fires when the browser loses internet connectivity, informing the application it is now offline.
Is html5-ready-workshop-110727181512-phpapp02PL dream
The document discusses the capabilities of HTML5 for building offline applications. It mentions several HTML5 features that enable offline functionality, including application cache, manifest files, and offline events. Application cache allows caching assets defined in a manifest file so the application can work offline. The offline event fires when the browser loses internet connectivity, informing the application it is now offline.
This document discusses mobile app development using JavaScript and compares different approaches such as web apps, hybrid apps, interpreted apps, and cross-platform game engines. It provides examples of frameworks like PhoneGap, Titanium, and ImpactJS and compares them in terms of learning curve, tools, monetization options, supported platforms and scenarios.
This document discusses the different types of statements used in QuickTest Professional (QTP) test scripts, including declarations, comments, utility statements, object calls, flow control statements, function/action calls, checkpoints, output value statements, synchronization points, and VBScript statements. Declarations are used to define variables and constants. Comments explain parts of the test script. Utility statements launch applications and control program flow. Object calls interact with application objects. Flow control statements include if/else, select case, loops, and more. Functions and actions encapsulate reusable code. Checkpoints and output values verify test results. Synchronization waits ensure objects are ready. VBScript provides additional programming constructs.
This document provides an overview of Metro style apps and the C++ language features for building them. It compares the architecture and frameworks of Metro style apps to desktop apps. It then summarizes key C++ language features for Metro style development including reference types, memory management, pointers, events, generics and libraries. The document promotes C++ for building high performance Metro style apps and provides examples of key language concepts.
The document discusses upcoming web standards like HTML5 and WebSockets. It provides examples of using local storage, handling errors with window.onerror, and the Same Origin Policy. It also demonstrates how to access device sensors and use the webcam with getUserMedia. The document promotes Opera's developer tools like Dragonfly and extensions to aid web development.
The document discusses Comet and DWR (Direct Web Remoting). It provides an overview of Comet, which allows for long-lived HTTP connections to enable low-latency data delivery. It discusses various Comet techniques like forever frames, long polling, and HTMLFile. It also covers challenges of implementing Comet and how frameworks like DWR and protocols like Bayeux help address these. DWR allows for easily calling Java objects from JavaScript and updating pages in real-time.
This document provides instructions for setting up and running a bot project using the Bot Builder SDK v4. It discusses downloading necessary software, creating a project in Visual Studio, implementing a welcome message, and managing state using user profiles and state accessors. The document contains code samples for creating a SampleBot class that inherits from IBot and uses state accessors and user profiles to save and retrieve a user's handle name.
Writing videogames with titanium appceleratorAlessio Ricco
Creating a simple videogame is a fun way to start learning the titanium appcelerator APIs.
this talk by alessio ricco was presented at the Mobile Developer Conference WHYMCA in Milan May 20th 20011
The document discusses the mobl programming language for building mobile web applications. Mobl is a statically-typed language that compiles to HTML and JavaScript. It aims to provide features for building reactive user interfaces and uses techniques like continuation-passing style and observables to support asynchronous programming in a synchronous-looking way. The document provides examples of coding common mobile app patterns like data binding, network requests, and user input handling in mobl.
Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...Codemotion
As your mobile users get accustomed to advanced features that require Cloud support, it becomes increasingly hard to protect their privacy while staying up to date with data protection regulations such as the GDPR. We would like to show you how you can continue to use cloud-based SDKs and employ Firebase to create an experience that pleases both your users and your newly hired data stewardship team.
Cross Domain Web Mashups with JQuery and Google App EngineAndy McKay
This document discusses cross-domain mashups using jQuery and Google App Engine. It describes common techniques for dealing with the same-origin policy, including proxies, JSONP, and building sample applications that mashup Twitter data, geotagged tweets, and maps. Examples include parsing RSS feeds from Twitter into JSONP and displaying tweets on a map based on their geotagged locations. The document concludes by noting issues with trust, failures, and limitations for enterprise use.
Similar to Windows Phone Launchers and Choosers (20)
Visual Studio Online is the online home for your development projects. Visual Studio Online connects to Visual Studio, Eclipse, Xcode, and other Git clients to support development for a variety of platforms and languages.
Find out more about how you can use the power of Visual Studio Online to drive your development projects.
Look beyond the hype and create a strategy that will unlock the potential of the Internet of Your Things to realize real, transformative results in your organization.
The document discusses inspiration for Internet of Things (IoT) solutions. It provides 10 examples of IoT solutions, including a smart baby monitor, smart bike, smart garbage cans, smart tennis racket, smart home devices, smart transportation, smart agriculture, smart healthcare, smart industry, and smart cities. It emphasizes that successful IoT requires a combination of products, applications, and services within a business ecosystem and cannot be done by any single player alone. IoT adoption may be limited more by difficulties finding the right business models than by technology challenges.
The document outlines 4 common Microsoft Azure cloud scenarios - storing and backing up data, developing and testing applications, extending infrastructure, and global reach - and how Premier Support services can help customers maximize uptime, reduce costs, and accelerate cloud implementation through workshops, assessments, and operational improvements.
Code in the Cloud presentation as presented in Antwerp Lindner Hotel on 8th December 2014
#codeinthecloud
Agenda from the event:
In the AM (Introduction)
- Introduction to Application Lifecycle Management and Visual Studio Online
- Managing your project: what, who and when
- Working with code: keeping the source code safe and in-sync and be productive as a developer
- Tracking progress: how are we doing
- Improving quality: continuous build, deploy and testing
EAT
In the PM (Putting it all into practice)
- Exciting demonstrations and walkthroughs on how to run your project with Visual Studio Online.
This document discusses Microsoft Azure and its capabilities. It highlights that Azure has over 100 datacenters globally, with 19 regions currently online. It also notes that Azure has one of the top 3 networks in the world and offers larger VM sizes than AWS or Google Cloud. The document then summarizes some of Azure's core capabilities like compute, storage, databases, analytics and more. It provides examples of how customers can use Azure's tools and services.
This document discusses enabling continuous delivery through practices like continuous integration, continuous deployment, and integrating development and operations (DevOps). It summarizes techniques like release management and automation that can help increase delivery cadence, reduce deployment complexity, and establish a single source of truth for releasing software. Release management tools for Team Foundation Server are highlighted as providing capabilities for release planning, definition, environment management, deployment automation, visibility, approval workflows, and integration with other tools.
This document discusses how cloud computing can provide value for application development. It outlines common development infrastructure building blocks like team member desktops, collaboration environments, pre-production, and production environments. It then provides examples of how tools in Microsoft's Azure cloud platform can help improve agility, enable continuous delivery, and reduce costs through on-demand provisioning and pay-as-you-go models. Specific services highlighted include cloud-based load testing, automated builds/continuous integration, and application monitoring. Sample pricing models and a Telenor case study demonstrate how organizations have benefited from migrating development infrastructure to the cloud.
The document describes a conference agenda on application lifecycle management with Microsoft technologies. The first presentation from 9:45-10:30 is titled "Modern Lifecycle Management" and will include a live demo of new features in Visual Studio and TFS 2013. From 10:30-11:30 and 11:45-12:45, Michael Köster will present on extending development with Visual Studio Online and Visual Studio Release Management respectively, both with live demos. A break is scheduled from 11:30-11:45.
The document discusses the transformation of devices, services, and applications. It notes that established client-server patterns are giving way to emerging patterns where modern business applications are directly engaging consumers through edge-facing services. This allows for faster delivery of new features and capabilities through shortened development cycles. The modern application lifecycle aims to deliver better applications faster and cheaper by leveraging cloud-based services and data centers.
Unlimited resources at your fingertips, only bounded to the limitations of your imagination. Windows Azure allows you to be flexible at your own pace and with your own provisioning needs, whether you're a developer or IT professional. This talk will handle all things IaaS related to Windows Azure, going over the capabilities in usage and architecture.
Belgian app builders: discover your new home: http://msdn.be/apps AKA the Apps on Windows portal.
The document summarizes the challenge, approach, and results of designing apps for the Microsoft TechDays Belux 2013 event for Windows 8 and Windows Phone with limited time. The approach involved benchmarking other Techdays apps, breaking down essential functionalities, sketching structure, and user interviews. The Windows 8 app featured a fixed column for communication, background image for emotion, custom agendas, and multiple entry points. The Windows Phone app focused on consistency with Windows 8 design and bringing custom agendas to the front using Windows Phone patterns. Screenshots showed the Windows 8 hub, program section, and snap views as well as the Windows Phone app.
Platform for modern apps is a document about building apps and services that span devices and the cloud. It discusses how connected devices and consumer cloud services are becoming integrated. By the end of 2013, 90% of connected devices will have integrated consumer cloud services for accessing content. It also discusses developing apps for Windows 8 and Windows Phone 8 using common APIs and tools, and leveraging cloud services like Windows Azure for capabilities like data storage, push notifications and more.
Windows Phone 8 provides several security features to protect devices and data, including secure boot to prevent malware installation, device encryption, and application sandboxing. It also supports enterprise management of apps and policies through Exchange ActiveSync or System Center Mobile Device Management for features like remote wiping, password policies, and app distribution controls.
This document provides an overview and agenda for a deep dive into Entity Framework 6 (EF6). It discusses EF6 being released as open source, with a Git repository and nightly builds available. It outlines new EF6 runtime features like async query/save, code-based configuration, and performance improvements. The document also discusses EF6 tooling unification and releasing timeline, with alpha versions available now and a tools preview coming in a few months. It concludes by listing potential post-EF6 features for voting on and resources for learning more about EF6.
This document provides an introduction and agenda for a presentation on building Windows 8 applications using the Model-View-ViewModel (MVVM) pattern. It includes an overview of MVVM, the core building blocks of MVVM including commands, view model locators, and messaging. It also discusses application architecture topics like dependency injection, navigation, data access, and lifecycle management. The presentation aims to show how knowledge of MVVM from other technologies like WPF and Silverlight can be leveraged to build Windows 8 apps using the same pattern.
The document discusses trends in application development for mobile and cross-platform use. It notes the rise of consumerization of technology and the need to build apps that can be used on any device. This has led to changes like using HTML and JavaScript instead of platform-specific languages to allow cross-platform support. Frameworks like Backbone.js and libraries like Underscore.js can help manage the complexity of building such apps. The document also discusses considerations for responsive design, client-side architecture including MV* frameworks, and tools to support development.
The document provides an overview of the architecture of Windows Azure storage services. It discusses how the global namespace routes requests to partition servers, which use a dynamic scalable index to distribute data partitions across servers for high scalability and availability. Incoming reads are served from memory caches when possible, while writes are first persisted to append-only logs for replication before updating caches.
This document summarizes a presentation about Entity Framework 5 (EF5) and the future of EF6. It introduces EF as Microsoft's object-relational mapper for .NET applications, outlines major new features in EF5 like enum support and performance improvements, and demonstrates EF code and tools. It also briefly previews additional features planned for the open source EF6, including async queries and connection resiliency.
The document outlines topics that Bart J.F. De Smet, a Senior Software Development Engineer at Microsoft, is willing to present on. These include the evolution of C# and VB language features, internals of the Common Language Runtime including debugging techniques, Reactive Extensions and LINQ, with an open option for other topics.
More from Microsoft Developer Network (MSDN) - Belgium and Luxembourg (20)
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
6. <Capabilities>
<Capability Name="ID_CAP_LOCATION"/>
<Capability Name="ID_CAP_MEDIALIB"/>
... other capabilities here
<Capability Name="ID_CAP_CONTACTS"/>
<Capability Name="ID_CAP_APPOINTMENTS"/>
</Capabilities>
7.
8. Other contact Calendar
Data provider Contact name Contact picture
data appointments
Windows Phone Device Yes Yes Yes Yes
Windows Live Social Yes Yes Yes Yes
Windows Live Rolodex Yes Yes Yes Yes
Exchange Accounts
(Contacts from local address book only, not Yes Yes Yes Yes
Global Address List.)
Mobile Operator Address Book Yes Yes Yes No
Facebook Yes Yes No No
Windows Live Aggregated Networks
No No No No
(Twitter, LinkedIn, etc.)
9. using Microsoft.Phone.UserData;
...
Contacts cons;
private void loadButton_Click(object sender,
RoutedEventArgs e)
{
cons = new Contacts();
cons.SearchCompleted += new EventHandler
<ContactsSearchEventArgs>(cons_SearchCompleted);
cons.SearchAsync(String.Empty,FilterKind.None,
"Contacts Load");
}
12. // enumerate the results we got back and get the source
foreach (Contact contact in e.Results)
{
foreach (Account account in contact.Accounts)
{
Debug.WriteLine(contact.DisplayName + ": "
+ account.Name);
}
}
24. Action Chooser Task
Get addresses, phone numbers and email AddressChooserTask,
addresses PhoneNumberChooserTask,
EmailAddressChooserTask
Select a picture from the media store PhotoChooserTask
Capture a picture using the camera CameraCaptureTask
Invite players to a multi-game session GameInviteTask
(XBL only)
Save email addresses or phone numbers SaveEmailAddressTask,
SavePhoneNumberTask
Save ringtones SaveRingtoneTask
25. Action Task
Open a web page WebBrowserTask
Search the Marketplace and find applications MarketplaceSearchTask, MarketPlaceHubTask
Show Marketplace App Details and Review MarketplaceDetailTask,
Apps MarketplaceReviewTask
Place a phone call PhoneCallTask
Send an email EmailComposeTask
Send an SMS message SMSComposeTask
Play media MediaPlayerTask
Start a search using Bing SearchTask
Show maps and directions from Bing Maps BingMapsTask, BingMapsDirectionsTask
32. using Microsoft.Devices;
...
PhotoCamera camera;
...
camera = new PhotoCamera();
//Set the VideoBrush source to the camera
viewfinderBrush.SetSource(camera);
camera.CaptureImageAvailable +=
new EventHandler<ContentReadyEventArgs>
(camera_CaptureImageAvailable);
40. internal int FunkyColor(int color)
{
int a = color >> 24;
int r = (color & 0x00ff0000) >> 16;
int g = (color & 0x0000ff00) >> 8;
int b = (color & 0x000000ff);
r += redOffset;
g += greenOffset;
b += blueOffset;
return ((a & 0xFF) << 24) | ((r & 0xFF) << 16) |
((g & 0xFF) << 8) | (b & 0xFF);
}
41. camera = new Microsoft.Devices.PhotoCamera();
// Create the destination for the processed image
wb = new WriteableBitmap(640, 480);
this.ProcessedImage.Source = wb;
// Start the image pump when the camera is ready
camera.Initialized +=
new EventHandler<CameraOperationCompletedEventArgs>
(camera_Initialized);
43. int[] ARGBPx = new int[640 * 480];
...
captureEvent.WaitOne();
pauseFramesEvent.WaitOne(); //Thread sync with camera
//Copies the current viewfinder frame into a buffer
camera.GetPreviewBufferArgb32(ARGBPx);
//Conversion to funky colours
for (int i = 0; i < ARGBPx.Length; i++)
{
ARGBPx[i] = FunkyColor(ARGBPx[i]);
}
65. Follow me on Twitter
or the Puppy gets it
@benriga
Editor's Notes
TopicsAt the completion of this module, students will be able to:Program a search of the Contacts database on the phoneDescribe the difference between Launchers and ChoosersWrite code to start a Launcher taskWrite code to start a Chooser task and to get the response back from itCode an application that will process the video stream coming from the cameraDescribe the sensors and video support in Windows Phone OS 7.1
Reading Contacts and CalendarsThis section of this module shows how to select data from the phone Contacts and Calendar databases.
Your ObligationsThe Contacts data on a phone is a valuable data store that contains data that is private to the user of the phone. Your application must request permission from the user to access the phone’s contacts data store, and if you do not do this, your application will fail certification.Refer to the Application Certification Policies: http://msdn.microsoft.com/en-us/library/hh184841(v=VS.92).aspxThe documentation refers to policy 2.11, which is not yet in place.
Application CapabilitiesThere are two specific capabilities that your application must request in the WMAppManifest.xml file. It is important to request the correct capabilities for the features that your application uses, and this is particularly important for user data such as contacts and appointments.If a capability is not requested that is required, the application will fail when submitted.If a capability is requested that is not used the user may get asked to approve an access that is not required.
Contacts and Calendar ProvidersA Windows Phone user can link their phone to many different sources of contact data, such as from Exchange accounts, Facebook, Twitter etc. The Contacts list on the phone is an aggregated view of all the contacts from all the different data sources the user has configured. In addition, a user may choose to link together different Contacts list entries that all relate to the same physical person, and in that case the Contacts properties shown in the built in Contacts application is a combined view of the linked contact records.The exact Contact properties you can get when you do a search of the user data store is dependent on the original source of the contact data. The limitations are not technical, but to do with licensing and privacy issues.
Data SourcesWindows Phone provides an aggregated view of the user’s contact data across the user's different accounts. Information can come from sources such as data entered in the phone itself, social networking sites, and other data service providers. Not all data from all service providers is exposed publicly through the contacts and calendar API.The restrictions on data from certain sources is not technical, it’s down to licensing reasons and the desire of certain data providers to limit access to calls to their own APIs.
Reading ContactsThis is the code for a “Load Contacts” button click event. You can of course access contacts data anywhere in your applications. It is an abridged version of the code in the example to come.The process for accessing contact data is to get a reference to the Contacts object, perform an asynchronous search on it, and then capture the results as a collection of Contact objects. You can use the results in different ways.Using the code shown here, the operation is not filtered, and will return all the contacts. However, you can put filters on the search.Note: Contact data can vary widely in size. Be prepared for very large contact lists by providing a message to the user when you are loading data.
Displaying ContactsIn the demo we’re about to see, the collection of Contact objects we get back from the search is set to be the DataContext of a ListBox control. The data template for the ListBox uses data binding to show the DisplayName property of each Contact in the listbox.The collection of Contact objects you get back is an IEnumerable, so you can use a foreach construction to loop through the Results enumeration; that’s fine too.
Data BindingThis is the XAML that displays the list. Here you can see that the TextBlock in the DataTemplate uses data binding syntax to display the Displayname property of each Contact in the results.Notice too that this is OneWay data binding (as the Mode property on the Binding statement says). You could not use TwoWay data binding here and allow users of your app to update Contact records, since the Contact data you get back is READ ONLY.
For demonstration notes please look in the “Demonstration” folder and open the corresponding Word document.
Displaying AppointmentsThis works in exactly the same way as for contacts. There is an example application you can use if you wish, but there are no appointments on the emulator, so it doesn’t really show much.There are different overloads for SearchAsync that give slightly different filtering options for Appointments:You can select all appointments that occur between a specified start date and time and end date and time. You can additionally filter the search only to appointments from a specific data source.You can limit the number of results returned
Creating a ContactIn this section, we introduce the Launchers and Choosers, which allow apps to invoke some of the built-in experiences of the phone.
Creating a ContactYou cannot design a page in your application to allow users to input details for a Contact, and then programmatically create a Contact. You can however launch the SaveContactTask which shows the built-in ‘Edit Contact’ experience of the phone which can be prefilled with some data you supply in code. Ultimately, the user must tap the ‘Save’ button to save the contact, after which control passes back to your program. Windows Phone allows you to launch a number of similar built-in experiences using a set of APIs called the Launchers and Choosers. By restricting app developers to interaction with phone user data and experiences in this way, Windows Phone ensures consistency for the user – if an app allows the user to create a Contact, it will always be done in the same way, using the familiar ‘Edit Contact’ page used by the built-in Contacts app. This is another reinforcement of the “user is king” paradigm. The phone will not allow an application to do substantive things (like create a contact) without the user being involved.
Launchers and ChoosersImportant points about the application lifecycle:The application loses its foreground status when a Launcher or a Chooser is fired up, so is deactivated and becomes dormant.In the case of a Chooser, the application will be resumed automatically when the user has made their choice and exits or quits the chooser.In the case of a Launcher the application will be resumed if the user navigates back after they have used the launched item.In either case the application must be designed to handle dormant/tombstone issues if you are to use Launchers and Choosers.When your app shows a launcher or chooser, they are switching to one of the built-in applications. In the middle of that, they could decide to press the Windows button and go to run something else. Your app may never be resumed, so you must consider dormant/tombstoned issues when using launchers and choosers.
Creating a ChooserIn this sample, we have a first name and last name that are going to be used as the basis of our new contact.These will get populated into the chooser that displays.Make the point that we can fill in all the contact fields for the new contact, but the user can change these in the dialog if they wish.IMPORTANT: When using Choosers, you must declare the task object (SaveContactTask) with page scope as shown here. You must instantiate the object and assign the Completed event handler in the page constructor. Then call the Show() method when you are ready to launch the Chooser task.These steps are necessary to correctly handle Tombstoning of your app, should that occur because the user has gone off and run many other apps after the Chooser is launched.
Chooser CompletionMake the point that saving a contact is not really worthy of the name “chooser”, since the only choice the user makes is whether or not to save the contact; but they don’t really choose anything. Nonetheless, the SaveContactTask behaves in the same way as the other Chooser tasks and does return some data to the application.It is useful to know if the user has saved the contact or not, and that is what is returned.Note however that if the user changes the name of the contact (or any other details) and then saves the changed contact data, your application has no way of knowing this has been done. So it is not a guarantee that the item has been saved with exactly the properties that your application set before launching the task. The only way to be sure is to retrieve the contact details after it has been saved and check it against the information you provided.
Application SwitchingThis is a very important point. We already mentioned it once, but we are going to mention it again.Because it is a very important point.Calling a Launcher or a chooser represents a handoff of control, which you may never get back.When the chooser is called an application is made dormant, so the Deactivated methods will be called. When the chooser completes the application is activated and must restore any state information. Then, once the application has been restarted, only then will the chooser Completed event handler method be called in the application.This will mean you will have to be mindful of application state when using launchers and choosers.
For demonstration notes please look in the “Demonstration” folder and open the corresponding Word document.
Other Save TasksThe other ‘Save’ Choosers are the SaveEmailAddressTask, SavePhoneNumberTask and SaveRingtoneTask. They all work in a similar fashion to the SaveContacttask.There is no way to create an appointment at the moment.But an application can create an alarm for that application which will fire at a particular time (covered later in this module).
Chooser TasksThe slide shows a complete list of all the Choosers available in Windows Phone Mango.There are complete examples of how to program each of these tasks in the Windows Phone developer documentation on MSDN: http://msdn.microsoft.com/en-us/library/ff769556(v=VS.92).aspx
Launcher TasksThese are all the Launchers. Launchers are similar to Choosers in that you are invoking one of the phone built-in experiences from your application. However, Launchers differ from Choosers in that they do not have a Completed event and do not return any data to your application.As with Choosers, your app is deactivated and made dormant when the Launcher is atartedyou’re your app will be reactivated when – or if – the user backs out of the launched experience and navigates back to your app.There are complete examples of how to program each of these tasks on MSDN
For demonstration notes please look in the “Demonstration” folder and open the corresponding Word document.
Using the Camera
The Windows Phone CameraYour app can show the CameraCaptureTask Chooser to invoke the built-in Camera app. Whe the user takes the picture, the resulting image file is returned to your application through the arguments to the Completed event.Alternatively, you can write code to access the camera hardware directly and capture a video stream from the camera. The ability to capture a video stream is new to Mango.
Capturing a photoThe CameraCaptureTask is a Chooser so uses the standard Completed event behaviour that we have seen before.One gotcha that most developers will encounter when testing software that uses this: it will not work if the phone is connected to the Zune software. You have to close Zune and launch WPConnect instead (mentioned previously in session 1).
Capture completeNote that photos captured in this way are not added to the camera roll in the Media Library on the device, but you can write code to save it to the media Library of you wish, or just use it in your app, or store in your apps isolated storage for later use.
For demonstration notes please look in the “Demonstration” folder and open the corresponding Word document.
In application captureWindows Phone supports programmatic access to the camera on a device, offering a rich set of APIs for developers to create their applications. Some features include: Creating a camera application with a viewfinder and capturing still photosProviding real-time access to raw frames from the cameraAdjusting the resolution of the captured photoImplementing functionality such as focus and flashDetecting and querying the device camera capabilities such as flash Accessing the camera hardware shutter button for capturing photos and triggering auto-focusNote that a camera is not required hardware for all Windows Phone devices. It is important that you consider this when designing and implementing your application. Your application should always check to see whether a camera is available (use PhotoCamera.IsCameraTypeSupported)and fail gracefully if it is not.
The PhotoCamera classThe PhotoCamera is the class that abstracts the camera behaviours. It lives in the Microsoft.Devices namespace.The code shown here sets the source of a Silverlight VideoBrush element to be the camera. This is how you implement a viewfinder window for your app (shown in next slide). The code also hooks the CaptureImageAvailable event so you can execute code to process a captured image.
Displaying the ViewfinderThis XAML displays a viewfinder on the screen. The VideoBrush element in here is assigned to the camera by the call of SetSource as shown on the previous slide.
Initiating the CaptureIn this sample, we have a button on the screen that the user presses to take a picture. The code shown is the click event handler for the button, which causes an image to be captured from the camera.When the photograph has been taken the CaptureImageAvailable event will fire. You can also write your code to use the hardware camera button on the phone – needless to say that is the better approach. See MSDN documentation for details of how to do that.
Saving the imageThe code shows how to save the captured image to the camera roll in the phone’s media library. Note that the MediaLibrary class lives in the XNA framework, so you must add the XNA library references into your Silverlight app to use them. The filename is made of the number of ticks in the date plus the jpg extension.Make the point that this action must take place on the UI thread, which is what the Dispatcher.BeginInvoke is for. Note that a PhoneApplicationPage object exposes a Dispatcher property you can use to execute code on the UI thread. However, in class libraries, you can also get access to the Dispatcher using Deployment.Current.Dispatcher as shown here.
Displaying the imageYou can also display the image in an <Image> element on the screen.To do that, you must create a BitmapImage object from the captured image stream, and then set the Source property of the <Image> to the BitmapImage object, as shown here.
Saving to isolated StorageNote that this code carries on from the previous slide.The variable b is the BitmapImage object we created in the previous slide. The variable filename holds the name of the file being created in isolated storage. This code saves the image as a JPG file in isolated storage.
For demonstration notes please look in the “Demonstration” folder and open the corresponding Word document.
Working with Image DataIn addition to capturing pictures, you can use the device camera to capture video. You can perform real-time processing on the video stream, useful in applications that use Augmented Reality, or for things such as auto-scanning of barcodes.We are going to use this to build a funky camera, which will funkify the video stream.
Funky Image ProcessingThis is the ‘brains’ of the funky image processing. We can get the argb value as an int for every pixel in a captured frame of video and process it.This method is going to get called for each pixel in the screen. It simply extracts the alpha, red, blue and green values from the pixel color and adds an offset to each.
Starting the Camera (1 of 2)This is part of the setup.You instantiate a PhotoCamera object and assign an event handler for the Initialized event.You would call this code after the Silverlight page is loaded.
Starting the Camera (2 of 2)This bit starts the message pump running.In the handler for the PhotoCameraInitialized event, we create a new thread called ARGBFramesThread and start it running. The logic to execute on the thread is in the PumpARGBFrames method.Emphasise that the video frame processing is running on a new thread, alongside the application.
Getting the Image DataThis code is the body of the PumpARGBFrames method that is running on the background thread. It uses a couple of synchronization objects called captureEvent and pauseFramesEvent to do some thread synchronisation to make sure that the thread and the camera work smoothly together and don’t get stuck.When the camera has captured a frame, this code is freed to run. It calls the GetPreviewBufferArgb32 method of the PhotoCamera object to get the image as an array of ints, and then calls our FunkyColor method that you saw earlier to ‘funkify’ it.Make the point that this code is all in the sample that they can have in a minute
Drawing the Image DataAfter we have funkified the frame, the code draws it onto the screen. Note that because the WriteableBitmap object that the code writes to is used as the source of an <Image> element that is on the Silverlight page, and thus controlled by the UI thread, we have to use a Dispatcher to perform this copy. The Dispatcher executes the code you pass to the BeginInvoke method on the UI thread.
For demonstration notes please look in the “Demonstration” folder and open the corresponding Word document.
Using the Microphone
The Windows Phone MicrophoneYou can get audio input from the Windows Phone microphone in a Silverlight application by using the Microsoft.Xna.Framework.Audio.Microphone class.The Microphone sample walkthrough at the url shown is very good and takes you through everything you need to know.Unfortunately, we don’t have time on this course to cover it in detail here.
Using Sensors
Sensors AvailableWindows Phone supports multiple sensors that allow applications to determine the orientation and motion of the device. These sensors enable the development of applications where the physical device itself is a means of user input. Typical uses for this functionality include motion-controlled games and augmented reality applications. For many of these purposes, the combined motion API, which combines and processes input from all sensors, is the simplest way to obtain motion and orientation information. For applications that require it, Windows Phone also provides APIs to retrieve data from the individual sensors.
The Sensors LibraryYou will need to add a reference to the Microsoft.Devices.Sensors library to your project. The sensors library is not automatically included in a new project created from the project templates in Visual Studio.
Determining Sensor AvailabilityYou must always check to see if the sensor is there before you use it. Pre mango phones all had a compass but there was no developer API that allowed apps to use it. In Mango, this data is now available to apps. Newer phones may also have a gyroscope, but this is optional for the OEM whether they include this, so check before you try to use it. All phones have an Accelerometer, so if a Gyroscope is not available, you can use the Accelerometer instead as a fallback.
The Motion SensorFor most applications, the combined motion API, which combines and processes input from all sensors, is the simplest way to obtain motion and orientation information. There are physical limitations that can make it difficult to determine the actual orientation and motion of a device from the raw data from the sensors by Windows Phone. For example, readings from the accelerometer include the force of gravity applied to the device in addition to the force resulting from the motion of the device. The gyroscope sensor measures rotational velocity, not position, and so it is subject to drift. Also, there are complex geometrical calculations that are needed to translate the raw data from these sensors into the true orientation of the device. For typical applications that use this type of data, such as augmented reality applications, using the Motion class is recommended.
Motion DataThe Motion class handles the low-level sensor calculation and allows applications to easily obtain the device’s attitude (yaw, pitch, and roll), rotational acceleration, and linear acceleration both due to gravity and user movement. There is a very good range of data here.Note that the angles are in radians, which can catch people out.Make the point that although all phones have a compass in hardware it is not guaranteed that they will have low level drivers that will allow it to work even when Mango is added. Currently, Windows Phone Marketplace uses the compass sensor to determine if the Motion API is supported on a device. If a user views an application that uses the Motion API and their device lacks a compass, they will receive a warning that the application requires a compass sensor.Also, the Motion sensor does not work with the emulator, which only emulates the accelerometer.
Using a SensorYou can select the rate at which you want the sensor to try and update. Note that the sensor itself will have a particular speed, so making this time very short (less than 20 ms) will not make much difference, but it will slow the phone down.
Using the Motion SensorTo get the new sensor readings, simply handle the CurrentValueChanged eventPoint out that in Silverlight, event driven content is fine, but in XNA there is an expectation that sensors will be polled, which is not the case in respect of the Motion sensor. In an XNA game, we must store the values that we get from handling the CurrentValueChanged event, and then read the stored values when the Update method runs (30 times per second).There are examples of how to do this with the Accelerometer (which works the same way) in the XNA deck.
Video Content
Video on the PhoneVideo playback is very easy on the Windows phone platform.You can use the MediaPlayerLauncher class to embed audio or video. For a more customizable UI, you can use the Silverlight MediaElement API, which is easy to program.There are many supported codecs – see the MSDN documentation. Windows Phone can play media encoded as WAV, WMA, WMV, MP3, MP4, 3G2, 3GP, AAC and others.
Streaming Video on the PhoneYou can handle streaming video using the MediaElement API. Simply set the Source property to a URL.The code snippet starts the video playing automatically. You can add Stop, Start, Pause functionality into your UI and control playback of the MediaElement.
Controlling PlaybackYou can interactively control media playback by using the Play, Pause, and Stop methods of a MediaElement object.The code snippet on the previous slide had AutoPlay=”true” which starts the video playing automatically. You can add Stop, Start, Pause functionality into your UI and control playback of the MediaElement.
Smooth StreamingMicrosoft Media Platform: Player Framework (MMPPF) is Microsoft's open source media player framework - a component of the Microsoft Media Platform. This project was formerly known as the Silverlight Media Framework (SMF). MMPPF enables developers to quickly deploy a robust, scalable, customizable media player for IIS Smooth Streaming delivery. The MMPPF now includes full support for Windows Phone 7 so developers can incorporate high-end video playback experiences in their Windows Phone 7 applications.
ReviewIn this module, you learned about:Launchers and Choosers, which allow your applications to invoke some of the built-in experiences on the phone and incorporate them into your applicationsLaunchers simply invoke a built-in experienceChoosers launch a built-in experience and get some data passed back when completeApplications can use the CameraCaptureTask chooser to add picture taking capability to their apps, or can use the Photocamera object to get direct programmatic access to the camera hardware and allows direct manipulation of the video streamWindows Phone supports playing of video content