As many of you know, I use the C# programming language a lot for my Software Development work. With that being said, I often use some third party libraries in order to speed up development time and perhaps add some new features. However, the libraries I have listed here are used in every one of my C# projects. If your favorite C# Library is not listed. Please leave a link to it in the comments section so I can try it out. Let’s get started.
I specialize in making web and mobile applications and being able to parse and create JSON data is extremely important to me. Json.Net is a really useful tool for parsing and creating JSON data in your applications. It requires no setup, just add it to your project using Nuget and your now your ready to start working with JSON Data. I recommend that you spend some time reading the documentation so you know how to use the library effectively. Especially when dealing with nested elements in JSON Data. There is also a very active community around this framework in case you get stuck or get confused on the functionality. I cant recommend this library enough.
If you haven’t noticed, I haven’t been blogging much lately. The main reason for this is because I was tired of running my blog on a slow cloud provider. Up until this past Friday, I migrated my blog to Digital Ocean from Microsoft Azure. The migration process was super simple and only took about an hour, to get things transferred to my new provider. Before the migration, I was consistently having performance issues with WordPress on Azure. For example, it took forever to publish a simple post, the page would consistently load for a while before I could start writing. Another issue was that updating plugins or other components of my website would cause WordPress to get stuck in Maintenance Mode. The only easy way to get everything working again was to use an FTP client and remove a certain file from the directory structure of my website. However, the main driver for the migration was the price per month to keep a relatively small site like this up all the time. The price was about $200 a month alone. Keep in mind, I also have various servers for the backends for various applications on Azure. After a while, keeping all this up was getting very expensive. I even asked Microsoft what my options were to improve performance and help on how to reduce my price. They had a few good suggestions, which I implemented but it still seemed slow. I had the option to upgrade the server running my blog to something more powerful. The recommended option was out of my price range.
If you have been reading my blog for the last couple weeks, you might have noticed that I have been using Xamarin to develop two mobile applications. When I wrote my initial impressions, I ran into multiple issues with getting the Android SDK to work and I also didn’t know how to use Xamarin Forms, and how to use the build in layouts, such as a StackLayout. Fast Forward a couple of weeks later, I got used to working with Android, working with the layout system and other features. In fact, I originally wrote a quick tutorial on how to use the ListView Control.
As many of you know, I’ve been contracted to create two mobile applications for some local small businesses. One common requirement for both of these applications is that the final product needs to be available on the iOS App Store and the Google Play Store. With this in mind, I figured I would try using Xamarin to create these apps. As I started working on these apps, I documented most of the initial thoughts via an older post on my blog. Since then most my problems have been resolved. However, I did notice it was hard to find good resources on how to build things using Xamarin Forms. I was able to find some old resources via some searches on YouTube, but I was not satisfied with the quality of the content. With this in mind. I wanted to take this opportunity to share what I have learned so far. Like my other Swift tutorials, we are going to start out small and work our way up. Let’s get started!
The ListView is a pretty common control in cross-platform mobile development. In Xamarin Forms, a ListView gets rendered out as a UITableView on iOS and a ListView in Android. You can create a ListView programmatically or you can use XAML. Once you have created your ListView you can access it in your code via its name property. Next, you have to assign an ItemSource to your ListView. In my case, I used a Generic List from the System.Collections.Generic Namespace. From there you populate your list with whatever data is going to be presented to the user. When your List is configured, set your List Object as the ItemSource property of your ListView. If you followed along with this post your app should compile fine and a ListView should show up on your device. If you encountered an error, check your code for errors as needed. Full code samples below. Happy Coding.
Recently, I wrote a blog post called The Gear I Use To Get Things Done. In that post, I outlined all of the computers and other gear I use to get my work done. Out of the list of products listed was a 2015 13″ MacBook Pro with Retina Display. It was a great computer for the time and it served me very well, until two weeks ago. During this time, I was browsing my Twitter Feed and saw numerous posts about discounts on the 2017 and 2016 MacBook Pro 15″ with Touch Bar at B & H Photo. Since I was in the market anyway for a more powerful laptop, I decided to check it out. However, the specs of the machines that had the discount were not going to be enough for my workload. With this in mind, I would look out for a good deal until Apple decides to update the MacBook Pro for 2018.
Before we begin, if you have not read my post called When Software Projects Go Wrong. Please take the time to read it now because it provides some context for some things I’m going to talk about here.
Over the last couple of weeks, I have made great progress on two apps that I’m writing. Working on these two projects every week has been a personal goal of mine since I started this blog, and I’m excited to see what the future holds. However, this progress means that the development process starts to slow down and the testing phase begins. This past weekend, I spent most of my time getting ready to move my apps into testing mode. During this time, I developed some tips in order to help newer developers get ready for testing.
If you follow me on social media, you might have noticed that I haven’t been promoting my content as much as I use to. The reason for this is because I recently got a project at work with an unrealistic deadline. In normal circumstances, I love these kinds of projects because I get to show off my software development skills and to prove that I’m just as good as my coworkers. However, this time was different.
If you have been following my blog since my first post, you may notice that I have made some substantial improvements to my site to help bring a better experience to my followers and new visitors. While I could make a blog post dedicated to explaining why I made these changes, I figured it would be boring, and perhaps the information would become out dated as time went on. However, I will write about some of the changes I made that you can implement on your blog or website right now.
If your reading this, then you stumbled on to my next post since writing my introductory post on New Years Day. If you have not read that yet, I strongly suggest you do that to learn more about why I’m blogging. Anyway, today’s post is all about some recent findings I discovered during the development process of the ParkLane iOS app. My use case is pretty simple and common for the platform. I have a login and sign up ViewControllers inside my app where the user can fill out some fields to create an account in our database or login into a existing one. However, I needed some kind of alert to pop up on the screen to tell a user if one of the following errors occurred:
Wrong Email
Wrong Password
Wrong Email and Password
As you can tell this presents a problem. I know Apple has something to solve this called a UIAlertView. Its pretty simple to use, it looks like this: let button2Alert: UIAlertView = UIAlertView(title: "Title", message: "message", delegate: self, cancelButtonTitle: "Ok", otherButtonTitles: nil)
// show alert on screen button2Alert.show()
I wasn’t worried to use this code because I’ve used it before, However Xcode presented me with this warning:
UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead
This left me puzzled, after doing some research this change occurred around the release of iOS 8 in 2014. After thinking about it some more, It must have been a change that I simply missed, and I take the blame for it. In a request to redeem myself I took out the old UIAlert code and replaced it with the newer UIAlertController.
After trying this new API, I have to say I like this better than the old UIAlertView. The newer framework seems like more work, but your getting more control over your alerts. Here is a quick code example to show you the difference.
If your familiar with how iOS views work the this seems pretty straight forward. I bet developers that don’t understand iOS or Swift can figure out what this code does. I also enjoy that the addAction method has a completion handler in order to execute some custom code when you tap a button on the alert.
Before I go, I realize that this first iOS post was pretty simple but do not worry. I have plenty of content coming up on more advance topics. So keep following my blog and be sure to follow me on Twitter to be alerted when new content is posted.