Learn Mobile App Dev & Mobile DevOps Here

DevOps Meme

My friend Prachi tagged me on this meme on Facebook and I couldn’t agree more with her. When I started my career, my entire version control was folders – zipped, tagged and stored on multiple hard-disks. But then things changed. My guru Raj, enlightened me about advantages of version control systems. I learned about how multiple people can collaborate on projects or how errors can be reversed by going through code history if version controls like Team Foundation Server or GitHub are used. I started using those and these days, all my projects and samples are either in Visual Studio Team Services or in GitHub repository.  Going one step ahead, I’m using Visual Studio Mobile Center for DevOps along with these version control systems.

But what is this all about? How it helps in building successful mobile applications? And I thought about answering these questions in a video series. The goal is to explain mobile DevOps and different steps in mobile DevOps in small (less than 10 mins) videos.  After completing this series, you’ll be able to build cross-platform Xamarin.Forms mobile application, which will consume Microsoft Cognitive Service and set-up mobile DevOps for the same.

To follow along with this series, I’m recommending following minimum hardware/software combination:

  • Intel i5, 8GB, 50GB machine with Hyper-V support & Windows 10 Professional
  • MacBook or MacMini with i5, 4GB, 50GB for compiling iOS apps
  • Visual Studio 2017 Community Preview

With these hardware/software additional services used in this series are:

Watch the 1st video here about activating these tools & services to set-up mobile DevOps.

In 2nd video learn about how to setup build automation, using Visual Studio Mobile Center.

I’ll update this blog post in coming weeks with the 3rd video in this series, which will be about building mobile applications.

Stay tuned and subscribe to my blog/channel :)

Namaste.
Mayur Tendulkar

Advertisements

Updating Mobile Development Environment

On 20th July, Microsoft released Visual Studio 2015. This release of Visual Studio includes improvements in terms of IDE features, Language features and even changes in underlying .NET framework. Along with this, Microsoft is also releasing Windows 10 on 29th July, which will add Universal Windows Platform (UWP) development capabilities to Visual Studio. In this blog post, I’m going to cover the features that are most important for us i.e. mobile developers. Having said that, if you want to build UWP apps on RTM, hold on till July 29th, as the SDK and tooling for UWP will be released on the same day. You can find that information here.

Install Selection

You can think Visual Studio 2015 as the most complete mobile development IDE. You can build any kind of mobile applications which can run on Android, iOS and Windows devices. To setup your environment for mobile development, while installing itself, make sure you select your required tools. For example, here I’ve selected Xamarin tools to build native mobile applications. In this case, Visual Studio will install the necessary SDKs and libraries e.g. Android SDKs & NDKs with different API levels, Java SDK, etc…

VS 2015 Install

If you’re already a Xamarin developer, you may want to install Xamarin Studio, which needs to be installed separately by downloading Xamarin Installer from the site. With open sourcing of .NET and Roslyn, even Xamarin Studio is using some of its benefits. You can read more about it from Miguel’s blog.

Xamarin Integration & Project Template

Previously (VS 2013 or prior), you had to install Xamarin to get Xamarin specific project templates. With VS2015, if you select above option during install, you’ll have Xamarin project templates in File > New Project Dialog.

VS 2015 Project Templates

Note: The difference between Blank App (Native Portable) & Blank App (Xamarin.Forms Portable) is literal. That means, later one has Xamarin.Forms NuGet and integration in all projects. First one, just creates 4 separate projects without Xamarin.Forms dependencies.

When you create a Xamarin project, Visual Studio will ask you to sign into your Xamarin account to use different features according to license.

VS 2015 Xamarin

Developer (aka God) Mode

As I mentioned above, if you want to build UWP apps on RTM, you’ll need to wait till 29th July. And to enable Windows Store apps development and debugging on your machine, you’ll need to enable a ‘Developer Mode’. When you create a new project you’ll get following dialog which can take you to next dialog, where you need to select ‘Developer Mode’ and you should be able to test your apps. Do the same thing in your Windows 10 mobile device, if you want to debug apps directly on mobile.

VS 2015 - Developer Mode

VS 2015 - Developer Mode Enabled

Accessing Tools

This is not new as such to Visual Studio 2015, but I want to add it here for your reference. You can find all the tools and setting related to Xamarin and mobility under Tools menu. So, if you want to download new API Level (for example Android M Preview) or monitor your Android app’s performance on device using Android Device Monitor, you know where to look for. We’ll cover tools and features exclusive for Windows 10 in next post.

VS 2015 Tools

By the way, if you ever face any issues with Xamarin and need to contact support, Xamarin logs can help you to share more information about your issues with Support guys. Even, you can go through them and find issues/reasons. You can find them easily under Help > Xamarin

