Windows 8 Store Application Development: AppBar WTF

I have a great idea for an app that I intend to submit to the Windows 8 store. I am a fairly proficient .NET developer, and I already have a nice little class library all ready to go, I just need a “Modern” UI. This shouldn’t be too hard, right?

I create my project, and start adding controls. I realize I will need that settings thing that pops up when you swipe up from the bottom of the screen. But it isn’t called “settings” – that is something different. Instead it is called the “AppBar”. Now given that I am using a tool called VISUAL Studio, the primary innovation being the ability to rapidly, visually design user interfaces, then write code for interaction. So I figure adding an AppBar should be as simple as adding a menubar was in windows forms, right?

Wrong. Dead Wrong.

An AppBar is like an iFrame. You can put whatever you want in it, and it is completely NON-obvious, and non-intuitive to do so in a meaningful fashion. The Microsoft Quick Start guide only tells you how to do it with some XAML code that they neglect to tell you where to place. Want to follow along? Here is the article: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh781232

 

Continue reading

There is no excuse for losing your place anymore

When Compact Disks were introduced as a replacement for audio cassettes, there really was no comparison. As opposed to the analog warmth and hearth-like crackle of vinyl, nobody really misses the hissy, tinny, low-fidelity of cassettes. Similarly, few people are nostalgic for having their movie eaten by a VCR, or listening to garbled audio from a VHS tape played too many times.

There is one thing they do miss, however. When you stopped an audio or VHS tape, you knew with complete certainty that when you hit play again, it would continue where you left off. Even if you ejected the tape, and put it in a different player a year later, your position is maintained as a physical property of the media.

Optical disks have no such property – they are stateless by nature. The burden of position must be maintained by the player itself.

Back to the release of CDs and DVDs. When they came out, memory was expensive, and non-volatile memory (aka flash) prohibitively so. To replicate the saved-place of tapes, devices would need to be able to identify the disc, and have an associated position. Not easy in the 90s, so it was excusable. And honestly, losing your place in an album of music is not the end of the world. But for audiobooks it was a different story. Audiobook cassettes persisted – and arguably remain more popular that CDs to this day. The reason – losing your place in an audiobook is a HUGE pain – the sort that you never want to experience twice.

We have been experiencing a similar technology shift in recent years – from the dominance of physical media to digital media – mp3s, video files, e-books, etc. These new formats are typically stored on flash memory, so any device that can play them can store information about them… But in so many cases they do not.

Audible (arguably the world’s biggest distributor of digital audiobooks) took years to realize they should permit for synchronization of position across devices – and the last time I used it it was still unreliable. If your app crashed, you would be back to where you had been hours ago.
Amazon’s Kindle apps similarly have no excuse for losing your place in a book, and yet from time to time they do. The superior GoodReader app very easily loses position information, and it isn’t clear how to prevent it.
The Windows 8 Video player app – (which on Windows RT is your only option) – loses your current place in a movie if you close the app. (Luckily, Apple had already figured this out and has been saving your place in movies on the ipad for years).

The fact that maintaining and persisting position information is so often neglected and poorly implemented is a little disturbing – it’s simple enough to implement, it is a small quantity of information, and its necessity is obvious. I’m sure Microsoft will get around to saving position info, but why didn’t they do it in the first place? There is no excuse anymore.

I consider the following items to be self evident, necessary, and painfully obvious. Further, their omission is a negligent as omitting the “next” button.

  • Any device or software that can play audiobooks must not ever under any circumstances lose the current position of playback, and any operation that might delete said position must explicitly inform the user to that effect.
  • Any device or software that can display eBooks must remember the last page displayed for each book; must protect this information and persist it through updates, crashes and reinstalls. Any operation that might delete this information must explicitly request permission to do so.
    Additionally, bookmarks must be very easy to create.
  • Devices or software intended for watching movies must remember where you left off for recently watched movies – through closes, ejections, reboots, crashes, etc.

HTC Windows Phone 8X is a mess on T-Mobile

I purchased the HTC HD7 shortly after it came out so I develop for a phone in a language I knew. Out the gate, the WP7 phone had Bluetooth issues, but these were largely fixed with the Mango update. So despite the big crack in the screen, I was happy with my Windows 7 Phone.

