Tag Archives: .Net

VicinityBuzz Update: Windows Phone 8 & More

VicinityBuzz on Win Phone 8

While attending Codemash a few weeks ago, I ended up in a Windows Phone development precompiler (Codemash’s name for a training session). It was my plan to hit mostly mobile and analytics sessions, but I was not originally planning on attending this session. With Windows Phone still struggling for market share, I wasn’t in a rush to work with it. However, other sessions were cancelled because weather had delayed some presenters, so I ended up in this session. Microsoft’s Jeff Blankenburg was teaching the session, and I have enjoyed some of his presentations and a Silverlight fire-starter event in the past. It’s one of my rules of conferences to attend sessions based more on good speakers, rather than based solely on topic.

With regards to marketshare, Jeff made the point during the session that with a less crowded app store, you do have a bit more discoverability. Even if that doesn’t hold up, the platform shares enough similarity with Windows 8 that a port to the Windows Store will be trivial. The Windows App Store isn’t exactly setting the world on fire either, but I’d like to see my app on all of these platforms, and as Windows 8 adoption rises with new machine sales, that marketplace should see constant upticks.

Having worked with Silverlight in the past, I found it pretty easy to get going on Win Phone 8 development. There was some definite rust on my XAML skills, but it came back to me fairly quickly. One thing to keep in mind is that you want to keep things relatively simple on a mobile platform. I have worked on some WPF projects in enterprise settings with MVVM frameworks, dependency injection frameworks, and more. While I followed an MVVM pattern, I just rolled my own with a simple base class.

My project was to do a version of an app I already have in the iOS App Store, VicinityBuzz. It does location based searches of twitter. You can search around you, or by entering an address. The radius is a configurable setting. I like using the app at conferences like Codemash to catch all the chatter that may not have a hashtag. One catch is that obviously only tweets that included location will be found. If folks have that feature turned off in their twitter app, then it won’t show up.

Since I had written the app before (in phonegap for iOS), I knew the feature set and domain cold. The challenge was just getting up to speed with the latest API’s for search and geolocation, and then implementing within a new platform. One of the biggest benefits of this project was getting up to date with the latest Twitter API. I still need to update the version for iOS, as it’s currently non-functional because of api changes over the last several years. I plan on doing that very soon now that I know the latest version.

Anyway, I won’t go into the development details here too much, but I finished a version 1 of VicinityBuzz, and it is now in the windows phone store here, and it’s free. So go check it out. If you like it, I’d love to have some more reviews.

Also, if you are inspired to do any Windows Phone development yourself, you may be interested in a device to do some real testing. I recently found there are some prepaid phones new on Amazon that are dirt cheap for that purpose. Check out the Nokia Lumia 520 and Nokia Lumia 521 on Amazon.

Watch this blog for upcoming posts about working with the Twitter API, and some of the things I learned working with Windows Phone 8. And more mobile in general. I have the bug again…

Strange NuGet Error

One of the projects that I work on uses NuGet for library management. We have a rake task that runs build, clean, etc. One of the rake tasks runs NuGet.exe which is stored in a tools directory. That way, everyone uses the same version of NuGet even if they have different versions installed in their program files directory.

For some strange reason I was getting errors when running the rake task that updated the packages. Sometimes it was a generic error, sometimes “Archive file cannot be size 0”. I verified that the NuGet version hadn’t changed. I tested on other machines. I tried running the command by hand to take rake out of the equation. On one machine, it wouldn’t work. Every other machine fine.

I even wiped the folder and checked out again with git. No luck. Finally, I decide to look for a NuGet local cache and see if I had bad packages. Delete the contents of C:\Users\YourUsername\AppData\Local\NuGet\Cache\ and this problem will go away. Hopefully this info saves you some time.

Dealing With An ORA-01440 When Altering a Table in Oracle

When altering a table to an Oracle reduce a columns size, you’ll get a ORA-01440 error, indicating that you can’t make the adjustment because of the potential data loss.

I had to do this to recently to a bunch of columns, as I had incorrectly specified the size of numbers that would end up as integers in the application. Note that Oracle can treat any column as an integer by specifying a scale of 0. But for entity framework (via the Devart providers) to map to an long (Int64), you want the precision and scale to be Number(19,0).

Since the fields were left at the default size, they were too large. And being that many of these fields were a primary key or foreign key, constraints were also and issue. So the table had to be backed up, and restored. In order to safely do this, any triggers needed to be disabled.


Rather than do this repeatedly for many tables and risk missing something, or making typos, I created a script generator. You enter the table, and add any foreign key constraints, and then generate a script. All that is left to do is to add the columns to be re-sized to the alter statement in the middle of the script.

The script and generation code is all written in javascript, using jquery and jquery templates. If you’re interested in the code, I have it up on github.

Flex is a Relic and Silverlight is a Zombie

