Creating Windows Phone and Window 8.1 applications using Microsoft App Studio

 

This article aims to present the Microsoft App Studio for creating applications for Windows Phone 8.1 and Windows 8.1.

A few months ago Microsoft released Windows Phone App Studio Beta, a service that allows any person without programming skills to can create applications for Windows Phone in just 4 steps: have an idea, add content, choose style and use the application. Recently, more specifically in the Microsoft //Build/ event, that took place last April, a new version of the service was released alongside the beta version of Windows App Studio, which in addition to the Windows Phone applications, allows the creation of Windows 8.1 applications.

The service can be accessed from appstudio.windowsphone.com. To start with this service, the user is required to have an Outlook.com account or, in case the user doesn’t have an account of these, any Microsoft Id will work. For accounts that not fits with theses, the email account can be associated with Microsoft Id, and for it the user should use the link http://bit.ly/1gywtmO or in login page, click in Sign up.

 

The first time we do the login, the website will show a screen for allow the App Studio to access our account, which can be changed later if we wish to. After this, we need to accept the terms of use and we need to define the user for the email account we are using.

At this moment, we are ready for start creating application! For it we only need to click the button “Start new project”.

 

App Studio provides a set of templates for help the users in creating application. Theses templates are application demos for a specific context which are more used.

 

 

Noteworthy is that all the templates are C # / XAML applications and are available for both Windows Phone 8.1 and Windows 8.1, except for the Web App Template which is only available for Windows Phone.

When selecting a template of type “Empty App” we are creating an application from scratch. This template is often used when the other templates do not meet the needs of the user or for more advanced users who already have some experience with App Studio.

The user will set all kinds of content, styles and will have to use all your creativity to build a “great app”. In the case of the “Web App Template” the user will also create the application from scratch, but in this case is given a base Url which will be the starting point of the application and have access to some buttons on “AppBar”, this template is ideal for website that suits to the mobile devices. On the other hand, other templates allow to have a quick guide
in the application we are building and we only have to change the data and customize the application.

 

Now, let’s see in practice how we create applications with these templates.

 

Contoso Ltd Template

After we select the template, a screen will be shown where we can have a first look at the app. This is a simple simulation the app for Windows Phone and Windows 8.1 that does not allow to navigate to the details pages.

 

This screen allows us to have an idea about the application without installing it. Let’s see the configuration for this template.

 

Content

The first page shows the application name and logo (left, at the top) and shows all definitions for the content of the app, which, in this case, has five sections:

  • About us is an HTML section
  • Catalogue is a dynamic collection section
  • Team is a dynamic collection section
  • News is a Bing section
  • Contact us is a menu section which has menu actions

There’s a limit of up to six sections. After each section is created we can edit, delete or move the section position with the goal to define the best order for it.

For each section we can select one of the following options:

  • RSS – A list of sets of information based on an RSS feed that you enter when creating the data source.
  • Html – A single page of static text that you enter.
  • Youtube – A list of videos with titles and descriptions based on a YouTube channel or search that you enter when creating the data source.
  • Flickr – A list of images and their corresponding data based on a Flickr UserId or search that you enter when creating the data source.
  • Bing – A list of news
  • Facebook – A Facebook feed from a public Facebook page.
  • Instagram – a Instragram feed based in a tag
  • Menu – allow to create menu action which can use other apps (for example: using an address for Here Maps, using a phone number for make a call phone, and others)
  • Collection – A list of items with columns of characteristics. The collection can be static or dynamic and if the collection is dynamic the data can be imported or exported for a CSV file.

A future feature will be the twitter feed, but at this moment this is not available in App Studio, but was mentioned in a //build/ session on this subject.

App Studio already has a comprehensive list of data sources, allowing the user to create compelling apps. However, these data sources are based on RSS feeds which have a limited number of items and some presentation limitations

Theme

In this page, we can define the background image or the background color, define the text color and the application bar color. There are three option: custom style (using a background image), dark style and a light style. The Select button allows to define the style and then we need to save the configuration.

 

Tile

 

In the Tiles tab, we can define tiles for the application and we can select one type from the three available types: Flip Template,
Cycle Template and Icon Template. In this case was selected the Cycle Template and the respective images.

In the Splash & Lock separator, we define the images for o splash screen and for lock screen, for both apps.

This page doesn’t mention the size of the images but when we try to upload it, will be shown the allowed size if our images don´t fit those values.

 

Publish


