Friday, January 22, 2010

Android Development

I'm a geek, and I enjoy programming. In fact, I enjoy it so much that despite doing it all day, I will often come home and actually do it more in the evening for the sheer enjoyment of it.

This is most noticeable in my Codeplex project: eComic.

That's something that I wrote and maintain and update fundamentally for the sheer enjoyment of it.

Likewise, every time I get a new toy, I want to expand its capabilities, and make it do more. Since I'm about to get a new toy, I decided to preemptively set up my ability to play upon it.

In other words, since I'm getting a DROID, I decided to set up my home PC to allow ANDROID development.

Now, not to sound egotistical or anything, but I'm a smart guy; I work with computers day in and day out, and in fact it is my primary job description to make computers jump through the hoops I (or my customers) want them to. It's what I do.

Which is why setting up that Android DEV environment saddens me so much.

First off, the recommended environment includes the following elements:

  • Eclipse IDE
  • Android SDK
  • Android ADT
Now, that's not the bad thing, the bad thing is getting all those parts working together in a cohesive hole which allows you to actually create programs for the device you're aiming for.

Microsoft gets a lot of bad rep by geeks. It's big, it's massive, but despite all of the negativity from my peers, I LIKE Microsoft tools--especially the development ones.

When I went to install Microsoft's IDE on my machine, I downloaded the ISO, loaded it up, and ran the SETUP.EXE file and followed the prompts, making relevant changes as needed/desired to customize my environment.

Fundamentally, it worked. No hassles. No headaches, just thirty minutes of watching progress bars and then I was kicking and coding.

Sadly, the Eclipse/Android SDK install was anything but that easy.

Worse, because there was no installer (and consequently, the application was never identified to Windows) the whole thing flags UAC every time I launch it.

But, I get the Eclipse IDE downloaded, and shortcuts added to my DOCK tool, and then I have to install the SDK.

Which is a much Vista-Friendlier experience than installing the Eclipse IDE.

Then I run into integrating the two. This involves telling the Eclipse IDE where it can download the Android ADT package, and then allowing it access.

Now, I make this sound easy in this post. The thing is, it took me two tries to get it working. My first try was two weeks ago, and after three hours of trying to get everything installed, I gave up. Last night, I was successful, only because I followed the instructions in this article. Which despite being out-of-date, was much more informative and detailed than anything available on Google's Android Developer's website.

Now maybe I'm lazy, and just haven't utilized enough of those "free" IDEs to realize the "proper" way to go about utilizing the things. Maybe having Visual Studio's installation be hassle free has made me dumber.

Yet, in the end I think I'd rather be stupid that fight through setting up that Android Dev environment again...

Friday, January 8, 2010

Another New Version of eComic

Well, I've finally gotten off my lazy backside and implemented a new version of eComic.  It's been up for less than 6 hours and it has already been downloaded 6 times.  Not bad for such a specialized application.

eComicOf course the primary reason I work on eComic is to ensure that my skills stay nifty and sharp, as well as a place to learn new tricks and technologies for my particular field. 

Which is why that as soon as I get both the SDK and my new phone I'll try working on an ANDROID version of eComic.

But that's neither here nor there. If you compare this to the previous version you'll notice a few things, including that the navigation box is once again on the side. I felt that it just consumed too much of the reader's screen real estate at the bottom, especially with the thought that wide-screen monitors are becoming more prevalent.

Secondly, if you look to the left side of things, then you'll see that there's a ZOOM control. In addition to the slider that will allow precise (in a manner of speaking) control of the zoom, there are also a 1:1 button which makes the image to be its "true" size and a FILL button which makes the control perform a "Uniform" fill of the image currently displayed.

I considered those necessary with the things like the new Microsoft tablets and netbooks that are out there, and just anyone that doesn't have the 19+ inch monitors.

At the bottom, there now resides a STATUS bar, which provides little things such as the current page being viewed, as well as the name of the file. I plan on having it also provide other details that can be found in the XML objects that can be associated with a CBR file.