…or some other catchy metaphor that will grab your attention. These technologies were hot over the last 5 years. Flex gained a particular amount of popularity in the Java community where UI technologies have a bit of a spotty record (that’s like saying my Bengals have a bit of a spotty record over a lifetime). Silverlight gained a lot of traction among Microsoft developers who actually cared about design and UX. Many alpha-geeks of the Microsoft space were running around giving conference talks about the MVVM pattern, and sharing code on codeplex. So what happened?

Both of these technologies are going to fade on the public web. Tablets and mobile devices are too big a share to ignore. Html5, phones and tablets did them in. The heavy hand of Steve Jobs probably gets credit for the coup de grĂ¢ce. The browser vendors and phone OS creators have really put their weight behind Javascript and Html5. If you have have that skill-set right now you can create:

  • Web Content
  • Mobile Web Content
  • Mobile Apps via Appcelerator
  • Mobile Apps via PhoneGap
  • Windows 8 Metro Apps

That’s a pretty wide reach for a markup / scripting language set.

So what do you do if that’s your trade? You work as an AIR/Flex developer or Silverlight developer, what do you do? There are good options for each camp, and some universal options.

Flex Developers

I think this is the slightly less promising path in the long term (despite it hitting a much higher peak than Silverlight). That said, Flash and Air will live on for a while, and you have some time to make a transition. Additionally, the ability to use the Adobe tools to make mobile applications provides a bridge to the hot mobile market. And you can make long term plans to transition to another cross-platform tool (PhoneGap, Appcelerator, etc), or go native. If you’re in the Adobe camp, new tools like Edge are likely to ease the transition to the standards-based technologies of the web.

Silverlight Developers

Similarly, Silverlight won’t be gone tomorrow. Intranet applications that need rich functionality (and simple deployment) are still a nice fit for Silverlight Desktop applications. And the adjustment to WindowsPhone 7’s flavor of Silverlight is straightforward, though I would be cautious and investigate the financial realities of that market. Finally, while Windows 8 Metro Apps don’t specifically use Silverlight, they can use C# with XAML and a subset of the .Net libraries that emphasize a security sandbox and async data connections. Sound familiar? That’s because they re-animated the corpse of Silverlight and made it an option for writing Metro apps. Long term, you should probably learn to use the Html5 / JavaScript hooks for Metro due to the ubiquitous nature of those skills. But isn’t it nice that you can learn the new API (WinRT) while keeping C# and XAML, and then make the languages switch at your leisure.

For Everyone

Both camps should embrace these newer web technologies and the UI skills they picked up during their time with the respective technologies. Good user experience and design are rare skills in developers, and retraining the languages and tools should be the easy part. Keep your black turtlenecks and invest in the next tools rich applications. You already have a leg up.

New Questions the Build Conference Causes

Build answered a lot of questions for developers who wondered about the future of the Microsoft platform. WinRT is the new API for “Metro ” applications, which are streamlined enable both tablet and pc inputs. These applications can be built in .Net or native C++ using XAML, or in JavaScript with Html5. The traditional desktop interface is still available and it still runs all sorts of full .Net and Win32 applications.

But I’m left with a lot of new questions…

Silverlight is dead but not dead

Silverlight is alive on the desktop version of Windows 8. And it’s easily ported to Metro. But it seems like a big deal to me that the Metro version of IE won’t support Silverlight and Flash.

XNA is dead but not dead

XNA is not supported for Metro games. Given there is no XBox touch screen, maybe the point is that the input libraries could never be made compatible with Metro. Still, that seems like a big deal. C++/DirectX works on the desktop, on metro, and for the 360.

There is no legacy layer for ARM, but is there a Desktop mode

Will the desktop mode even run for ARM? It’s known x86 binaries won’t run on ARM, but will the desktop be recompiled for ARM? Because if not, then all the non-metro supported paradigms (Silverlight, XNA, WPF & more) can’t be recompiled to run on the ARM version. If you have an ARM tablet, you can’t use a flash site or silverlight site. Even if docked. The iPad has that restriction, but keep in mind the iPad was never marketed as a tablet / dock-able laptop like these new Windows 8 machines are. In other words, are desktop applications now “fat binaries”? Which leads too…

You can write Windows desktop applications in almost any language, what about Metro apps?

Did they also just close the door on people who write in Java, Python, Ruby etc? There are windows bindings or even portable UI toolkits (think GTK+) that run on Windows and enable a variety of developers of other languages to write Windows apps. Are they now only able to write desktop mode apps for consumers who have x86 based machines? Or will Microsoft help foster a community of bindings to WinRT for a variety of languages.

Speaking of, anyone notice that F# was not on that diagram as an option for metro apps? They didn’t say .Net, they said C# and VB.Net.

There was a lot of exciting news, and it’s generally a good direction. But they definitely shook up the developer community and didn’t answer everything. What do you think?