Wednesday, October 19, 2011

App writing, Getting started

I’ve downloaded the free tools from Microsoft and Google for their respective sdk’s and worked on getting both running. I’ve given windows phone the most soak time, so I’ll start with that one.

In all, the toolset provided by visual studio is pretty impressive. I’m used to writing code in notepad and compiling from a command line, so things like intellisense are pretty handy. Good coding practice is to give variable names things that make sense, like “PointertoHandleExceptionsDuringRuntime.” I never liked names like that because they took so long to type, so I settled for variable names that were much shorter to type, like “bob and “noon”. I’ve written a great deal of bob++ in my day. Intellisense makes it possible to start typing a variable name, and it guesses what you’re writing and helps you complete it, so I only have to type as many letters as bob, and get a more descriptive name like the one mentioned above. See? I don’t even want to copy paste it, it’s so long!

There’s also a pretty fantastic set of videos I found on www.learnvisualstudio.net by Bob Tabor called Windows Phone 7 for absolute beginners. It uses the free tools, and is intended for people who don’t know how to program. I used to know how to program, so it’s a bit slow for me, but each video shows a trick with the tool that is handy to know, and I’m learning some of the nuances of C# and XAML, the code used to write WP7 apps.

Laying out the program took less than a day (it’s a very simple program). The content will likely take me a couple of months to write, I’m hoping to be able to format it in such a way that I can reuse it. The code…. well…. the code is getting there.

I found some sample code that does something similar to what I’m trying to achieve to use as a baseline and hack into what I want to accomplish. The code was written with the beta version of the SDK, so there are some things done that don’t work. That’s disappointing, but I was able to quickly find and correct those issues, and the sample program runs fine. My real gripe comes from the fact that lines of code that I’m taking from that program are not working in the new program.  Simple things that should work, like resource declarations.

At the beginning of a program, you declare what resources from the phone your program is going to need to run. One line, “using Microsoft.Xna.Framework;” works fine in the sample program, but not in mine! It boggles my mind that such a simple thing isn’t working. I suspect is has something to do with the original program template that I used, but it seems strange that you would be denied resources based solely on the template.  All that being said, I think I can overcome these hurdles.

Whenever I want to feel better about my progress on the WP7 app, I switch over to Android development.

It sucks.

Out of the box, fresh from installation, I tried to create a VM, and it refuses to launch. The error that pops up tells me to type something in a command window that does not exist. Google, while being a great search engine to find content, does little to add to that content through their own documentation of how to use their tools.

I’m sure I’m missing some subtle detail, but the difference so far is that with the microsoft tools I was able to get into writing the program before I started hitting snags and errors. With Android, I can’t even get into the tool!

No comments: