Alternate the startup project automatically for Windows Universal Apps

Cross-post from my MSDN blog http://blogs.msdn.com/b/msgulfcommunity/archive/2015/01/13/setup-startup-project-automatically-for-universal-apps.aspx 


Hello Developers!

Now with Universal Apps we have 3 or more projects loaded into the Visual Studio solution.

  1. Windows 8.1 Project: It contains XAML UI pages and code that targets Windows 8.1.
  2. Windows Phone 8.1 Project: It contains XAML UI pages and code that targets Windows Phone 8.1.
  3. Shared Project : It contains have XAML UI pages and code that are common to both platforms.

The following screenshot illustrates:

Visual Studio Solution for Universal Apps

As you can notice in the previous screenshot there is one project name that stands out with Bold marking. That is the Startup project, which is the project that runs when you run the solution – for example by pressing F5. Visual Studio runs the project that is selected as the startup. Now, in order to set the startup project, we need to right-click on a specific project node in Solution Explorer and choose Set as Startup Project. The project that we now chose will show in bold in Solution Explorer as a visual aid. In the previous screenshot, it was Site2App3 (Windows 8.1)

So if we run the project now, the Windows App will deploy and start. Moreover, if we need to run the Windows Phone app, we will need to need to set it as Startup up by right-clicking on the Windows Phone 8.1 project node in Solution Explorer and choosing Set as Startup Project. It gets a bit mundane if you keep doing this for sometime while alternating between projects to run the apps after every modification.

Well, I have the answer. The solution to make your lives easier. We can do something in Visual Studio that allows us to run the project without worrying about setting a Startup Project and let Visual Studio decide depending on the current selection, whereby, whatever project you highlight in the Solution Explorer (or file you select in the text editor) will in turn become the current startup project.

To achieve this, right-click on the solution explorer, choose properties. Next select Startup Project, from there select Current Selection from the Radio Button List. The following screenshot illustrates:

By the way this (multiple projects in a single solution) is not the Y2K problem, developers faced similar situations in the past where they had a website project alongside a console application or windows service or others.

Happy Coding :)

Rami

Posted in Visual Studio, Windows Development

Microsoft Dev Center Benefits

Originally Posted at MSDN Blogs: Microsoft Gulf Technical Community


 

Hello Developers!!

I wanted to share with you the news about the updated rewards functionality in the Windows Dev Center Benefits. For those of you who are not aware of the program, Dev Center Benefits is a global program for Windows app developers of all experience levels. Developers receive technical, design, publishing, and marketing offers to help build and promote their apps.

The program provides access to great offers as well as challenges to earn points to redeem for rewards, these rewards include the following:
Rewards Program of Windows Dev Center Benefits

  • Free Dev Center account for unregistered developers
  • Architectural guidance
  • Design Guidance
  • Gift cards for Windows Store
  • 1 million ad impressions with AdDuplex
  • Priority consideration for BizSpark program
  • Windows Store merchandising promotions
  • Priority Publisher Support

The members who join can participate in challenges to earn points which can then be redeemed for rewards. This program is available at no additional costs for those who are already a registered Windows Store developer. If you are new developer on the Microsoft platform, the program will provide a token that waives the cost of the Dev Center registration (normally $99 USD for companies and $19 USD for individuals). Moreover, all Windows and Windows Phone app developers are eligible to enroll in Dev Center Benefits. The program is open where a Windows Dev Center is available:

Joining is easy and for free, you just need a Microsoft Account (The Microsoft account you login with is assoicated to your Windows or Windows Phone Dev Center account). Here is the link to Join:https://devcenterbenefits.windows.com/join/#!/

Happy and in this case “rewarding” coding!

Posted in Uncategorized

How to get FTP Credentials for Microsoft Azure Websites

Azure Websites

Originally Posted at MSDN Blogs: Microsoft Gulf Technical Community
———————————————————————————————–

Some of you, who have been using Azure or planning to use it at some point, might come across this small predicament. So you create a Azure Website and then you might want to connect to that Website via FTP. You go to the Azure Portal -> Websites, you look for the FTP credentials but all you can see is the following:

  • Site URL:                             something.azurewebsites.net
  • FTP host name:                  ftp://waws-prod-db3-003.ftp.azurewebsites.windows.net
  • FTPS host name:               ftps://waws-prod-db3-003.ftp.azurewebsites.windows.net
  • Deployment / FTP user:    somethinguser
  • FTP Diagnostic Logs:        ftp://waws-prod-db3-003.ftp.azurewebsites.windows.net/LogFiles
  • FTPS Diagnostic Logs:     ftps://waws-prod-db3-003.ftp.azurewebsites.windows.net/LogFiles

