#Pebble smartwatch review

I got some money for my birthday, so I decided to spend it on something frivolous. I bought myself a first generation Pebble smartwatch. I wanted to get the first gen instead of the recently released Pebble Time because I thought it would be the best way to see if I’d even use a smartwatch before investing that much money in it.

I ordered the watch last Monday. It got here a day early on Thursday. By nightfall Thursday, I had already created my first app for it – a daily Bible verse reader. After a few releases, the daily verse reader could get a daily verse as well as a random verse.

The source code to the daily verse Pebble app is on GitHub.

This weekend, I developed my first C language app for the watch. It is a moon phase app that shows the current phase of the moon. It uses location awareness to determine what hemisphere the watch is in so it can show the correct perspective of the moon (Northern and Southern hemispheres have the same phases, but they are “upside down” from one another as viewed from Earth).

moon_screenshot2

 

As a watch, it is a great device. It has many watch faces available. It’s fun to try new faces. I’ve landed on two that I use the most – the Modern watch face and a Star Trek style watch face. They both show the current temperature along with the time.

One of the best features is the music control. I can be listening to my music and change songs and pause from the watch. It’s also cool when I get a call while I have my headphones on. All I have to do is hit the “answer call” button on the watch and start talking without pulling my phone out to see who it is and answer it. It shows who is calling on the watch.

I’ve also downloaded a great game called Jump! Chump! and a fitness/sleep tracker called Misfit. I’m getting a lot of use out of it. So far, the battery has lasted me a few days. I didn’t charge it all the way when I first got the watch, so I had to charge it today. I fully charged it, so I’ll get a better idea for how long the battery lasts. I’ve been using it a lot to test my apps as I make new releases, so I’m not sure if I’ve got regular usage patterns or not.

I’m definitely getting a benefit from the watch and I look forward to saving up for the new Pebble Time. I won’t be getting the more expensive Steel option, but I will get the basic Pebble Time in a few months. It has a new timeline feature that I think will be cool.

I was thinking of adding the moonrise and moonset times to the timeline, but I’m having trouble locating the proper formulas for calculating the values. I have everything I need, time, date, latitude, and longitude. It’s just a matter of finding (or writing) the code I need. The precision I’ve got on lat and long are to the nearest integer value as I am still learning how to convert a byte array to a double in C.

That has been the biggest challenge for me in all this. I don’t know the C programming language. I have been using “C like” languages for many years like Java, JavaScript, and C#, but I have never had to deal with manual garbage collection and pointers before.

I took an intro to C class in college back in 1992, but that was an intro, and it’s been a long time.

So, I’ve put Swift aside for now as I learn C. This will benefit me in that it is similar enough to Objective-C so that I can develop in ObjC, then switch to Swift in the future.

I’m having a blast writing watch apps. It’s a lot of fun.

I probably won’t get an Apple watch as the Pebble seems to be providing everything I need. I just hope Apple doesn’t cut Pebble off by not approving their app in the Apple app store. That would be a terrible move on their part.

Beginning to learn #Swift

As a professional .NET developer (C# these days), I have been anxious to try something new. Since I got my Mac, I can now run XCode and program in Swift, something I’ve been wanting to try.

I’ve noticed that most of the Swift samples online are sans-semicolon, I’m not sure how I feel about that. :) I think the biggest adjustment I’m going to have is letter casing on variables and methods. Also, the difference in how Swift defines interfaces. If I’m not mistaken, they’re called prototypes in Swift.

The language looks nice. I’m hoping I can find it as enjoyable as C#. I’m guessing I’ll be looking through C# glasses to solve my problems. It’s going to be a challenge to forget the things that don’t serve me in Swift and remember the things that do.

I’ve got a few ideas for apps that I can make. One of them requires that I get a patent license from a patent that was granted in 1994 and hasn’t been used since 2000 (I don’t think). There’s an app on the app store that’s using the idea, but I don’t think they have legal permission.

I’m not one of those people that thinks I’m going to be an overnight millionaire because I have a killer app idea. I’m just the opposite, I think my app development is going to cost me $99 a year just to stay current with the Apple developer program. Hopefully, I can get it to pay for itself, but I doubt it.

Will I develop for Android? I don’t know. Probably not. Mostly because I’m going to be writing apps that integrate with the Health data on iPhone and also integrate with iCloud for storage. I’m sure there are Google equivalents (I could also use the Microsoft Azure toolkits on both platforms, but something tells me iPhone users will want to stick with Apple and Android users will want to stick with Google).

