StageWebView and StageWebViewBridge

My app development is progressing, although slower than I’d like, but I wanted to share a few discoveries about these webkit libraries.

A brief overview: webkit is the core web browser used in mobile devices, and StageWebView is an Adobe actionscript code library that provides a way to incorporate  a webkit browser inside an app. My main reason for using webkit is that mobile actionscript makes it very hard to display html-type content in an app without it.

When reading html files stored with the app, webkit has built-in security blocks that make using javascript a challenge.  StageWebViewBridge is a google adaptation of Adobe’s library that provides a workaround to the javascript issues.

However, I couldn’t get StageWebViewBridge to work, and after delving inside google’s code, discovered that it only works for files stored in the app’s document directory.  I’m designing my app to have my html files in its local storage directory, however (there are pros and cons to using either directory).

After a bit more research, I found out that webkit will run javascript in local files if the javascript is contained in the html file itself, and bounded by <script>..</script> tags. The normal html practice of <script type=”text/javascript”>..</script> doesn’t work. Weird, but now that I confirmed it in some test code, I’m able to design my html pages using javascript when needed.

There’s a pitiful lack of resources and help using StageWebView, other than adobe’s sparse help. Maybe my discoveries will help other programmers hitting similar walls.

The Aggravation of Developing Mobile Apps

Just spent more than 2 weeks researching and trying out software to develop mobile apps, and my grey hairs are turning whiter. My requirements: the program would be able to make cross-platform apps (iphone, android, blcakberry, etc.)  using one programming framework, be able to download images, and be able to run a database.

I had settled on Adobe Flash Builder 4.6 (FB) and Adobe Air, which together let me program once, and have the app work on iPhones, Android smartphones, and The newer Blackberry’s.

FB has its strengths and pluses, but it also has it share of frustrating shortcomings which seem like Adobe had a mass influx of Microsoft developers with their penchants for loose ends. Among my gripes:

- documentation for the features used in FB is mixed in with documentation for its predecessors that no longer applies, which means a lot of wasted time looking for answers.
-  tasks that should be simple are sometimes needlessly complex. For eg., adjusting the internal padding in a push button – easy to do in html with css – is accomplished only by a major piece of coding.  Accessing database records takes extra needless steps. Coding is twice as much work than php or visual basic to accomplish the same result.
- its smartphone simulator is plain jane.
- its visual designer is half good, half bad.

Now for the other horror stories.

Rhomobile had peaked my interest. Although it didn’t have a visual designer, it had the following pluses: great smartphone emulators, a niftier programming language (Ruby), free unless you needed its advanced features, and offered compatibility with more types of devices.  I spent a whole day trying to get it to work properly building an android app, but each fix I found just led to a different build error. In partial defense, the newer android sdk had become incompatible with Rhomobile, but I was unable to find much help in discovering what sdk version Rhomobile would work flawlessly with. Someone missed the boat in keeping up with the times. I had to abandon trying to make it work.

Same issue with Appcelerator Titanium, which has a large developer base. Just could NOT get it to work properly.

In my research, I ran across approx 50 software programs or web-based services that provided programming platforms for mobile apps. Some required Windows 8 (I run Windows 2003 server). Some looked great, but were quite expensive – $1,000+. Lot of change to spend before being able to tell whether they worked well, or were another potential frustration in the making.

The ones I liked most – they made visual layout a pleasure – usually missed having 2 capabilities I required – programming ability to download images, and run a database on the smartphone.

About half of the programs I researched required a lot of technical work, i.e. hand coded configuration files, technical learning curves, etc. About a quarter substantially  limited the type of tasks you could get the app to do. The rest had issues with learning curves, pricing, and useability.

My thoughts:

- Adobe needs to clean up its half-baked approaches, and dedicate itself to really doing a bangup job if this is a field it wants to play in.
- why google, with all its resources, doesn’t get into this game with a bangup product mystifies me. As it is, its incompatibilities in its newest android sdks makes me think its starting to follow Microsoft’s example.
- Apple needs to make a Windows version of its xcode development kit. It won’t hurt iphone or mac sales. In fact, it would likely boost iphone/ipad sales, which is where a lot of its profits come from. Stop being so snobbish.
- Microsoft never learns. You have to shell out big$$ to develop for windows phones, and upgrade to windows 7 or 8.  Snobbish still, in caps.

I wish I was 30 again. I’d have more of a mindset to handle the learning curve to develop mobile apps. As it is, I’m back to crossing my fingers with Flash Builder, and hoping that I can find my way thru the aggravations enough to finally complete an app that does what I want, and helps me earn a decent living.

Use of nofollow for most unpaid links

Over the past year, google has taken some aggravating (and in my opinion, misguided) steps to penalize sites for “inorganic” links back to their sites. Instead of simply ignoring such links, google actually assesses a penalty, and some webmasters are lucky enough to at least get notification of what links those are.

I’ve gotten some emails asking to remove links on a few pages because of this, and as a result – along with other seo advice – I recently instituted a rel=nofollow for listing hyperlinks that:  1/ are unpaid and NOT custom updated by the owner 2/have had an owner specifically request removal because of the google policy.

Note that paid and unpaid submissions in our directories will pass page rank, and do NOT have a nofollow associated with them (unless they fall under reason 2 above).

I’m hoping google will come up with a better alternative to its policy in the near future. And barring that, at least make the “bad list” available in webmasters tools, with descriptions of the reasons along with them, so that link owners, along with sites with the links, can have better info on what steps to take to correct the issues.

WordPress fixes

WordPress is mainly designed for use on linux servers, although it also works on Windows iis servers, with some glitches. Below are issues I ran across and – while researching possible fixes on the internet – discovered other webmasters had encountered the same problems:

In trying to install new templates, the admin panel would choke with the error “Destination directory for file streaming does not exist or is not writable.”

This fix was suggested in one of the posts I ran across (it worked for me):

In the class-http.php file in the wp-includes subfolder, there’s a section at about line 141 that reads:

        if ( $r['stream'] ) {
            $r['blocking'] = true;
            if ( ! is_writable( dirname( $r['filename'] ) ) )
                return new WP_Error( ‘http_request_failed’, __( ‘Destination directory for file streaming does not exist or is not writable.’ ) );

My best guess is that the is_writable line returns a value of False when executed, which triggers the error message. Commenting out the 3rd and fourth lines of that section (with // marks at the beginning of those lines) prevents the is_writable check from happening, which later lets the file saving function proceed normally. (Note that if the directory/file actually WAS unwriteable,  the process would choke at the stage where it tired to save the file to disk).

In trying to update plugins, worpress would throw this error: “Could not remove the old plugin.

In Windows Explorer, I changed the security permissions of the wp-content\upgrades subfolder so that files within the folder could be deleted, modified, etc.

Our New Blog

A few years ago, I had set up a blog for this site, and ended up taking it down as a preventive measure due to some php malware issues. After a few reoccurences of those problems, I think I finally got them weeded out, and hope to continue the blog from here on in.

It took the better part of a few days to finally come back to WordPress as the blogging software. There are still glitches trying to admin it on a Microsoft iis webserver, but -because of its popularity and wide range of plugins and options – WordPress seems to be the best compromise among the blog software choices I’ve run across.

I tried Serendipity, a free blogging platform, and liked it’s ease of install and overall look and admin options. But I found that customizing the front page was a frustrating experience for someone like me who only has a basic php programming background. I’m an ASP programmer, but the asp blog software I was able to find all had some serious shortcomings, except for commercial versions that charged $$$ (wordpress is free).

In future posts, I hope to shed some light on the inner workings of what it takes to keep running smoothly, as well as ongoing development work, and whatever else inspires me to put words on paper. Thanks for reading, and I hope I pen something of interest to you sooner or later.