Two years later, and contract renewal time arrives – along with the release of the Windows Phone 8 platform. Time to upgrade! WP8 should be at least as good as WP7, right?

… Wrong.

At present T-Mobile has two Windows Phone 8 options – the HTC 8X, and the Nokia Lumia 810. The lumia wins hands-down in most categories – it includes navigation, has expandable storage, has a replaceable battery. But it is ugly, clunky, has a low resolution screen, and poor battery life.

So if you want a “nice” phone you are left with the HTC 8X – which is good enough for Gwen Stefani, so it should be pretty good, right?
Right?

Wrong. It is plagued by bugs and software ommisions, and HTC is dragging their feet to fix.

1. There is no turn-by-turn navigation.
Microsoft removed the turn-by-turn directions / navigation feature from bing maps, with the idea that nokia would pick up the slack. Despite reading that Nokia opened up Nokia Drive to all WP8 devices, this phone doesn’t have it. There is no navigation. There are no turn-by-turn directions. You can get directions in a list, but they are not suited to use while driving. I have been thrown back into the pre-GPS days, and it isn’t pleasant…
2. Internet Sharing is buggy
This may be T-Mobile specific, but for the first week after activating the phone, Internet Sharing didn’t work, claiming I had to “upsell” to a $15/month extra tethering plan. Not true – the $35/month 5-gig plan I have includes tethering. This phone likes to err on the side of “no soup for you,” and for whatever reason assumes you are not authorized to share your internet half the time. Real annoying, and a real step backwards = the HD7 never rejected me, even using a grandfathered 2-gig plan.
3. Bluetooth is a travesty of bugs and incompatibility.
It seem that HTC has real problems with Bluetooth on Windows phones. This thing cannot maintain a reliable handsfree connection for more than maybe 15 minutes before the sound cuts out. Everything appears to still be connected and working, but there is no sound. You’ll be talking, an all of a sudden – silence. You must disable the Bluetooth to resume your conversation.
The A2DP (music) profile doesn’t do this, but the phone locks up entirely for a good minute after the music connection is established. I don’t know what it’s doing, but after connecting for music in my car, there is silence for a minute, and the phone will not respond to input (although the windows button still causes haptic feedback). When it does finally unlock, it responds to all your keypresses in one batch, which is pretty annoying in is self (for example, if you held down the home button trying to wake it up and pressed the power button, when it does wake up you will be prompted for a voice command as well as a “slide down to turn off”) The Bluetooth is practically unusable in this state.
3a. While the Bluetooth technically “can” support serial and PAN, this is not supported by the OS as must be implemented on an app-by-app basis. Meaning no Toyota Entune (without significant effort my Toyota), no Bluetooth tethering. This is ridiculous. All developers shouldn’t have to implement portions of the Bluetooth stack, it should be is a shared library… oh wait, Windows phone apps cannot include or use shared libraries.
4. Custom Roms may be impossible (This applies to Windows RT as well). Microsoft was wise to require the use of a standardized boot method – the phones use a UEFI bootloader. That is awesome. What is not awesome: Microsoft requires SecureBoot be used to require roms be signed by Microsoft or the manufacturer, and does not provide the user the ability to import trusted keys. Windows phones (and rt devices) could have been the future of mobile computing – the ability to dual boot as easily as a PC – but greed and paranoia ruined it for everybody. Now we must hope that some hacker find an exploit to SecureBoot that will allow malicious software… in addition to the freedom to run what you want. Really stupid move from Microsoft.

Some of these issues can be resolved by HTC with firmware updates – and likely will in time. Others will require Microsoft to get off the pedestal of greed – and who knows when or if this will happen.

Till then, I may be stuck sharing my internet with an android device to accomplish what I need. Or I could jailbreak an iPhone to get what I need. How long till I tire of waiting… who knows.

The internets agree: Visual Studio 2012 is a usability disaster

billy-madison-e1300752649964
“Don’t put it out with your boots, Ted!”

 