In this page, the language for the app is defined. For now it is only possible to select one. It is possible to define the title, the description, and we can define if the app has an About page or even ads (but it requires development in Visual Studio). Before the finalize step it is possible to associate the app with the store, which requires a reserved name in Store Dashboard.

After all configuration we are available to finalize the app by clicking in Finish button.

 

Finish


 

On this page you can view the applications for each target platform (not being able to navigate) and it is possible to generate the application to get the application packages for install on each device and then get the source code. Clicking on the “Generate” button we get a screen where we can choose which application we want to generate.

 

 

We can generate for both cases, which implies two different generations. However, for a more experienced user that uses Visual Studio to test our application, it is recommend the generation for Windows 8.1, because the generated code is an “universal app” solution that consists of the Windows Application project Phone 8.1, Windows 8.1 application for the project, shared between the previous projects and also contains a project of type “portable class library” with the whole data structure.

After this step, we can get the application packages that allow to test the application in our devices, or we ca get the source code and then test the application in simulator or in a device using Visual Studio (but for it is a requirement to have the developer account). Is possible to install the application package directly in the device using the QRCode provided and is possible to share, in social network, the url for the application.

When we generate the application for Windows 8.1 we get this screen

Where we can get the package for the Windows 8.1 application and then we can use PowerShell to install it in our PC with Windows 8.1.

 

And we can get the source code, which the solution is a Universal App, whit the following structure:

 

With the source code, each application can be extended in order to add new features such as:

  • Add more resource strings (localization)
  • Add ads configuration
  • Add Twitter feed
  • Change the user interface

amongst others …

 

Web App Template

Like it was mentioned, this template is only available for Windows Phone and this is a Web App. Let’s now see in practice how we can use this template.

When we select the Web App Template we will see this page

 

As we can see, the content of this app is only a reference for a url, which is a website that supports mobile devices.

For example, this template uses the m.microsoft.com url, but we can change it for use any another url, like: booking.com, m.sapo.pt, m.vodafone.pt, amongst other references…

The definition for Theme, Tile and Publish are the same as we saw in Contoso Ltd template.

When we click in the Finish button, we will get to a page for generating the application packages and the source code. And when we click in Generator we will see this screen

 

The final result of the application, using the reference m.sapo.pt is

 

The application from App Studio should be tested in different devices to ensure that the application works propertly and is like we defined. Only after completing the tests, the application must be submited to the store. Recall that in the Publish page we had the option to connect the application to the store, and on the final page after the generation of the application is provided in the reference to submit in store. The applications generated by App Studio will be pass in certification process like an application developed by a programmer.

For more advanced users, who wish to extend the application giving new functionality, they don´t have a way to submit the changes in the App Studio. The solution is to do a “merge” between the modified source code and the new version of the application. And starting the moment the source code is changed, the user is responsible for the creation of application packages using Visual Studio

For more information about this subject, see the curation Building apps without code using AppStudio that contains articles, videos and others resources about App Studio.

 

In conclusion, the App Studio presents a quick solution to develop applications for both Windows Phone and 8.1 for Windows, and we can extend the functionality of the application through the generated source code. I’d like to point out that, despite all the associated automation, there are some limitations that should be worked out in the future, so that applications generated by the App Studio will have more quality.

 

 

Adding SQLite SDK Extension to the project without installation requeriment

Today, in the Xamarin.Forms.Labs we find an error in a WP Demo, the Cache sample throw an exception each time the application try to get the implementation of ISimpleCAche

_cacheService = Resolver.Resolve<ISimpleCache> ();

But the code is right because we do this:

private void SetIoc()
        {
            var resolverContainer = new SimpleContainer();

			var app = new XFormsAppiOS();
			app.Init(this);

			var documents = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
			var pathToDatabase = "xforms.db";

			resolverContainer.Register<IDevice> (t => AppleDevice.CurrentDevice)
                .Register<IDisplay> (t => t.Resolve<IDevice> ().Display)
				.Register<IJsonSerializer, Services.Serialization.ServiceStackV3.JsonSerializer> ()
				.Register<IXFormsApp> (app)
				.Register<ISimpleCache> (t => new SQLiteSimpleCache(new SQLite.Net.Platform.XamarinIOS.SQLitePlatformIOS(),
					new SQLite.Net.SQLiteConnectionString(pathToDatabase,true), t.Resolve<IJsonSerializer> () ));
				

            Resolver.SetResolver(resolverContainer.GetResolver());
        }

The problem is, we need to add reference to SQLite for Windows Phone, without it we cannot use SQLite engine.