I suppose I could also subscribe to the Xamarin toolkit and write my apps for either platform using C#, a language that I already know. However, I think I would serve my future career better by learning Swift outright.

I personally believe that Apple is going to continue to lead in the mobile space. When I was an Android user, I was constantly frustrated by the fragmentation of the Android devices. Sure, there are now multiple screen sizes for both the iPhone and the iPad as well as different resolutions, but the Android fragmentation was really a hassle when I was developing apps for the tablet at my last job. Hopefully, developing for iDevices won’t be as bad.

I know that Android and Apple are constantly trading places as the #1 mobile platform, but I still think I’ll stick with Apple for now.

Swift is my personal development hobby now. I haven’t learned a new programming language since I switched from Visual Basic 6 to C# and VB.NET. I’m long overdue for something. I briefly glanced at Python and learned the basics, but never programmed anything of substance with it.

This should be fun.

#Mac vs. #PC – Which is better?

After having a Mac for a few weeks, I have learned some things about using computers. I’ve always been a PC person since I got my first IBM PS-1 when I was a teenager. I was so eager to get it, that I used a strategy that I’m not very proud of today (I’ve repaid that Karma many times over through the years, I’m sure). Anyway, I bought a used iMac a few weeks ago for $250. It’s a Dual-Core processor with 3GB RAM in it, so it doesn’t really compare to my PC, which is a quad core with 8GB RAM and an upgraded Video card. However, I think I can make a decent comparison about the general usability of the two.

First, I love OS X Yosemite. It blends nicely into my household where my wife uses an iPad and a Macbook Air. We both have iPhone 6 Pluses, so we get the added integration benefits of the new OS.

But, when it comes to gaming, nothing compares to my PC. I tried to install my Elder Scrolls online on my Mac, but it just wouldn’t install. I don’t think I meet the minimum requirements, so I’m not surprised. For music, the Mac seems to be doing a superb job. Everything works as it should with Reason. The only problem is that I was thinking of buying FL Studio to do music with. It only runs on the PC (there’s a BETA version that runs on Mac, but it’s hidden deep in their website and it won’t run on Yosemite).

Using the Mac is a wonderful experience. OS X has a great UI and I like the way everything just works. But, to be fair, I can say the same thing about Windows 8.1. It also “just works”. Aside from the “metro” UI, I use all of its features and it’s a joy to use. I can’t wait for Windows 10 as I’m sure they will improve on it.

So, from an OS perspective, both OS X and Windows have the same features, they’re just accessed a little differently. My Mac integrates with my Apple devices in the house (AirPort Time Capsule, Macbook Air, iPad, and iPhones). My Windows computer and OS X both interact well with my Wireless HP Printer. I haven’t had any trouble using it on either OS. It was a little more of a hassle to install it on Windows just for printing, but to get scanning and the other features of it working on OS X, I had to run the HP installer just like I did on Windows, so in the end, it was equally involved on both OSes.

I like that I can pull up an app on my phone and see where my devices are in the world. Since Laurie and I are part of the same family account, I can see where her phone and iPad are as well as where my Mac is (I hope it doesn’t start moving). The iCloud integration with photos is nice as I like the privacy policy from Apple a whole lot better than the one from Google. While Google’s cloud photo storage is “free”, Apple’s is costing me $3.99/month. It’s worth every penny to know my photos aren’t being examined and used for commercial purposes (or some other “non-evil” Google purpose).

Also, we cancelled our monthly $9.99 Office 365 account. We just weren’t using Office enough to justify the expense. I probably will go with either buying Office outright when the new version comes out or go with Scrivener and the Apple office products (I changed my mind :) )

So, the only future I see where I’m down to one computer is when I invest in a high-end iMac with good graphics card that I can dual boot into Windows 10 and play all my games and run all my music software on one computer (regardless of OS).

For now, I’ll stick with my PC and Mac running side-by-side, each doing what it does best.

More #Mac Upgrades

AppleLogo

The Mac didn’t stay in the closet very long (happy early birthday to me ;)). I took it out last night to upgrade the hard drive. I had a 1TB hard drive and a 250GB hard drive in my PC. I decided to move the 1TB to the Mac.

I upgraded the Mac from 250GB to 1TB. It took me about 20 minutes to do the upgrade. It wasn’t hard, but it was involved. I watched about three different videos on YouTube to see how it was done. I had all the tools except for the suction cup. I picked one up at Home Depot on my way home from work yesterday.