These values do not give you access to your FTP credentials. Moreover, the FTP credentials are not the login and password that you are using everywhere else.
Nevertheless,  Azure provides you with a Publish Profile that you can download as per the following screenshot:

– Save that Publish Settings file some where on your machine so you can edit it.

– Open the file with a notepad or XML viewer for better readability (you can open it with Visual Studio too)

The file would look something like the following:

The previous screenshot shows the FTP server name (Host), user name and password. These values are what you need to enter when you use an FTP tool like Filezilla or any other tool you have to access your site remotely. Bear in mind, that the ftp Passive Mode is set to true.

That’s it for now. Happy FTPing.

 

Posted in Windows Azure Tagged with:

JavaScript Promises Essentials

Book Cover

I have some very exciting news!

My book titled JavaScript Promises Essentials has been published. For the past couple of months I was a bit :) busy with authoring this small technical book of around 90 pages. It was a great challenge, as the topic is very focused. This book is my second publication after the title Developing Windows Store Apps with Html5 and JavaScript which was published last year around the same time. My second authoring experience and it is getting better, I do hope that I will be able to find time in the future for more books and maintain the rhythm. The book was published by Packt Publishing whose team of editors, technical editors, reviewers and project managers provided me with a great guidance and support throughout the authoring period. Moreover, I would like to thank Brian Cavalier for his support and taking the time to contribute with his knowledge on the topic.

The book has the following details:

  • ISBN: 139781783985647
  • Paperback: 90 pages

In a nutshell, the main topic of the book is JavaScript Promises; which is a new programming concept in JavaScript that allow developers to request data that they don’t have yet and deal with it at a non-determined point in the future (asynchronously). Starting with the basics of the promise objects, we’ll be able to leverage the maximum capabilities of promises when writing applications.

The book starts by giving you some background information on the asynchronous programming model in JavaScript, recognizing its importance in JavaScript programming. It then walks you through the key concepts and intricacies of the Promises API. Following that, you will learn how you can write complex asynchronous operations with chained promises and be able to catch and handle exceptions. This book aims at providing you with the essential knowledge needed to write better asynchronous operations using JavaScript promises

Who This Book Is For

If you are a JavaScript developer working with asynchronous operations and want to know more about promises, then this book is ideal for you. Having a detailed explanation of JavaScript promises will be perfect as your next step towards adopting this new standard and using the API in your web and JavaScript applications.

Here is a list of some of the things that you will learn from reading this book:

  • Implement asynchronous programming in JavaScript
  • Get acquainted with the JavaScript Promises API
  • Choose the right JavaScript libraries to use callbacks in a non-compatible platform
  • Write chained asynchronous operations that are easy to manage
  • Master WinJS Promises for developing Windows applications
  • Differentiate between various implementations of promises in JavaScript
  • Put promises into action in your applications
  • Catch and handle errors effectively in asynchronous operations
  • Explore browser support and platform compatibility for JavaScript promises

Read more about the book on this link, or download a sample chapter from here

You can also find the book on Amazon available in Paperback  and Kindle Edition via this link: http://www.amazon.com/JavaScript-Promises-Essentials-Rami-Sarieddine/dp/178398564X

Happy Reading :)

Posted in Books Tagged with: ,

The simplest JavaScript Promises examples

You might have heard the new buzz word Promises. I am not going to take long explaining Promises in this post, I will have another just on that topic. But for now, what you need to know is the following

  • Promise/A+ is the open standard for sound, interoperable JavaScript promises.
  • “Promise” in the A+ spec is defined as “an object or function with a then method whose behavior conforms to this specification”.
  • Promises present a great solution to address the complexities of asynchronous operations in JavaScript.
  • Promises are native with ECMAScript 6
  • Promises save you from the “CallBack Hell”
  • Promises have been implemented in numerous JavaScript libraries and many of which are complaint to the Promises/A+ spec.
  • It is available in WinJS but it adheres to the CommonJS/Promises proposal and still is not complaint to the Promises/A+ spec

I wanted to share with you the simplest example of an asynchronous call with Promises. The following code can be viewed in this JSFiddle http://jsfiddle.net/azrd0n4s/ as well