But it is installed in a folder in PC, and if we change the PC or share with other person, is a requirement to have it installed.
For avoid this problem i opened the cproj in notepad++ and added the lines:

  <PropertyGroup>
    <SDKReferenceDirectoryRoot>$(SolutionDir)\Sdks;$(SDKReferenceDirectoryRoot)</SDKReferenceDirectoryRoot>
  </PropertyGroup>

 

and then I went to the folder that contain all SDK extensions and got it, and create my own folder in project (called SDK), here is the tree:

folders

then when I added this to the project the path is for my folder:

path

Note: This SDK Extension must be updated manually!!

See my old article about similar problem, here.

I was Windows Phone and Windows Store Apps Technical Guru – May 2014

This week, was published The Microsoft TechNet Guru Awards! (May 2014)!

And I am really happy, because my article

Authentication using Facebook, Google and Microsoft account in WP8.0 App (MVVM)

was selected as the Windows Phone and Windows Store Apps Technical Guru – May 2014, and as Gold!
guru

This article was my first article in Technet Wiki, and couldn´t be more happy 😀

Related articles:

My article got Longest Article Award in TechNet Wiki

Mobile Notification for any device using Azure Notification Hubs

Today I did a presentation about Notification Hubs, here is the slides I used:

The code can be find in my github account:

https://github.com/saramgsilva/NotificationHubs

Related articles:

[Azure] Notification Hubs – All resources you need

[Azure] Notification Hubs – All resources you need

[Update: January 2015] Please see this sample: saramgsilva.github.io/NotificationHubs

Today I did a presentation in Microsoft Developer Tech Refresh, in Microsoft Portugal. And the presentation was about Mobile Push Notifications to any device with Azure Notification Hubs.

While I prepared all my things for this presentation I saved all interesting and recent resources about this subject. I hope that can be useful for all that want to learn how to use  Notification Hubs.

1. The first thing you should read:

2. For register devices in Notification Hubs, there are samples for each platform:

3. For register devices using any backend, there are two samples: using WebApi or Azure Mobile Services.

Using WebApi:

Using Azure Mobile Services:

Others about this subject:

4. Movies in Channel 9:

5. Others:

6. Guys on twitter:

 

Soon as I can I will publish my presentation and the demos I used/created.

1ª Community Morning Sharepoint.PT e NetPonto

No dia 21/06/2014 será realizada a 1ª Community Morning Sharepoint.PT e NetPonto em Lisboa. Para participar, efectue o registo de acordo com as instruções abaixo.

Agenda

09:45  – Recepção dos participantes
10:00  – How to troubleshoot issues on SharePoint Online – Pedro Mateus
11:30  – Intervalo
12:00  – C# [+ Serviços] + Microsoft Excel como `front-end` – Caio Proiete [MVP]
O Microsoft Excel é uma das ferramentas mais utilizadas nas áreas de negócio/operações de muitas empresas em todo o mundo e, em inúmeras ocasiões, adicionar novas funcionalidades ao Excel utilizando .NET pode ser uma óptima solução, principalmente pela rapidez com que se consegue extender o Excel, e pela agilidade que se ganha ao permitir que os utilizadores continuem a usar uma ferramenta que já dominam.Nesta sessão o Caio Proiete vai explorar conosco como extender o Microsoft Excel (por exemplo: adicionar novas fórmulas, ribbons, ecrãs, etc.), utilizando C# .NET com a ajuda de um par de bibliotecas open-source (em alternativa ao VSTO), com foco em soluções tácticas e/ou protótipos rápidos.
13:30  – Painel de Discussão e Sorteio de Prémios
Nota: Ao final da reunião, escolhemos um restaurante próximo e fazemos um almoço em grupo para continuar o convívio e aproximar as pessoas. A participação é opcional.

Registo / Inscrição

Para participar, basta efectuar a inscrição através do site:
https://community-morning-sharepointpt-netponto-junho.eventbrite.co.ukA entrada é gratuita.Qualquer questão / esclarecimento, entre em contacto connosco.

Local

Microsoft Portugal – Auditório
Rua do Fogo de Santelmo, Lote 2.07.02
1990-110 Lisboa
Portugal

Clique para ampliar o mapa.

Patrocinador “Gold


Patrocinadores “Silver


Patrocinador “Bronze


Mais Comunidade NetPonto:

Using Xamarin.Auth.OAuth2Authenticator with async/await

Since Xamarin published the Xamarin 3 I have been playing with this.