If you want to check where exactly platform SDKs are installed, you can find in Tools > Options and at two different selections

VS 2015 - SDK Location - 1

VS 2015 - SDK Location - 2

More Resources

Now, if you want to know more about Visual Studio 2015 and .NET Framework, Microsoft Channel 9 has Connect On-Demand series on it. Some of the most important videos are here

What’s new in C# 6
New Coding Experiences for C# and Visual Basic
What’s New for .NET 2015
Developing iOS and Android Apps in C# with Visual Studio
Xamarin.Forms: Leaveraging XAML to Build iOS, Android, and Windows Apps
Wearables in C#: Highlighting Apple Watch, Android Wear, and Microsoft Band
GitHub Extensions for Visual Studio

I’ll update tendulkar-uvāca series with new tools and technologies once they are released i.e. after 29th July. Till then, download the Visual Studio 2015 and enjoy the new IDE & tooling.

By the way, have I told you: You get Visual Studio 2015 Community Edition free for specific use cases and along with it, you get Xamarin Starter for free. If you’re a student, you can get more benefit through Microsoft DreamSpark program.

Namaste
Mayur Tendulkar

 

Plugin 05: Accelerometer

In our series on plugins, today we’re going to cover plugin which can help us to work with Accelerometer sensor. This sensor is responsible to detect X, Y, Z co-ordinates of the devices. Using data received from this sensor, you can build games like TempleRun, where users can collect the coins by tilting the device.

There are different APIs for different platform and their usage is different too. First, lets see how we can use this sensor in different platform and then we’ll use plugin in Xamarin.Forms application.

Being Windows Runtime API, the API and its usage is same in Windows and Windows Phone. Here, you create object of the sensor and register for ‘ReadingChanged’ event. Whenever device position is changed, it is reported through that event and UI can be updated using Dispatcher.

In case of Android, it is again similar to Windows platform. Create object of SensorManager and register for SensorChanged event.

iOS is not any different. You create object of CMMotionManager and then listen to sensor for changes.

As you can see, for three different platforms the APIs are totally different. But with Plugins for Xamarin.Forms it becomes easy. You can use DeviceMotion plugin which can work across all these platforms. And the code for same looks like:

In this series on plugin we’ve seen how particular concept can be implemented in all the three platforms and how we can use plugin to make life easier. This will be be last post in this series, but there are many plugins available which you can explore and use in your projects. Do let me know if you want to cover any specific plugin. We’ll start with a new series in couple of weeks. Till then… happy coding :)

Namaste
Mayur Tendulkar

Don’t Re-Invent the Wheel: Use Components or Plugins In Your Apps

Xamarin provides native, cross-platform mobile application development using language we all know and love – C#. However, it is still required to learn concepts of each platform. For example to send text message (SMS) in all these three platforms there are different set of APIs.

Below API is for Android, which uses SmsManager to send the text message. There is another way to do this using Intents.

image 

In case of Windows Phone, ChatMessage allows us to declare and send text message. This API is available in WinRT platform. In case of SL based apps, we need to use Launchers/Choosers.

image

In case of iOS as shown below, there is no API as such. But we use URL to launch default messaging app. In this case, we cannot set the message body, which we want to send out.

image

Life will be much simpler if there will be just one API on all these platforms which will take care of sending text messages and as I developer we don’t need to bother about on which platform it is being called. Here comes components and plugins. My friend James has written a nice blog about ‘What Exactly is a Plugin for Xamarin?’. You can read it here

In our case, we’re going to use Messaging Plugin for Xamarin and Windows which allow us to use same API to send text messages. Below code is written once in a Xamarin.Forms project which depending on platform on which code is executing, send the message using that platform’s APIs.

image

Using this plugin, it becomes easier to send text messages on Android, iOS and Windows. And this is the magic of Plugins for Xamarin.

In future posts, we’ll cover some of the best plugins and components which can help you build cross-platform mobile applications with single code-base.

I hope you’ve enjoyed this.

Namaste
Mayur Tendulkar

//PUBLISH – Global Event Updates

Microsoft is hosting a global event //PUBLISH. This event is in series with //build, //learn and will be called //publish. You can find more information about this event at: https://publishwindows.com/ 

The idea behind this event is to help you get your apps in the store. If you’re working on any existing app (Windows Store or Windows Phone) or have an app idea, we’ll help you to complete it and submit it on the store. We at Pune User Group are happy to say that, PUG will be hosting this event in Pune. As this is a global event, we’ll be hosting it on the same dates i.e. 16th and 17th May. This post will give you idea about the event.