var promTest = function () {
return new Promise(function (resolve) {
setTimeout(resolve, 2000);
});
};
promTest().then(function () {
alert("and then?");
}, function (error) {
alert("i have errored");
});

The previous code is straightforward, we created a variable called promTest and assign it to a function that returns a new promise, we create a new promise that is resolved with a setTimeout after 2 seconds.
Then we call that promise with its then() method and pass it alert() in the success handler and alert(“i have errored”!) in the error handler.
Run the code in an HTML page or the above JSFiddle link and you will see it action.

Now how about a simple example that uses an XMLHttpRequest to make a web call and retrieve a JSON content  using promises. You can test it on this JSFiddle:  http://jsfiddle.net/cv0n9ogj/
HTML
<div id="result" style="color: red;"> </div>

JavaScript
var getJSON = function(url) {
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('get', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status == 200) {
resolve(xhr.response);
} else {
reject(status);
}
};
xhr.send();
});
};
getJSON('https://www.googleapis.com/freebase/v1/text/en/bob_dylan').then(function(data) {
// alert('Your Json result is: ' + data.result); //you can comment this, i used it to debug
result.innerText = data.result; //display the result in an HTML element
}, function(error) { //error detection....
alert('Something went wrong.' + error);
});

The code is simple again, we define a function called getJSON that returns a promise, it makes an xhr call to a URL, this web call returns json retrieved in the result of the then() method after it succeeds, then we put that result in an div element for display. you can add/remove a letter from the URL to cause an error and see how it is alerted.

Posted in Web Development Tagged with:

Book Review: Building Web and Mobile ArcGIS Server Applications with JavaScript

Book Cover

Another book review of a book that I recently had the chance to go through.This publication was titled Building Web and Mobile ArcGIS Server Applications with JavaScript.

As the tagline states, this book really allows you to master the ArcGIS API for JavaScript. Reading this book leaves you equipped with the knowledge and tools to build some good web and mobile GIS applications with the ArcGIS Server. The ArcGIS space is a vast one in terms of implementation and this book does cater for the essentials topics needed.
The book is a must read for anyone interested in working with ArcGIS in the JavaScript world. The book presents several examples that allow the reader to reason about the usefulness of ArcGIS. The author leverages the visuals in a very good way that enhances the level of understanding for the readers.
The book contains a thorough description and details about the API and the classes it offers amplified with examples for using those classes.
One thing that caught my attention was the section about the comments in the code, which I personally think is a must when writing large chunks of code.
In general the book’s approach of step-by-step instructions and examples allows the reader to quickly learn and deeply understand the key features and design.
Nevertheless, I had mixed feelings regarding the first chapter Introduction to HTML, CSS and JavaScript. Well I skipped it and any developer would do. It is targeted for those who are very new to this topic. I would assume that people interested in this book would be knowledgeable in those concepts. Needless to say, the chapter is great for new comers to the HTML and JS world.
The cherry on top was the last chapter which covers support for mobile platforms provided by the ArcGIS Server API for JavaScript provides through the compact build.

It is a very good read, for anyone who is interested in learning about the topic.
Happy reading :)

Posted in Books Tagged with: , ,

Azure from Visionary to Leader in 1 Year

Gartner Report 2014 Vs. 2013

Gartner Report 2014 Vs. 2013

Microsoft Azure IaaS from a visionary to a leader in less than a year on Gartner.

 

Microsoft has announced the general availability of Azure Infrastructure Services a little over a year ago. And from that time, features and enhancements have been pouring over that cloud offering and at a very quick rate. Addressing customer and partner feedback with features that Azure users have been asking for.  Back then, specifically in August 2013,  Microsoft was named a visionary in the Infrastructure as a Service front in the Gartner Report.
Moving forward, in less than a year, all that hard work and efforts have paid off and this week  Gartner has named Microsoft as a Leader in its 2014 Cloud Infrastructure as a Service (IaaS) Magic Quadrant report.
This comes after a short after Gartner recognized Microsoft as a Leader in the Enterprise Application Platform as a Service (aPaaS) market in its 2014 Enterprise aPaaS Magic Quadrant.

This new announcement makes Microsoft the only public cloud vendor to be named a Leader for both PaaS and IaaS.

I am personal fan of Azure, so I thought I would share the good news.
You can check the full report here.
And remember cloud is the future.

Posted in Windows Azure Tagged with: , , ,

Book review of Windows Phone 8 Application Development Essentials