Normally I develop apps for Windows Phone and Windows Store, and when i started to use some libraries related with Xamarin, I found some that libraries don´t use the async/await concept, and for me is a fundamental.

One library that I think should use async/await but that I saw don´t use is the Xamarin.Auth!

For how that uses Xamarin.Auth.OAuth2Authenticator for authentication I recommend this solution:

For Xamarin.Android

public async Task<Account> LoginAsync(Activity activity, bool allowCancel)
        {
             var auth = new OAuth2Authenticator(
               clientId: "<scopes here>",
               scope: "<scopes here>",
               authorizeUrl: new Uri("<url here>"),
               redirectUrl: new Uri("<url here>"))
            {
                AllowCancel = allowCancel
            };

            // If authorization succeeds or is canceled, .Completed will be fired.
             var tcs1 = new TaskCompletionSource<AuthenticatorCompletedEventArgs>();
            EventHandler<AuthenticatorCompletedEventArgs> d1 =
                (o, e) =>
                {
                    try
                    {
                        tcs1.TrySetResult(e);
                    }
                    catch (Exception ex)
                    {
                        tcs1.TrySetResult(new AuthenticatorCompletedEventArgs(null));
                    }
                };
           try
            {
                auth.Completed += d1;
                var intent = auth.GetUI(activity);
                activity.StartActivity(intent);
                var result= await tcs1.Task;
                return result.Account;
            }
            catch (Exception)
            {
                // todo you should handle the exception
                return null;
            }
            finally
            {
                auth.Completed -= d1;
            }

        }

 

And then we need to call it this way:

var authService = new AuthService();
var result = await authService.LoginAsync(this, allowCancel);

 

For Xamarin.IOS

public async Task<Account> LoginAsync(DialogViewController dialog, bool allowCancel)
        {

            var auth = new OAuth2Authenticator(
               clientId: "<scopes here>",
               scope: "<scopes here>",
               authorizeUrl: new Uri("<url here>"),
               redirectUrl: new Uri("<url here>"))
            {
                AllowCancel = allowCancel
            };

            // If authorization succeeds or is canceled, .Completed will be fired.
            var tcs1 = new TaskCompletionSource<AuthenticatorCompletedEventArgs>();
            EventHandler<AuthenticatorCompletedEventArgs> d1 =
                (o, e) =>
                {
                    try
                    {
                        tcs1.TrySetResult(e);
                    }
                    catch (Exception ex)
                    {
                       tcs1.TrySetResult(new AuthenticatorCompletedEventArgs(null));
                    }
                };

            try
            {
                auth.Completed += d1;
                var vc = auth.GetUI();
                dialog.PresentViewController(vc, true, null);
                var result= await tcs1.Task;
                return result.Account;
            }
            catch (Exception)
            {
               // todo handle the exception
                return null;
            }
            finally
            {
                auth.Completed -= d1;
            }
        }

And then we need to call it this way:

var authService = new AuthService();
var result = await authService.LoginAsync(dialog, allowCancel);

In conclusion, i think it is very simple to use and i think it should be add to the Xamarin.Auth.

I added the sample to:
https://github.com/saramgsilva/Xamarin.Auth/tree/master/samples

and will do a pull request for the original repository.

Microsoft Developer Tech Refresh

Microsoft Developer Tech Refresh
Event ID: 1032589842

Microsoft Lisbon Experience

Rua do Fogo de Santelmo, Lote 2.07.02
Lisboa Lisboa 1990 – 110
Portugal
Language(s): Portuguese.
Product(s): Microsoft Visual Studio, Windows, Windows Azure and Windows Phone.
Audience(s): Academic, Architect, Designer, Developer Generalist, IT Decision Maker, IT Manager, NonProfessional Developer, Pro Dev/Programmer, Tech Influencing BDM, Tech Support – Partners, Tester and Training – Partners.

Na Microsoft, trabalhamos de forma a colocar nas suas mãos as ferramentas mais poderosas para que possa criar projetos cada vez mais extraordinários, otimizados para a nova geração de devices e serviços. E, ao longo dos últimos meses, trouxemos até si grandes novidades como o Windows Phone 8.1, Universal Apps, WinJS, Visual Studio Online ou ainda as novas possibilidades com o Microsoft Azure. Apresentámos estas novidades nos grandes eventos internacionais como a BUILD, o Tech.Ed e mais – colocando todas as sessões ao seu dispor, online e gratuitamente.Mas queremos que possa conhecer estas novidades em detalhe, vendo estas tecnologias em ação. Foi por isso que criámos o novo