In Pune, you can find agenda and registration details here: Pune Link. Once you register, we’ll send confirmation mail to registered users and they’ll be invited for the event.

As it is going to be session+coding+support event, please make sure that your machine is properly configured. Please get the latest version of Visual Studio and Windows Phone SDK installed on your machine to avoid confusion at the venue. If you need any help with it, please contact us. My email ID is mayur.tendulkar {at} puneusergroup.org

And have I mentioned, there will be prizes too (for eligible candidates Smile)

Till then.. register and happy coding.

Mayur Tendulkar

It’s All About Controls (Part 2)

Thanks for reading Part 1 of this multi-part blog post. If you’ve missed, in Part 1, we talked about what has been added (or converged with Windows) in Windows Phone 8.1 SDK. This part will mainly cover the changes that are included in this SDK. These are important changes and you must make a note of it to build stunning apps. Perhaps, later, there will be part 3, in which I’ll cover some 3rd party components, which can be used in Universal apps. Do let me know if you want to cover anything specific.

Panorama Is Now Hub

wp_ss_20140421_0003 wp_ss_20140421_00014

With Windows and Windows Phone convergence, Panorama control from Windows Phone is changed to Hub control. It is similar to Hub control available on Windows and gives effects like Panorama. It also, share the same XAML in both the platforms

image  

image


StatusBar (SystemTray) Changes

StatusBar or SystemTray is top-most component on page, which shows various details:

image

In Windows Phone 8 apps, you could show/hide system tray from XAML. For example:

image

Now, in 8.1 (WinRT) apps you’ll need to use code behind to do it. For example:

image


Flyouts, Flyouts Everywhere

Flyout is a new control in WP8.1 SDK. As MSDN says, use it to display lightweight UI. Also, unlike a dialog, a flyout can be lightly dismissed by clicking or tapping outside it. You can create a flyout by using following code. And actually add a flyout to any control which is a FrameworkElement.

1  

image


Command From Your Bar

With WP8.1, you do get your old AppBar.. but also get CommandBar. This command bar shares code with Windows. It also have Primary Commands and Secondary Commands. Which represents main buttons and menu on bottom app-bar in WP app. Whereas, on Windows, they have positions on app-bar as left and right.

image

image


Zoom – SemanticZoom

With WP8.1, LongListSelector is gone. However, it is replaced with SemanticZoom – in convergence with Windows. This control actually has two views which are shown in different way according to Zoom In/Out mode. It will be another topic for blog. But to put it into simple words: you’ll see a large list of photos in Grid. But when you *squeeze* it, you’ll see a list. OR vice a versa as you design your view.

image

With these controls, there are some more changes in controls are added. Like RichTextBLOCK (not Box), WebView (not Browser). But I would love to keep this post short.  

In next series (rather, I’m planning to change the name Smile), I’m going to talk about API changes in Windows Phone 8.1 SDK. Meanwhile, do let me know your feedback and if you want anything more covered here.

Happy Coding

Mayur Tendulkar

What’s Next For Phone Developer?

If you’re a Windows Phone Developer, by now you might have heard about OR rather, upgraded your phone to Windows Phone 8.1. Microsoft, recently released Windows Phone 8.1 (Codenamed Blue) for Developers. To get these bits on your device, you need to a registered Windows Phone developer and need to install Preview For Developers app on your phone. You can find more information here Once you upgrade the phone, you’ll find lots of resources online to get to know what’s new in Windows Phone 8.1.

Now, as a developer, you’ve the phone to test and build apps for. However, to build applications for this latest version of Windows Phone, you need Visual Studio 2013 Update 2 (currently in RC). You can get these bits from here

As a developer, first, you need to unlock your phone. If you remember, there used to be Phone Registration Tool, which gets installed when you install Windows Phone SDK. Now, this tool is integrated into Visual Studio and you can launch it from Tools menu

Untitled

When you connect your phone, you can easily developer unlock it to test your applications on it.

image

Similarly, you can use, App Deployment tool to deploy XAP (or now Appx) to Phone.

image

New addition to these tools is ‘Windows Phone Power Tools’. And these tools does lot of work for you, right from verifying the app, checking the performance and what not.

image

Even thought, this release is titled as Windows Phone 8.1, there are so many features that *I* will personally call it Windows Phone 9 Smile

To give you idea about what’s new in this platform and how you can develop apps for it, Microsoft is hosting online events. These are all free online events. So, register now and get the benefits from it.

Building Apps for Windows Phone 8.1 Jump Start (April 29- May 1)
//Learn – Global Community Webcast (April 24)

Happy Coding,

Mayur Tendulkar