So, for my next trick, this is my current plan of attack in regards to functionality for this:

  • Work on display XML data in status bar
  • Provide way to view NOTES text (either from a Notes.txt file or appropriate field from XML file
  • Provide keyboard short-cuts for Menu Items found in the Ribbon bar
  • Work on CBR (well, actually CBZ as creating RAR files requires the purchase of a library while creating ZIP files is free) editor
  • Work on the GNZ editor
  • Implement the 7z decompression function (cb7)

As always, content for eComic can be found in many locations, or even built yourself by scanning in your newly purchased comics.

But two sites that provide free (and typically public domain) content for eComic are:

Wednesday, December 23, 2009

Dynamics SL....

I'm currently stretched between two projects for work. One a rather long-term system to improve the efficiency of document creation for a local loan company and the other is to assist with the customizations inherent in a Microsoft Dynamics SL (Solomon) migration from version 6.5SP1 to 7.0FP1.

Now, it's that second one that I need to talk about right now, because there's something about this that I'm floored by. The fact that there seems to be absolutely no one talking about the problems/processes/and what not that they've stumbled across while dealing with Solomon.

For example, the system is very easy to customize via Visual Basic for Applications (VBA) and is in fact designed from the ground up for that purpose. You're able to move controls, add new ones, and even go so far as to add entirely new data structures to the database and gaining read/write operations against it.

But, then you have to wonder, where on earth these changes are stored, and the answered to that is within a database field.

Now, they shove the operations as binary data into a binary field, so looking just at the data structures one would think that there was 1 entry in this table per modification. One would think wrong, as the system would have no way of knowing what modifications would be applicable when or why or how. In fact that would be a nightmare. No, what's happening, and why there will multiple entries per screen into the customization table is that the system only stores a maximum of 30KB per record. So basically all the VBA is changed into a binary-encrypted string, and then chunked up and stored that way.

Also, there's no EASY way to identify which controls were added to the form, as it's up to the user to define the naming convention. This can lead to things being named in the same pattern as Microsoft uses to name its controls as well as things being called "Button1."

But, if you export the customization for that screen, then you'll see a list of changes that have been made against all the controls on the screen, and from that, one is able to look and find those controls that have the "Created=True" property. It is those controls that are created by the end-user via the customization screens.

That knowledge would have saved me days (as I was having search and compare the non-customized version of the screen to the customized version in order to document all the various customizations so that we could ensure they successfully made the migration), but it was no where to be found. At least out in the open where one can find it.

In fact, I gained the "Tumbleweed" badge at StackOverflow because a question I asked (which the above knowledge would have answered for me) received low views and no responses for a decent amount of time.

But hey, I'm here to spread the cheer I guess....

Wednesday, November 18, 2009

IIS7 and the Case of the Reserved Reports

I had fun this morning at work hunting down something highly interesting in regards to IIS7.

What was happening, is that a client had kind of.... deleted the virtual server on which a web application resided. So, it was getting redeployed to a Windows 2008 box that also performed as a SQL SERVER 2008 box.

Well, my boss deployed the application, and when he went to test, it all worked, but the reports. Every time he attempted to run a report, the only thing that came back was a "Service Unavailable" message.

He upgraded the application from .NET 1.1 to 3.5, he played with the configuration values, and a host of other things up to and including special logging just for the 503 error hiding behidn the "Service Unavailable" message.

Nothing worked. Every other piece of the application was happy, but any of the reports.

So, we get together and start trouble shooting.

First thing we do, is create a blank ASPX file that just implements a report viewer, and it still comes back as "Service Unavailable."

Well, we add another new blank ASPX file, thsi time with out even the report viewer, and it still comes back as "Service Unavailable."

Then we drop in a old-fashioned HTML file, and get... the exact same results.

One is starting to get frustrated at this point.

So, we create a new folder, and try the HTML file in it. And we get served the HTML file.

So, we copy one of the existing reports into the new folder... and it works.

Confused, we discuss things, and I had the brilliant idea that maybe, the system was expecting the RDLC files to be located in a different folder than the ASPX files that display them. After all, copying over the one report caused it to work, and that ASPX file points to the path of the RDLC file which it is designed to load.

So, we create a new RDLC folder, move the RDLC files over to it, update all the aspx files to point to the new RDLC folder, publish, test and....

get "Service Unavailable."

So, we back out of all of those changes, republish, and are still getting "Service Unavailable."

I have him rename the folder in Visual Studio and republish and...

it works.

So, we're wondering if it was just a bad compile or something. So we rename the folder back to REPORTS and republish, and upon testing get...

"Service Unavailable."

One can imagine the head banging upon wood desks that began at this moment.

Then a horrible, horrible idea came upon me: what if "reports" was a reserved word in IIS7.

Almost fearful of the results, we just change the folder name on the server from "reports" to "reporting" and it works.

One is flabbergasted.

So, we rename the folder in Visual Studio and then update all the links to the reports and republish, and it's happy as a lark. It works, spits out the report and as far as it is concerned, life is good.

Of course, neither myself nor my boss could believe that Microsoft would make the word REPORTS a reserved keyword for IIS.

The very thought is insane, but that appeared to be what was happening.

So, of course, this demanded some Google time.

Ultimately, this link was found, and it explained the reason why the REPORTS folder was giving us a 503 error.

It seems that when SQL SERVER 2008 is installed with REPORTING SERVICES, the system registered the REPORTS name with the HTTP.SYS process, which means that the request for the REPORTS folder was never actually making it to IIS.

Which explained why the ASPX page wasn't being served, and why the standard HTML file wasn't being served, in fact it explained just about everything.

The only thing it didn't explain is why on earth Microsoft would make this decision!

Thursday, September 24, 2009

Keeping Track Of Non-Modal Dialog Windows

I had a problem.

My problem revolved around a modal dialog window. One which the user base needed to be non-modal.

Now, initially, that sounds like an easy task. It's just a matter of changing the ShowDialog method to a simple Show.

But that's just initially.

The problem comes because this dialog was editing the elements of a list. So, for each page viewed, I could have 1-to-N dialogs, spread out over 1-to-N pages. And I couldn't re-use the dialog windows over and over again.

Of course, even this is not THAT big of an issue--at least until you realize that there is a situation where I do need to re-use a dialog window. Basically whenever a user clicks on an already displayed line item, I need to bring that dialog to the front as opposed to popping a new one up.

And this had to be done without having a handle on the forms, and the control which is spawning these dialogs (and its parents) are not set up as MDI parents.

So, what the provides is the following list of issues:

  • Need to be able to launch N dialogs
  • Those N Dialogs cannot be re-used across list items
  • If a list item is already loaded in a dialog, that dialog just needs to be granted focus
  • No MDI Interface & no time to implement a traditional MDI interface
So, I turned to my trusty friend GOOGLE, and found pretty much zip. Apparently, most non-modal dialogs are either a singleton type thing or they're spawned and forgotten. Which for the most part, that's the case. I can see that the constraints that I'm working under are not common.

So, after thinking some more, I create a new project in Visual Studio to allow me to play with things. I tried grabbing the HWND object for my dialog but that was obscenely bulky and prone to errors.

Then I had the grand idea of keeping a list of these dialog windows in my control. That way I would have a handle for all of them.

So I tried it. I launched three different list item elements, all of them popped up. When I went back to the main form, and clicked one of those list item elements again, the correct dialog gained focus. I was scrubbing my hands and getting ready to do that "I control the world and am a genius" cackle.

But I had one last test, which is I closed one of the dialog and then clicked its corresponding list item.

And got nothing. Zilch.

After a quick breakpoint add, I discovered that those closed dialogs still existed in my list.

So, I proceed to bang my head on my desk.

Then I went and retreived my boss, and presented the problem to him, hoping he'd have some brilliant idea. Which he failed to grasp the problem until I reminded him that whole "there's no MDI" thing, at which point he got this kind of sick/amazed/amused look and basically told me I should have fun trying to solve this one.

Which is when I remembered events.

Oh those beautiful, wonderful things called events.

What had slipped my mind is that an event is raised to the window and then sent down the control chain until it finds a control that basically says "I'm supposed to handle that!"

So I go into my code, and to the CLOSING event of the dialog I add a new event that I raised. One that is consumed by my calling class.

When I handle said event, I know that I can remove the associated dialog from my list of open dialogs.

And wouldn't you know it, it all works just about perfectly.

Thursday, September 10, 2009

CAPTCHA Usability

Here's a secret, I despise CAPTCHA's. I hate them. I think they are one of the most user-unfriendly form elements in existence.

Most of the time, I can barely read them.

I understand their purpose, and I know why they exist. But that doesn't mean that I actually like the things, and it definitely doesn't mean that I like entering data into them.

But then there's the ones that I find are actively HOSTILE to the end user.

After all, the usage pattern for these evil things is fairly standard, everyone knows what to do:

  1. Squint and try and make out the relevant letters
  2. Type those letters in as they are displayed
  3. Press the submit icon/button/dongle/blood letting device
This process has become ingrained. It's what we expect.

Which is where I get to that hostile statement above.

I found one of these captchas, and entered the data, and it came back invalid.

So I entered it again, with the same results.

And again, and again.

Finally, I was starting to want to smack the website's author when I noticed something.

Instructions.

Who puts instructions on a captcha I thought to myself as I began to read.

For posterity, I made a screen shot. And in case you were wondering, this is the context of that block of text:
Confirmation code READ THIS INSTRUCTION CAREFULLY: *
Type a lower-case "w" into the box and then follow it with the code exactly as you see it. The code is case sensitive and zero has a diagonal line through it. The initial "w" is necessary - the system will reject your registration if you do not include it
Yes, they REQUIRE you to type a lower-case "w" as the first letter of the field.

Why? As far as I know it's just to annoy anyone trying to register for their site.

My ultimate thought: poor, poor design.

Wednesday, September 9, 2009

More Patent Shenanigans...

Apparently, a company has patented cross-communication between applets of an application utilizing a shared data store with both relational and objective data.

What that means is that someone patented the concept of including those Apps in Facebook and Twitter and any other application which uses plug-ins (including FireFox and Visual Studio) and a data store and a global network.

What is sad is that they've convinced a judge that there is reason to force Facebook to provide them the ability to review Facebook's source code.

Yes, a United States Federal judge has told a company that they must divulge trade, copyrighted secrets to a competitor in order for that competitor to successfully sue them.

All because Leader Technologies patented the concept of plug-in software.

I'm sickened by this, and see it as yet another reason why software patents need to disappear forever.

Of course if I was Facebook, I would facilitate the review of my source code by providing it in hard copy format.

After all, Facebook wouldn't want to step on anyone's toes by possibly using infringing software that features such niceties as the "Find" function or source code formatting.

Blog Widget by LinkWithin