Microsoft Developer Tech Refresh. Um dia com 3 tracks distintas recheadas das melhores sessões técnicas (de participação livre, e independente) com as novidades das plataformas Microsoft que mais precisa de conhecer. Acima de tudo, um evento pensado para todos os que querem estar na linha da frente da tecnologia.E para este dia 18 de Junho preparámos uma agenda à altura das novidades apresentadas, que pode consultar abaixo.


Contamos consigo!
A Equipa Developer Experience & Evangelism
Microsoft Portugal
Agenda (em atualização):

 

Developer Track #1
Auditório Azure A

Developer Track #2
Auditório Azure B

Developer Track #3
Windows A e B

09h30
(90 mins)

Developer Tech Refresh: Keynote

Nuno Silva, Luís Calado
(Microsoft Technical Evangelists)

11h00

Intervalo para café

11h30
(60 mins)

Universal Apps development using HTML5 and WinJS

Alexandre Marreiros

Strategies for cross platform development with Visual Studio
Sérgio Viana


Mobile Push Notifications to any device with Azure Notification Hubs
Sara Silva

12h30

Almoço Livre

14h00
(60 mins)

Universal Apps development using XAML/C#
Ricardo Pinto

Connected Services: Leveraging Office 365 API in your Applications
Rodrigo Pinto

Integrating HDInsight in your Azure Apps
José António Silva

15h00

Intervalo

15h15
(60 mins)

What’s new for Windows Phone developers
Nuno Silva

Websites : What’s new?
João Pedro Martins

Connecting the World: Building Services for Connected Devices on Azure
Virgílio Esteves

16h15

Intervalo para café

16h30
(60 mins)

Web Application Development using WinJS
(to be confirmed)

Unity: Building your first 2D Game for Windows and Windows Phone

Eduardo Matos & Catarina Macedo

Building Line of Business Apps that use Active Directory for sign in
(to be confirmed)

17h30


Networking & Apps/Games “Made in Portugal” experience
Microsoft Showroom

 

Source:https://msevents.microsoft.com/CUI/EventDetail.aspx?culture=en-US&EventID=1032589842

[PT] Cross Platform Development w/ Xamarin: workshop (Lisbon)

Cross Platform Development w/ Xamarin: workshop
Event ID: 1032589721

Microsoft Lisbon Experience

Rua do Fogo de Santelmo, Lote 2.07.02
Lisboa Lisboa 1990 – 110
Portugal
Language(s): English.
Product(s): Microsoft Visual Studio.
Audience(s): Academic, Architect, Developer Generalist, IT Decision Maker, IT Implem_App/LOB Spec, IT Manager, NonProfessional Developer, Pro Dev/Programmer, Project Manager, Tester and Training – Partners.

O mundo de dispositivos que hoje temos ao dispor apresenta desafios cada vez maiores aos criadores de Aplicações da nova geração: como otimizar esforços para fazer o target destes dispositivos sem ter de recorrer a equipas cada vez maiores com competências específicas para cada plataforma ou ter de assegurar o suporte a esse conjunto disperso de aplicações?

 

Michael Köster junta-se a nós neste final de tarde para mostrar como é possível, utilizando o Xamarin e o novo Visual Studio, desenvolver Aplicações para Windows, iOS e Android de forma a minimizar o seu esforço de desenvolvimento e suporte.

Contamos consigo!
A Equipa Visual Studio da Microsoft Portugal

Nota: este evento é gratuito e será conduzido em Inglês

Conheça o Xamarin for Visual Studio: http://xamarin.com/visual-studio
Conheça o novo Visual Studio: http://www.visualstudio.com/

 

AGENDA:    

 

18h00

Receção e Credenciação

18h30


Cross-Platform Development Overview

A high-level overview of challenges, approaches and tools for building applications that target multiple form factors and technologies, covering both backend and frontend scenarios.

 

Michael Köster, Microsoft

19h30

Coffee-break & Networking

20h00


Build native cross-platform applications with Xamarin

Xamarin is the new standard for cross-platform mobile development. No other toolset enables developers to reach all major device platforms with 100% fully native apps from a single code base. With Xamarin, developers do mobile development in C# and can share on average 75% of code across platforms. Leverage existing skills, teams, tools and code to deliver great apps with broad reach quickly!


Michael Köster, Microsoft

21h00

Encerramento


Source:
https://msevents.microsoft.com/CUI/EventDetail.aspx?culture=en-US&EventID=1032589721