Visual Studio is the fundamental tool used to create a good majority of the software for Microsoft’s operating systems, and has been for, well, a very long time. New releases tend to be inexorably linked to new language features or versions. Also typically, each new release has brought new features, and improvements to performance and usability.

With every new release of Visual Studio I have been party to, the upgrade was an improvement. .NET (aka 2003), 2005, 2008, 2010… I upgraded and never looked back (with the exception of the loss of VB6 perhaps… but it really did need to go).

Until Visual Studio 2012.

Maybe Microsoft thought forcing developers to develop in a low-fi tool would encourage good low-fi app design. Maybe they thought we needed a break from being productive. I don’t know.

They have removed WIDELY used features (setup projects anyone?), and dramatically uglified the interface. They have reduced the number of things that get code highlighting, and reduced the number of colors used to highlight. HOW COULD THAT POSSIBLY BE CONSIDERED A GOOD THING?

Go ahead, try searching Google for “Visual Studio 2012 looks”… here is what you will find:

image
(FYI: I’m pretty sure BING is filtering such suggestions – I just checked)

Top suggestions:
“Visual Studio 2012 looks horrible”
“Visual Studio 2012 looks like crap”

Top results?
“Visual Studio 2012 is ugly as hell” (Funny, because it’s a “deferred” Microsoft connect bug
Visual Studio 2012 is so ugly, I actually cried.

 

Does anybody know who is to blame for this? Given the pervasiveness of ugly in all of Microsoft 2012 products (seriously Microsoft, a touch-centric interface on a server operating system? What were you thinking?), you would think there must be somebody high up that deserves a flaming bad of poop…

Let’s just hope he (or she) takes it better than Sasquatch

“History Spam” driving me nuts

Lately I’ve noticed that the back button on my browser seems to not work. I hit back, and nothing happens. So I check the history, and see something like this:

image

A whole bunch of instances of http://view.atdmt.com/ URLs. I’m not sure what advertising company this it, but it is strange that it got me while using YouTube.

I did a quick search, and I’m not the only one bothered by this: http://boards.straightdope.com/sdmb/showthread.php?t=655982

It seriously needs to stop. Advertisers don’t want people blocking ads, but then they do crap like this. I for one have no problem with non-intrusive, relevant ads. I will never click on a popup, or pop-under ad (and I would suggest you do the same)

WinRT – A gift from the past…

Just came across this enlightening blog post while asking Google if Microsoft was going to abandon .NET : http://www.guardian.co.uk/technology/blog/2012/feb/17/winrt-windows-8-microsoft-programming

EDIT I found another developer blog with similar concerns: http://realworldsa.blogspot.com/2011/09/today-microsoft-killed-net-good-bye-wcf.html

I realize I’ve been complaining off and on – sometimes rather dramatically – that Microsoft is making some really terrible decisions of late. The aforementioned article helps at least give an explanation to one of those decisions:

WinRT was developed by the people who write drivers and kernels. Those people are undoubtedly C++ developers who do not consider the .NET dialects “real languages.” Which is really unfortunate, because C++ is about the worst language (short of assembly) for writing maintainable, reliable, testable, or portable code. The only upside is that if you are good at it and spend orders of magnitude more time coding, your code will be more efficient.

Windows 8 Metro apps are meant to work on both desktop and tablet PCs (even though they must be compiled separately for each platform…) Tablet PC will have seriously limited horsepower, and clock cycles equate directly to battery life. So… we go back to using C++, and impose limitations worse than PocketPC to all hardware platforms. (Bad news – C++ is only more efficient if you are good at it) (Also, HTML5/JavaScript is a really bad place to invest significant development effort when literally every new release of web browsers has resulted in breaking changes)

What should have happened is optimization of .NET for efficiency. Not pushing business application developers to become experts in memory management, pointers, references and clock cycles.

 

WinRT seems to be what the developers of Win32 wish they had done back in 1998, rather than a proper evolution of development technologies.

 

(By the way, I’ve said it before but I feel the need to mention again – Metro (aka “Windows Store” aka “Windows-8-UI”) apps can not and will never replace desktop apps. And desktop apps are not and will never be “legacy” despite some people throwing around the term. Certain parties at Microsoft would love to get a 30% cut of all developer profits, so phasing out desktop apps is certainly a bullet point in their PowerPoint, but reality will hopefully keep this at bay)

The stats now: Microsoft is alienating it’s largest user base by forcing a tablet interface onto a PC. They are alienating manufacturers by developing their own hardware and licensing portions of the OS to “chosen” companies. They are alienating mobile users and developers by essentially abandoning Windows Phone 7 and providing no upgrade path. And finally they are alienating the vast majority of developers with massive restrictions and profit cuts.

No Google AdSense for me (UPDATED: and it was my fault)

UPDATE 9/3/2012

After looking things over I found out why I got rejected, and why it happened so quickly: My About and Privacy policy were the default “This is a WordPress page, you can customize etc…” AdSense uses bots to perform an initial analysis of your site looking for “low hanging fruit”. Things like non-updated about pages are a big red flag. I updated my About page, as well as throwing in a standard privacy policy, and viola! I passed the automatic scan within minutes!

Moral of the story: Make sure you have fully configured your blog before applying to AdSense.

 

As an amateur tech blogger (with ADD), I believe my content should be as information-dense as possible. My posts are largely examples, code snippets, links and the occasional rant. If it takes paragraphs to explain, I’m doing it wrong.
Likewise, if I am posting about something that can be easily be found on Google already, I’m not going to waste the time. More on this in a minute…

Like most people with bills to pay (even more so people with spouses), it is always nice to be reimbursed for the things I spend time on. So I decided what the heck – I’ll throw some unobtrusive targeted ads on my page and see if I can’t get a couple bucks a year for my efforts.

I submit my application to Google AdSense, and come morning I have the following in my inbox:

Hello,

Thank you for your interest in Google AdSense. Unfortunately, after
reviewing your application, we’re unable to accept you into AdSense at
this time.

We did not approve your application for the reasons listed below.

Issues:

Insufficient content

———————

Further detail:

Insufficient content: To be considered for AdSense, your site must contain
enough text content for our specialists to review and for our crawlers to
identify relevant ads to show on your pages. We recommend including more
complete sentences and paragraphs on your site. We require websites to be
fully launched and functioning, allowing users to navigate throughout your
site with a menu, sitemap, or appropriate links. Once the majority of your
site is complete and functional, we’ll be happy to reconsider your
application.

———————

Insufficient content. While I’m not the most prolific blogger on the internet, I try to make sure my posts are original, and provide some nugget of information that was otherwise difficult to find. Said nuggets often (if not usually) do not require paragraphs of disposition. In some cases, complete sentences might not be required.

The purpose of this blog is to make the internet less fail. I will of course continue to do so without Google’s support, but it is a bit disappointing to be told my years of effort isn’t relevant.

The problem with Metro

I’ve been using Windows 8 as my primary OS since the Release Preview came out. I have been trying to like it. I’ve defended it to detractors. I might have even changed a couple people’s minds about it – point is I should be a best case scenario for accepting it. I even tried to like the “Metro” school of thought. Minimize the extra fluff, go “chromeless,” design first develop second, create immersive apps…

Reality is a harsh mistress.

 

The reader app was the first victim. Out of the box, Windows 8 has a PDF viewer that is a metro app. If you click a link to a pdf in a web page, BOOM! IMMERSIVE READER! (caps are appropriate – the Reader is jarring and obnoxious). Try as I might to like it, as soon as I actually wanted to get work done in any reasonable timeframe, I installed Adobe Reader so I could have multiple PDFs open at the same time, flip back and forth between the documentation and the application and easily work with text. Install non-metro app, productivity increases significantly.

The next casualty was the Photo Viewer. Believe it or not, I don’t always want to see a full-screen immersive viewer when I open a photo. If I am trying to quickly find the right screenshot in a folder containing a bunch of screenshots, the last thing I need is a big full screen viewer to cover my workspace… File association changed, problem solved.

How about the start screen – just a different way of looking at the Start Menu, right? Perhaps, if I could still shift-right-click to run as a different user (you don’t run your desktop OS with a domain admin account, right?); or if I could open multiple instances of an application (if you attempt to run notepad when notepad is already running, it just activates the existing window); or if I had a list of the most recent apps, or if I had jump lists, or if I could pin frequently used documents. The Start Screen is a poor replacement for the Start Menu. I ended up using Run more often than the start screen. Hello Windows XP… goodbye efficiency.

So I finally figured out how to fix all the productivity issues: switch back to Windows 7.

What it all boils down to is a matter of efficiency. For the “typical”, casual user Windows 8 should be great. For a Mac user, Windows 8 should be great. For your grandparents, Windows 8 should be great. For a tablet and a phone, Windows 8 should be great.

For a power user on a desktop PC, pretty much all Metro components of Windows 8 will slow you down even after you get used to them.

That is the problem with Metro

Getting a poorly designed ClickOnce application to Run As Administrator

(Updated 5/10/2012 – I originally claimed that it was “trivial” to make a ClickOnce app require elevation – a commenter pointed out that ClickOnce does not support the requireAdministrator execution level at all. This does not let the vendor off the hook – they should not have used ClickOnce to deploy software that requires features ClickOnce does not support… FYI – there are workarounds from the deployment side)

One of our vendors distributes a couple tools as ClickOnce applications, but these applications perform privileged tasks that do not work with UAC enabled. A ClickOnce application cannot be elevated, nor can it be specified that it requires elevation, so the only way this application would have ever passed testing is if UAC was disabled on the developers’ machines, or Visual Studio is run as administrator)