Book cover - Windows Phone 8 Application Development Essentials

Hello Folks!

This is no technical post, as you can clearly tell from the title, this is a review of a book that I recently had the chance to go through.
PACKT Publishing  “one of the most prolific and fast-growing tech book publishers in the world” and of course the publisher of my book Developing Windows Store Apps with HTML5 and JavaScript, recently contacted me with the ask of reviewing one of their new publications titled Windows Phone 8 Application Development Essentials,
and I accepted the ask with utmost delight.

Just having a look at the Table of Contents, makes you certain that you are on a very good read. I have an experience with Windows 8 app development with strong emphasis on Javascript/HTML5 and always wanted to learn the essentials of Windows Phone development with XAML. So if you share the same story, someone who wants to learn about Windows Phone development from A to Z, then you will find this book very helpful.

Chapter 1 brings a great introduction to XAML in Windows Phone, covering the most important topics for someone who wants to develop for Windows phone: common controls, containers, navigational controls and working with data.  The controls are very well documented.

Moving forward, you will learn about the design principles and best practices from a fellow Windows Phone developer.

Chapter 3 covers MVVM (The Model View ViewModel architectural pattern), the backbone of developing Windows Phone apps, and interestingly the chapter covers the aspects of the MVVM that you will need in Windows Phone development and doesn’t elaborate more, which is more than you need if you are there to learn about Windows Phone 8 development only.  A great thing about this chapter is that it covers the MVVM light toolkit that developers find a very useful and allows speed of development with Windows Phone.
Then the author, briefly covers the integration with the Windows Phone as a device with topics of launchers (camera launcher for example), notifications, storage, files and background agents.

Last chapter, is like the dessert following a very healthy meal, sweet but not too heavy. Teaching you in details, how to integrate with Facebook and Twitter APIs which will help you implement great features in an app. The author goes in details, step by step with each.

In a nutshell, it was an excellent read. Furthermore, the book is great for the developers who want a jump start course on Windows Phone 8 app development while learning about very important topics in programming which are XAML and MVVM pattern. This book will also be your guide along the way after you finish it, it will serve as a resourceful reference.

Happy Reading

Posted in Uncategorized Tagged with: , , ,

App Academy Dubai on Windows 8.1, Azure and Visual Studio 2013

It’s in 4 days!!!!! Register, Share and Attend. Come see what’s new in Visual Studio 2013, Learn all about developing apps for Windows 8.1 and connecting your apps with Windows Azure Mobile Services.


Dubai, UAE
Microsoft Office
GEMS Room, Bldg
#8, DIC
November 8-9
9am-6pm
FREE EVENT
Limited seating,
register today.To find out more
click here
The App Academy is a free event organized by developers for developers. This is your opportunity to improve your app development skills by learning about the new changes, features and APIs available in
Windows 8.1 that will leverage your coding skills and help you start developing for windows 8.1. you will also learn how to integrate cloud-based back-end solutions in your apps.Stay updated with what’s new in Visual Studio 2013 and the powerful tools and services it provides to help you create a new breed of applications or to modernize existing applications. You can also explore the innovative features it brings for better developer productivity, support for Windows 8.1 app development, web development advances and expanded ALM capabilities.Visit the Microsoft Virtual Academy for additional training information.Register now to attend the App Academy to become an expert app developer! Optional: Bring your own device with device with Windows 8.1 and Visual Studio 2013 installed.

 

 

Posted in Events, Windows 8.1

Developing Windows Azure and Web Services Jump Start

Great new Free (You heard right, FREE!! ) course covering Windows Azure is coming your way(November 13, 2013) on Microsoft Virtual Academy

Course title is: Developing Windows Azure and Web Services Jump Start

The course is Fast Paced Live Virtual Session, targeting Web developers who are looking for ways to increase their reach and reduce your work. Attend the course to find out how to build Web API or WCF services that can access data and are hosted in Windows Azure.

If you want to build services that can be accessed by apps across multiple devices, then this is the Jump Start for you. You’ll get the end-to-end scenario for building the entire application.

COURSE OUTLINE

– WCF Web Services
– Windows Azure Services
– Azure Storage and SQL Database
– Data Access Technologies
– Data Access with Entity Framework
– Web API Services
– Advanced Topics

More details on the event on this link right here

Register Today

Posted in Events Tagged with: , , ,

Stay Updated

Join 1 other subscriber

Archives

Skip to toolbar