I went to the Apple store this afternoon and picked up a mini-DVI to HDMI adapter so I could use my PC monitor as a second display. It works perfectly. I now have a dual display for the Mac and the PC is still hooked up to the monitor via DVI. The monitor has the ability to switch between inputs, so I didn’t have to get a KVM switch. I also grabbed an SD card reader so I could import pictures from our digital camera.

After installing the new hard drive, I started up Boot Camp assistant and installed a Windows 7 partition. I split it evenly between OS X and Windows, so each has about 500GB of disk space.

I now have a great setup running Mac OS X Yosemite and Windows 7 on a dual monitor setup. I’m pretty happy with the results.

First #Mac added to my desk

Tuesday, I was browsing Craigslist and came across a great deal on an iMac. It’s from 2008, but the specs are modest. It’s a year newer than my PC, so I thought it would be a good way for me to finally get my hands on a Mac.

AppleLogo

I’ve been wanting to own an iMac for a long time. However, since the price was so high, I haven’t yet put the money into it. With this new discovery, I was able to get a used iMac in good shape (with the memory expanded from 1GB to 3GB).

Even though the computer was listed on Craigslist, it turns out that it belonged to our church. They were using it in the print shop. They recently got a new printer with a built-in controller and didn’t need this one any more. I was able to pick it up for $250. I was going to try to haggle, but when I learned it was the church’s computer, I decided to pay full asking price as a way to give something extra to the church. I’m pretty sure it doesn’t count toward my tithe, but I felt it was the right thing to do. :)

When I got home, I immediately installed OS X Yosemite on it. It originally had OS X Lion, but I wanted to go modern and get all the new features of Yosemite. After installing the new OS, I transferred all of my music off of my backup drive to iTunes.

I ran into trouble with two pieces of software. The first was Microsoft Office. I was able to download it from the Office365 website, but when I went to run it for the first time, the authorization program displayed server errors. I was never able to get it running.

The other problem I ran into was that the version of Propellerhead Reason that I have (version 4) is not supported on OS X Yosemite. There are work arounds that I’ll have to try later.

Update: 6/6/15 – I was able to get Reason 4 working by installing Reason 8 demo, running it, renaming the folder in Applications from “Reason 8″ to “Reason”, then installing Reason 4 over it.

The worst part about all of this is that this is my birthday present, so I had to pack it all up and put it in the closet for three weeks. I’ll get to “open” it on my birthday.

After using the Mac for a few hours, I am a firm believer in the quality of the Apple hardware and software. I recently had to reinstall Windows 8.1 on my computer because of strange behavior after installing the .NET runtime. To be fair, I did install a pre-release version of Visual Studio 2015 on it, so that’s probably what did it. However, I’ve had too many problems with Windows in the past. I realize that I’ll have issues with Mac, as well, but I like the way OS X works.

I’m still keeping my PC to use for games, so I’m not totally switching. However, Laurie’s not too pleased with the idea of having a computer on the floor by the desk and a computer with an integrated monitor and another monitor on the desk. I think she’d rather I just pare it down to a single iMac on the desk with a wireless keyboard and mouse. Minimalism is her goal, I think. Right now, it’s a rat’s nest of computer cords because of power cords, computer speaker cords, and external drives.

Still, I think I’d like to at least have the extra monitor for the iMac.

Even though I just bought this computer, I think I’m going to start saving up for a new computer next year. I’d like to get the 27″ iMac with a better video card in it and 16GB RAM. I might even go for 32GB RAM if the price has dropped by then.

Now I’m starting to feel guilty for my blatant consumerism. More e-waste for the environment, etc. At least I’m not in the market for a new Apple Watch.

It’s like a disease. The more Apple devices and software I get, the more I want. I can totally understand the addiction now. When I went to set up my printer last night, I fully expected that it would involve me navigating to the HP website, putting in the model number of my printer on their support page, and downloading the Mac driver. Then, I expected that I’d have to figure out what the IP address was on the printer and go through all of the hassles that I have to when I do it on Windows. Nope. I just searched for “printer” and the printers panel came up. I pressed the “+” button and my printer was listed in the available printers. I chose it from the list and added it. Done. This is because I’m using an Apple Airport Time Capsule as my WiFi router and it already knew about the printer on the network. It exposed it as an AirPrint device and my Mac recognized it. I was so shocked at how easy it was that I just had to print something to make sure it was really hooked up. So I printed a web page. It worked. Also, when I pulled up the Time Machine backup program, it immediately recognized my Time Capsule and I was quickly able to get the computer backup up. I only had to wait for it to transmit the backup across WiFi to the Time Capsule. It was very easy. This is why I want to switch to using a Mac.

