Azure

Getting Azure Function Connection Strings from Configurations

Getting Started Azure functions are very practical and unexpensive. You can have your own serverless function in a matter of minutes, check them out if you haven’t yet. Getting in context Today I was running into an issue working with an Azure Function. The AZF had to connect to an SQL server database. To handle connection strings the best practice is to parametrize them using config files for local development and using the configuration tab in azure once published. You should be able to access the value by calling the System.Environment.GetEnvironmentVariable method, passing the key you want to get. But, for some reason, I wasn’t able to get the connection string from the settings. It worked in my machine but it didn’t work on azure. The Solution I did some

Read More »
.Net Core

Handling Excel Files with NPOI

NPOI is a library for working with Office documents like Word and Excel. I mainly been using it for reading and writing Excel files so that’s what I’m going to write about. It works with .csv and .xlsx formats and is based on the Apache POI project for Java. It works for .net core and you can check their repo here https://github.com/dotnetcore/NPOI To use it you have to include the Nuget package DotNetCore.NPOI The NPOI package defines a few interfaces and classes that you will find very familiar if you have ever worked on a spreadsheet. There are the IWorkbook, ISheet and IRow interfaces that respectively represent Workbooks, Sheets and Rows of the document. To create a spreadsheet you need to instantiate a Workbook (XSSFWorkbook), you can then add Sheets

Read More »
Xamarin

Getting the user signature

This is a common feature requested for many applications in the corporate world or if you are working on some sort of payment processing application or a delivery app. You may need the user signature to confirm they have received a package, an order has been delivered or many other scenarios. With the SignaturePad Xamarin forms control you can get the user signature in no time for both Android, UWP and iOS. Getting it to work Include the Nuget package: Xamarin.Controls.SignaturePad.Forms to all target projects. Add the control to your page: And now the control is ready for use Notice how In the example gist I’m making sure to set the Safe areas for iOS, otherwise the you could get some overlaps like in the image bellow Advanced features The

Read More »
App Center

Crashing like a pro with App Center

Accept your fate Face it, your app is going to crash at some point. No matter how well you test it or how great the QA team is nor the 100% code coverage or how extensive the device suite for testing you have. There are always going to be edge cases you cannot predict and your app is going to crash at some point. Once you accept this fact your job becomes a lot less stressful as you realize your duty from now on is making sure that, when it happens, you get the most context possible, in order to be able to start fixing the problems as they appear and not after getting an angry email from a final user. Picture this scenario You and your team have been

Read More »
Xamarin

Prettying things up with Styles

Using styles you can define a consistent UI for your app and is a great way to make your XAML files more readable and maintainable in the long term. Some neat characteristics of styles: They are very easy to define. Can be inherited to minimize code reuse. Can be defined in XAML or in C#. You can implement multiple Style Classes so the same control without the need for inheritance. To define a Style you need to add it as a Resource. You can define them inside specific Pages or within Application class. Here is an example: Let’s focus on this part: See how we add the Styles definitions inside the ContentPage’s Resource Dictionary, we can do this too at an application level. The Style definition cannot be more explicit,

Read More »
Xamarin

Checking the new Checkbox in Xamarin.Forms 4.1 and overviewing InputKit control

Pun very much intended… With the release of Xamarin.Forms 4.1 arrives a new Checkbox control. Here is what it looks like: Here are the two ways to instantiate it in XAML and C# The Checkbox has a bindable property for the checked status (IsChecked) and you can handle the CheckedChanged event too. A little thing The control has a rounded shape on iOS if you want it to have a square shape you can use the Visual API. For now, the CheckBox control doesn’t include a Text property and it doesn’t render a Label next to it, to achieve this you would need to explicitly include a Label control and align it next to it. The result looks like this: Other options If you’re working on a legacy project or,

Read More »
About me
About me

Software developer and tech enthusiast who loves baking 👨🏽‍🍳. Currently working at Megsoft Consulting, Inc. and helping out at Streamelopers