Rant: UAC has been around since Windows Vista was released in 2006. As of this writing, that would be 6 years. Windows 7 has been out for 3 years. As much as some people might dislike the extra dialogs, UAC is a very good thing, and should not be disabled. There is no excuse for applications that do not handle UAC correctly. Adding the appropriate application manifest is not difficult, and when using ClickOnce it is practically trivial (5/10/2012: Errata: ClickOnce Doesn’t support UAC – I was thinking about Full Trust) and if an application requires elevation it should be distributed standalone or with an MSI setup project.

Don’t use ClickOnce for applications that require elevation; Add the Application Manifest with a setup project to require elevation; or better yet modify your app to not require elevation at all, but do not just pretend it doesn’t exist. 6 years… come on!

Ok, now that my rant is out of the way, if you are in a similar situation – a ClickOnce app that needs elevation to run, but doesn’t request it is a real pain in the butt.

image

“Run as Administrator” is conspicuously missing from the context menu:
image

Continue reading

Microsoft hacks away at TechNet membership benefits (again)

TechNet Professional (formerly TechNet Plus) subscriptions are one of the best ideas to come from Redmond – allow IT Pros to pay a subscription, and evaluate pretty much all Microsoft software without time limits and expirations. Why is this such a good idea? Because Microsoft gets a significant portion of its revenue from business licensing, and making evaluation as easy as possible can only encourage adoption of new versions.

Last year, Microsoft silently dropped the number of licenses per application from 10 down to 5, arguing that for evaluation, there was no need for so many licenses. Perhaps, perhaps not. I create new VMs to evaluate software fairly regularly, and having 10 keys makes it much less likely to encounter activation issues.

But ok, we only get 5 – so we adjust.

Well, for some reason Microsoft has decided that they want to scale things back further – as seen on the subscription home page,


Beginning on January 26, 2012, individual subscribers to TechNet Professional Subscriptions may access a maximum allocation of 3 product keys for Microsoft Office and Windows Client products in connection with their subscription. The allotted keys may only be used for software evaluation purposes. Once the maximum keys have been activated no more keys will be made available. Additional product keys may be acquired through the purchase of an additional subscription.

Unfortunately, I just saw this today, so I’m doing like any reasonable person would and requesting all 5 keys for any Office or Windows related products before they drop it down again – until I hit the daily key request limit…

First of all, making software evaluation more difficult is only going to hurt Microsoft. But then again, Windows 8 doesn’t appear to be geared toward business AT ALL, so maybe it is indicative of a shift in strategy.
(It is odd that Windows 8 preview still isn’t on TechNet, nor is the System Center 2012 RC…)

If only TechNet members had the time to protest…