WindowsLogo

Windows can be such a PITA. I’m getting too old to deal with that micromanagement. When I was younger, I enjoyed the challenges that PCs gave me. I liked switching jumpers on sound cards and modems to get them to work together in the computer. I enjoyed altering my CONFIG.SYS and AUTOEXEC.BAT for maximum EMM386 settings. I enjoyed the challenges of installing a fresh copy of the OEM version of Windows Media Center. Not anymore. Now, I just want to come home, spend a few hours playing my game, creating music, and watching videos on YouTube. I don’t want to repave my machine every three months because I wanted to try the latest Microsoft framework.

Of course, I’m probably going to install the latest release of Visual Studio Code and run ASP.NET vNext on my Mac, but hopefully that won’t crash my system. If it does, then I might completely swear off Microsoft software at home.

I rely on Microsoft ecosystem to make a living. I spend my day on a Windows 7 machine using Microsoft Outlook to do my email, Microsoft Office to create documentation, and Microsoft Visual Studio to write source code that runs on a Microsoft web server. So I can’t get too cocky about this. However, I don’t see anything wrong with switching my home systems to use the reliable choice. Windows 10 may be the solution, but I think it’s a little too late to the game for me. I realize that there are ferociously loyal Microsoft fans that will see me as a loser, but I don’t care. I’ve seen the other side and it’s beautiful. :)

 

Decorating an enum with the Description attribute for later use #csharp #dotnet

I had the need today to set a string value based on the value of an enum. Rather than creating the following code:

string myString = null;

switch(myEnum)
{
    case myEnum.Value1:
        myString = "value 1";
        break;
    case myEnum.Value2:
        myString = "value 2";
        break;
    case myEnum.Value3:
        myString = "value 3";
        break;
}

I wanted to do something simpler. So, I decided to add the System.ComponentModel.Description attribute to my enum, like so:

using System.ComponentModel;

public enum MyEnum
{
    [Description("value 1")]
    Value1,
    [Description("value 2")]
    Value2,
    [Description("value 3")]
    Value3
}

Then, to make it easy to use, I added an extension method to my enumerator:

public static string GetDescription(this MyEnum enumValue)
{
    Array Values = System.Enum.GetValues(typeof(MyEnum));
    string description = null;

    foreach(int val in Values)
    {
        if(val == (int)enumValue)
        {
            var type = typeof(MyEnum);
            var memInfo = type.GetMember(Enum.GetName(typeof(MyEnum), val));
            var attributes = memInfo[0].GetCustomAttributes(typeof(DescriptionAttribute), false);
            description = ((DescriptionAttribute)attributes[0]).Description;
            break;
        }
    }

    return description;
}

This will allow you to easily get the description of the current enum value. Here is how you would do that:

string description = null;
MyEnum testEnum = MyEnum.Value2;
description = testEnum.GetDescription();
// description will be "value 2"

As you can see, it’s pretty easy to decorate your enum values with string descriptions. This allows you a central location to set the value.

I can even see a custom description attribute class that retrieves the description from a database. The use cases are there.

Upgrading #ASPNET #Identity in #NuGet

This morning, when I went to upgrade the Identity system in my MVC application from NuGet, I ran into issues. When I ran the application that attempted to access roles, I got an error that the model backing the dbContext had changed and that I needed to run a code first migration.

I have very little experience with code-first EntityFramework as I have always used database-first. I just find it easier to set up my database with all the foreign keys and then create my data model from that. I haven’t yet learned the benefits of code-first.

So, to continue, I found the following two resources on the web that pointed me in the right direction:

Upgrading from EntityFramework Identity 1.0 to 2.0

and

Automatic Code-First Migrations

Within those articles, I found the following package manager console commands that helped me:

Enable-Migrations –EnableAutomaticMigrations
Add-Migration Nuget-Update-ASPNet-Identity

Since I had two contexts, it gave me a message that I needed to choose one or the other and even told me the exact command to use to do it. I just copied and pasted the command in the console and ran it.

Once I told it which context was my identity context, I then had to update the database. That was simple enough as all I had to do was use the following command:

Update-Database

That updated the identity database and allowed me to run my application again.

Now, whenever the identity system changes, I can easily update the data model. Though, I’m not quite sure what to do in situations where the changes are destructive (I could lose data). I need to learn more about this.