Xojo 2017 Release 2

Last week Xojo 2017 Release 2 hit the download servers. This release has the usual mix of new, changes, and bug fixes. At first blush it doesn’t seem like there is a lot to mention but there is, but I’ll get to that in a minute.

Before we get into the highlights it’s worth mentioning, again, that R2 does not have 64-bit debugging for Windows. As Xojo mentioned in their blog post (http://blog.xojo.com/2017/07/26/the-best-laid-plans-64-windows-debugging/) the LLVM compiler and toolset just wasn’t ready to be included in R2.

Despite the lack of a 64-bit debugger for Windows a number of things were corrected in 64-bit Windows builds. Icons are now applied correctly and they also show the correct version information. The 64-bit MS SQL Server database plugin now works when compiled on the Mac. Game Input Manager also works in 64-bit now. Images assigned to an ImageWell are now drawn properly.

Also related to 64-bit builds, the Split and Join functions for Unicode strings is much faster and Replace and ReplaceAll behaves like the 32-bit versions. Exceptions no longer leak memory. Virtual Volumes now work. Copying a picture to the clipboard now works. XojoScript is now available in 64-bit builds.

Linux GTK3. See Xojo blog post (http://blog.xojo.com/2017/08/15/goodbye-gtk-2-hello-gtk-3/) detailing some of the changes. The switch to GTK3 was necessary for HiDPI support and now scales automatically on integral scale factors (i.e. 1x, 2x, 3x, etc). This also lets child controls clip properly on parent controls whereas they did not always clip properly in prior versions.

Be aware, though, that this switch may affect how your controls draw. While it’s always been true that default control sizes are bigger in Linux you could sometimes cheat and use the open events (or subclass the controls) and make them slightly larger in Linux and perhaps make the system font a little smaller and things would look good enough to not require a bigger UI change. With this switch to GTK3, however, it seems like some controls, PopupMenu and Pushbutton come readily to mind, in that their caption location is definitely lower than the prior version thus making them look odd without more work. For me, what worked in R1.1 just doesn’t look good in R2.

This change begs the question that if we could make a Xojo theme for Linux that would make control heights smaller, text sizes smaller, and change the caption locations to make this a non-issue. Perhaps someone with more knowledge about Linux themes could answer that.

A few other things that might ruin your day in Linux is that not all Linux distributions now allow you to remove the border of TextFields. It wouldn’t surprise me if additional issues are found in GTK3 as time goes on.

iOS has a couple of important changes. The first is that the AutoLayout Priority property in prior versions was calculated on its own. In R2 new constraints get the ‘Required’ priority. Any existing projects should get thoroughly tested on multiple sized devices to make sure nothing needs to be fixed. In our own testing we had to simply change the priority to Required to fix any issues.

Another iOS change that may affect you is that setting the CopyFileStep to the “Frameworks” destination now properly creates the Frameworks folder inside the iOS package and puts the files there. Before you had to create a manual directory for it to work properly.

Another nice fix is that a numeric suffix is no longer added to copied iOS controls unless they need it. This was an annoying bug. Not hard to fix but annoying nonetheless.

The web framework received some attention in this release as well. The WebPage width and height properties are now correctly updated before the Shown event is fired. A number of WebMapViewer errors were fixed including an annoying JavaScript error on the first refresh and where it would fail if there was more than one instance used in the app at a time.

The Session timeout now takes touch events into account when figuring out the last interaction with the app. In addition to that, web apps now try to reconnect if they’ve lost connection to the web app and will continue to do so for three minutes or until the user navigates away from the disconnect screen.

The Listbox control received some updates. For Linux, HelpTags are now positioned properly and in Windows they disappear properly when the mouse leaves the control Also in Windows the endcap is drawn correctly and headers no longer flicker when hovered over by the mouse or when clicked on.

A regression was reported for R2 that affects dragging items to the Listbox. In Windows the X & Y coordinates are incorrect. This was reported in Feedback 49190.

New Drag events were added to the Listbox. Except for a jumbled paragraph in the release notes I’m not sure anyone would notice. I would spend more time talking about it but as far as I can tell these are not documented in the Language Reference, either local or online and there is no example. I find it inexcusable to have a major change to such an important control not be documented. This seems like it should automatically make it into the documentation. Do better Xojo!

The IDE received a bunch of bug fixes and changes. New items in the Menu Editor no longer ‘fly in’ and arrow keys work now. Long error messages are wrapped and row heights adjusted in the error reporter are adjusted as needed (as a side note does this forebode variable height list boxes?) Recent Items in the Project Chooser now show size, date created, and date modified when possible. Pressing the Escape key now acts as a “Revert Now” to changes.

It also appears that a regression bug was introduced in Raspberry Pi. Button.Action events don’t fire if using a touchscreen. They appear to work properly when using a mouse. Feedback 49221.

As always, look through the release notes to see what else has changed. It’s also a good idea to test your applications thoroughly when upgrading to a new version.

Xojo 2017 Release 2 was chock full of new things and changes. I hope a dot release is issued to fix some of the bigger regressions. Up next is 64-bit debugging and remote debugging, the new plugin format, interops, and Android. Think they can get it all done in 2017?

Sorry for the delay in getting this out. Those pesky clients sometimes want on-site help and the last thing I feel like doing is writing after a long day of coding.

 

The Xojo Community is Awesome

Have I told you how much I love the Xojo community?  I’ve been part of it for fifteen years and I’ve met hundreds of Xojo developers at developers conferences and probably exchanged emails with thousands more.  I am amazed at how much this community helps each other and I wish there was a way to promote that as a key feature of the product.  It’s a big deal.  Really!

If you’re just starting out using Xojo know that there are a bunch of people, myself included, that are willing to help out, if we can, on your journey.  Programming is hard.  Well, I don’t think it’s hard because I’ve been doing it for so long, but it is complex at times and that makes it hard.  Just ask your question in the Xojo forums and you’ll almost always get an answer within hours.

Even Xojo pros, such as myself, have need of help.  Xojo covers Mac, Windows, Linux desktop, console, and web apps.  It does iOS apps for iPhone and iPad.  It now does Raspberry Pi for heavens sake!  It works with dozens of different databases.  There is simply no way any one person is going to know everything there is to know about Xojo.  It just can’t happen.  So yes, I go to the forums, all the time, and ask for help.

Just the other day I asked for some help with WooCommerce.  Not Xojo related, really, but certainly related to a project we’re working on for a client.  Within a few hours I had half a dozen developers private message me saying they might be able to help.  Subsequent contact narrowed that list down a bit but the point is that I have probably shaved off several days worth of work simply by asking for advice.

I am biased towards Xojo, naturally, as it’s been my primary development language for fifteen years.  I think I’d be hard pressed to find such a friendly community.  I call many on the forums my friends even though I’ve never physically met them.  The few that I’ve met in person have lived up to their forum reputations and are really friends for life.

So maybe this is my belated Thanksgiving post.  I am thankful that so many years ago I jumped both feet first into the tool.  I asked questions – many of the silly and redundant.  I became more proficient and then made another jump to start blogging about it, making products for other developers, and training the next generation of developers.

So if you are in need of a cross-platform development tool I highly recommend Xojo.  It ain’t perfect but no development tool is.  If you jump in I think you’ll love the community.  I know I do.

What say you fellow Xojo developers?

XDC News:  Android Support

iurThe 2016 Xojo Developer Conference kicked off in Houston, Texas today.  Geoff Perlmann, CEO of Xojo, Inc. took the stage this morning to deliver his keynote speech.  The biggest news of the day is that Android support is coming for Xojo.

Many Xojo developers (myself included) find that iOS support is great but without Android support it’s not complete.  Geoff announced that in the fourth quarter of 2017 Xojo will have the ability to compile Android mobile applications.

This is a big deal and a daunting challenge for this team.  It appears that they’ve done their homework to figure out what they want to do.  Details are scarce at this point but they already know they will compile down to native code and not Java.  They will also use native controls like Xojo does for iOS.

The target version of Android that they are aiming for is JellyBean (version 4.1) or better.  Roughly 97% of all Android users will be covered.  Sadly, version 4.1 was released in 2012 .  I would have thought that 4.4 (KitKat) or better would be a better choice.  Let’s hope that gets changed before release.

Geoff did not mention if Xojo is planning on adding additional staff.  The reason I bring this up is that I find a twelve month timeframe to implement a completely new platform.  A more realistic expectation is that it will be released in beta form and it will be 2018 before it’s ready for more usage.

More details as learn about them.

Xojo 2016 Release 2

Last week Xojo 2016 Release 2 was unleashed to the masses.  There are a lot of changes and tweaks in this version and if you are creating web or iOS applications there is a lot of like about this release.  There are also a myriad of changes and enhancements that should satisfy most developers.

iOS Stuff

The biggest changes in R2 is for iOS and these are things that developers have been requesting since its initial release.  Support for iOS 7 has been dropped because its market share is less than 20% and the minimum required version is now iOS 8.  This also means that Xcode 7 or Xcode 8 needs to be installed.

The Xojo engineers added iOSScrollableArea which allows you to view and display content that is larger than the view.  This is a very welcome addition and is worth the upgrade for this feature alone.

R2 also adds the iOSLocation class that allows your application to request location coordinates as well as get updates from the device.  Once your application gets permission to access the device location you receive changes via the LocationChanged event that gives you latitude, longitude, altitude, course and speed parameters.  An Accuracy property lets you change the desired accuracy.  In addition to iOSLocation Xojo has added the iOSMotion class that allows developers to access the accelerometer and gyroscope.

iOSTable was arguably the most useful and least powerful control in iOS for Xojo and this release definitely gives it some love.  You can now embed controls in the cells of iOSTable by using the iOSCustomTableCell class.  This allows you to create some very rich and powerful UI that lives in the cell of an iOSTable.  I guess the best equivalent in desktop and web terms is that the iOSCustomTableCell is a specialized ContainerControl you can put into an iOSTable cell.  I’m looking forward to using this.

They’ve also added support for Row Actions in the iOSTable.  The new ActionsForRow event passes in the section and row and you have to supply the iOSTableRowAction array.  The iOSTableRowAction has a title, an Auto tag and a Style.  The style can be either Normal or Destructive with Destructive changing the background of the Action to red (does this ever vary? – not sure).

The new iOSSharingPanel allows you to share pictures, text and URL’s with any registered system service or app.  That’s a fancy way of saying you can share this data between applications.  It’s the iOS version of the clipboard available to desktop applications.

The iOSPicturePicker class allows you to select images on the device or take pictures with the camera.

To avoid confusion for users, the old SQLiteDatabase class for iOS has been renamed iOSSQLiteDatabase.  The corresponding recordset class is now named iOSSQLiteRecordSet.

Non-IOS stuff

The Web framework is now HiDPI capable.  It works similarly as desktop apps in that it queries the browser for the scaling factor.  Then, the application serves up the proper image if it can.  You can change how this works by changing the Supports HiDPI in the Shared Build Settings.

In Windows there are a number of significant HiDPI changes that make it work better in Windows 8.1 and 10.  Perhaps the biggest Windows change is that Xojo.Net.HTTPSocket is no longer much slower than HTTPSecureSocket.  I have not had a chance to look at this one in detail yet so if you’ve had success or failure with it, please leave a comment below.

Always check the release notes that are in every release.  I’m just hitting the highlights out of hundreds of line items and you never know what might be there that affects your application.

As with any new release it’s better to test your project against it before releasing it into the wild.  In my own testing I had some instability with converting an old web project (started around the very first public beta of Web Edition) to use HiDPI graphics.  This involved adding an ImageSet and adding the 1x and 2x graphics, deleting the old graphic, and then fixing it in all locations in the project.  I was able to crash the IDE but all of the crashes were different and, of course, none of it was reproducible.

The Future

The 800 pound gorilla in the room is a 64 bit IDE and 64 bit debugging.  Things like XojoScript are holding back the IDE from being 64 bit.  I would also imagine that not having an integrated debugger available in 64 bit is holding back that as well.  I know we are avoiding releasing some 64 bit projects because of these limitations. We’ve also been playing around with the Raspberry Pi and it’s definitely not very useful without the debugger.

We need the 64 bit debugger.  Let’s hope that R3 provides us with some relief in that area!

How has your experience been with R2 so far?

Xojo iOS without Android

I will be honest and say that I did not think that Xojo for web apps was going to amount to much of anything.  Granted, I said this as I was struggling with a beta of the very first release to do some actual production work.  Since then it’s gotten considerably better and more stable and it’s become an increasingly large portion of our consulting work.

I was asked the other day what I thought about Xojo for iOS.  I replied that it’s stable and the community seems to be coming up solutions at a much faster pace than Xojo for web.  But until it starts bringing income into my consulting business I’m hesitant to say much more about it.

Let’s talk about that aspect of it for a bit.  When web came out I immediately landed a few consulting projects which was an awesome (and horrifying) way to learn the new framework.  Here it is roughly six months after release and I’ve only had a few nibbles but no actual projects on Xojo for iOS projects.  This despite the ten plus hours of training video I’ve created for Xojo for iOS.

So it makes me wonder if Xojo for iOS is really going to take off.  Part of me wonders if Xojo misunderstood the market for mobile apps.  Sure, iOS is where the money seems to be, but Android has the marketshare and Windows mobile (whatever they call it these days) just keeps hanging around.  Xojo simply doesn’t address Android or Windows mobile.

I think one could reasonably argue that part of Xojo’s strength on desktop is that it makes decent apps that are cross platform and it doesn’t matter which platform you develop on.  You do have to spend extra time for a Xojo app to be 100% compliant on Mac OS X and Windows (I’ll leave Linux out of the mix since I don’t cater to that crowd) and I don’t think many people would argue that if you were going to make a Mac-only application you might want to stick with xCode and Swift or Visual Studio for making a Windows only application.

Apple and Microsoft will always have the best gadgets and goodies for those platforms.  That’s just a fact.  Xojo is often a compromise of the lowest common denominator between the platforms.  It’s RAD capabilities are important but I’m not sure that I’d give it THAT big of an advantage once you get past the learning curve of all the respective platforms and languages.

Xojo for iOS is nice and works well but I feel that without Android it’s not going to get much traction.  Xojo is known for cross-platform apps yet it only supports one mobile platform.  If you were going to go the trouble of developing for more than one mobile platform wouldn’t you go with a tool that supported more than just iOS?

I mean no disrespect to Xojo.  They’ve accomplished a pretty amazing thing.  They have an IDE that allows you to create iPhone and iPad apps without learning Swift or CocoaTouch.  However, you are limited to developing on Apple hardware (that’s Apple’s not Xojo’s fault) and to do any remote debugging you have to use the iOS Simulator that’s part of xCode.  Just that part eliminates a good chunk of Xojo’s potential market (the Windows and Linux users).

Xojo for iOS works well.  It has good developer community support.  I see no reason why developers wanting an easier mobile development environment wouldn’t choose Xojo except for one thing:  It’s iOS only.

So what do you think my fellow Xojo users?  What do you think of iOS for Xojo?  Is it anything without Android and Windows Phone or is it missing something else?

iOS For Xojo Notes #1

After doing about five hours of training video for iOS for Xojo I’ve discovered a few things.  First, the new framework will take some getting used to.  It’s not that it’s difficult to figure out, it’s just different.  Each little difference requires that I analyze what it’s doing and evaluate if I need to change my coding practices.

We’ve already talked about one of those differences with the FromText methods.  In the old framework using string.val does a lot of assumptions (not all of them good ones as we’ve come to find out) and those assumptions will either result in a valid number or a zero.  Blank strings also convert to a zero as well.

We’ve all been used to those assumptions for so long that we didn’t even realize the assumptions.  Or we ignored them.  Either way, we depended upon them.  The new framework uses much more stringent rules and if the text is outside of those rules it will throw an exception.

We can argue all day long whether it’s really an exception but that’s an argument for a different day.  Xojo has decided that errors shall not be silent (am I the only one that just said in a Gandolf voice, “Thou shall not pass (errors)!”?).  Errors causing excpetions will change the way we code and I’m still not entirely sure that I’m comfortable with those changes yet.  I’m sure it’s really a matter of getting used to them.

The other thing I’ve discovered is that events on iOS controls are different than their desktop and web counterparts.  In desktop and web if you set the value of a control it fires their relevant change events.  In iOS it does not.

In desktop and web apps we’ve actually relied upon this behavior.  Rightly or wrongly, it was there so we did.  This also meant, however, that we’ve had to somehow make a distinction of whether or not the user or the developer set the value (and caused the event).  Usually it was a matter of setting the control enabled = false while loading the data and then setting enabled = true when we were done.

Since iOS does not have this behavior I suspect we’ll start putting less code in the events of controls and instead use a method that does the work.  This is probably a good thing.  Being dependent upon the events to do something will make us better programmers in the long run (hopefully).  It’s not really a huge change but it’s a somewhat important one given the background Xojo developers have in desktop and web.

At first I thought this might be a bug but after cornering a Xojo engineer this was by design.  I can live this change now that I’m aware of it.  Do you have different thoughts on this?

What significant changes have you found in iOS that were a surprise?

Xojo 2014 Release 3.1

Xojo 2014 Release 3.1 hit the internet today. This release is a minor maintenance release and is recommended for everyone.

Web received a number of fixes. Checkboxes now work properly on touch devices. Label offsets are calculated correctly when the initial text is an empty string. Labels that had been on a container that had been set invisible in the IDE and visible via code now appear properly.

It’s a shame that these bugs made it into release.  Beta testers were so enamored with iOS that desktop and web didn’t get much attention.  But then again I was using the beta’s for production web apps and didn’t spot these bugs either so my bad too.  They’re kind of obscure in how to set them up and I generally don’t do either of those.  Hopefully with 2015 R1 we’ll get some better testing for targets other than iOS.

iOS received a few critical fixes. The first is that SQLSelect and SQLExecute now work properly (it was randomizing the data). The second fixed soft declares.

If you have not played around with the iOS SQLiteDatabase class the SQLExecute and SQLSelect methods now have built in prepared statements so there’s no need to through the steps of creating the prepared statement and then binding the values.

The IDE received a few minor bug fixes.  So did the compiler.

I reported a bug with the new Xojo.Core.Timer.CallLater in Windows yesterday. It generates an exception in a compiled application but in the debugger it generates an exception in the IDE! Too weird to be anything bug true. 🙂

I am looking forward to 2015 (seems weird to be typing that) Release 1. It looks like iOS builds will be 64 bit in that release. That means that Xojo is creating 64 bit builds for standard and debug builds in the iOS Simulator (Intel) and, at a minimum, standard builds for device deployments (ARM).

Presumably, this means that the IDE can already understand 64 bit debugger instructions, right? Is 64 bit for other targets far behind? Let’s hope not!

We already know the fiasco over the FromText methods in the new framework are being addressed in 2015 R1. In addition to FromText Xojo will offer a much less stringent Parse method that should satisfy most developers.

Any bugs that you’ve seen in Release 3? Anything you’re really looking forward to in the next release?

iOS Development on Xojo

Xojo 2014 Release 3 was a big one for Xojo.  R3 allows the average person to create iOS applications in Xojo, in a RAD language, in an easy to use IDE.  I think most people will find developing iOS apps easy in Xojo.

The iOS applications that Xojo creates uses native controls.  This is huge because when iOS 9 comes around and Apple changes the native controls (because you know they will) Xojo iOS applications will most likely just work.  Some other iOS development environments use images for their controls which means they will have to update their tool set to work with the updated look.

For a first release, Xojo for iOS is pretty solid but it is definitely lacking in some areas.  Some of the controls are not fleshed out completely.  An example is the table.  What it does, it does well, but it is lacking in options that many developers will want.  Views aren’t scrollable yet and there are no UI pickers yet.  There is a Date and Time picker example that was done via declares but it’s not built-in to the control palette yet.

Another area that I’m sure the community will rally around is converting the iOS frameworks over to Xojo.  There is a similar project on the Mac OS side called MacOSLib and I’m sure some of the same developers will be active on both (they share some similar libraries after all).

Currently Xojo allows you to debug your application while it’s running in the iOS Simulator.  It would be awesome if Xojo could get it working so that we could debug while it’s running on the device.  Given the provisioning profile and the ability to manually add apps to the iOS device this might be possible but, to be honest, I don’t know what the sandboxing rules would be for that.  I also don’t know if that means Xojo developers in Window or Linux could deploy directly to the device or not (don’t hold your breath on this one, by the way, but one can always wish).

I am impressed with iOS in the first release.  Xojo has managed to take something that’s complex and made it easier.  If you already have some Xojo experience the transition will be a piece of cake (although there are framework differences between iOS and Desktop/Console/Web).  I think anyone with iOS development aspirations should take a look at Xojo.

We’ve been busy doing training videos!  We currently have over 4 1/2 hours (and growing) of iOS specific training videos available to subscribers over at http://xojo.bkeeney.com/XojoTraining/.  Come check it out!

[Update] I forgot to mention that the first couple of iOS apps developed with Xojo mad it through the approval process on Thursday.  Excellent news!

Xojo 2014 Release 3

Xojo 2014 Release 3 hit the public today.  It is, without a doubt, the most ambitious release we’ve seen in quite a while.  This release brings the much anticipated iOS target and while it’s a first release it seems pretty solid.  There are new licensing and pricing options and a new framework that is ambitious in scope and has long-term implications to all developers.  And, as with every Xojo release, there are bug fixes, changes, and additions to the IDE and all of the targets.  So let’s dig in!

New Licensing and Pricing

Xojo has changed the pricing structure to make it simpler.  Purchasing Xojo has moved to a single purchase price and upgrade pricing is gone.  The single-platform desktop license is $99 a year.  Console is $149, Desktop (with all 3 platforms) is $299, Web is $299, iOS is $299, the Pro license is $699, and Enterprise is $1999.    A new Pro license iOS but existing Pro licenses will have to be upgraded to get iOS.

Licenses are set to auto renew every 12 months.  You can turn this off in your Account settings page.  I can see this as a convenience and also a bummer for some folks.  The licenses, for some, are pricey enough that you probably want to turn off the automatic update.  For those corporate accounts it’s probably not a big deal.  I’m sure this will generate some controversy.

My opinion (since you asked):  When Xojo announced iOS they never promised that it would be in the Pro license.  With the amount of work they put into it, and that it’s essentially a new SKU, I would expect the Pro license to be more expensive.

Am I happy with the no upgrade pricing?  I’m ambivalent, at best.  Yes, it costs more for me, but it’s a lower cost for people new to Xojo.  More potential customers means more demand for my products and services.  I think the goal for Xojo is to grow as much as they can so hire more engineers and do ambitious things.  For us, we’re kind of a captive audience since we use Xojo for 99% of our business so for me it’s the price of business.  Frankly, coming from the VB world we were used to paying tens of thousands of dollars a year to stay current so the relatively minor price increase doesn’t phase us much.

iOS Target

R3 is the first release for iOS.  This is a huge undertaking and represents the culmination of many man years of work.  iOS is a completely different beast.  It required a completely new compiler (LLVM), new editors, new frameworks, and new ways of doing things.  I must give the engineers at Xojo major kudos for getting it done (yeah, I wanted it last year too but some things just take time).  As a first release, Xojo iOS is pretty solid.

Xojo has always been about hiding the ugly implementation details from users and iOS is a great example of that.  If you’ve done any iOS development you know that Apple really likes the MVC (model – view – controller) pattern.  Xojo does not necessarily fit that pattern (though it can).  So for the engineers to have it ‘just work’ like we we’re used to in console, desktop, and web applications is impressive.

Xojo for iOS uses the iOS Simulator that comes with Xcode so your are required to installed Xcode 6.1 and agree to its licensing terms to pretty much do anything.  After that when you run an iOS application in the debugger it creates a package that can run in the iOS Simulator, loads it, and starts it in the simulator.  For Xojo developers this is not a huge departure from what we already do (though the cycle time in the debug cycle is longer).

To deploy on your own device you have to join the Apple iOS Developer Program ($99/year) so you can create a Provision Profile and install the app via Xcode.  Joining the program also allows you to submit your app to the App Store for sale.  During the beta process several developers submitted apps to the app store but I’ve not heard if they have been approved yet (not that this was recommended during the beta process by Xojo, by the way).

Developing for iOS will require some new thinking for existing Xojo developers.  You’ll have to figure out the relationship between the application object, screens, and views – especially how screens and views interact given that screens can have single views, tabbed views, and split views and each of those content views are independent (one of the videos I added to our training library today goes into this).  Developing for iOS also uses the new framework so some things are different.

Screen Shot 2014-12-09 at 10.07.16 AMThe new framework has a namespace that might be confusing for a while.  For example, a timer is really Xojo.Core.Timer.  In the shared build settings if the Simple References is set to true, you can reference a timer as Timer and it can figure it out on its own that it’s using the new framework (mainly because that’s the only one it can use).  There is a new Using keyword that lets you choose which framework to use in a module or even in a method.  Another example of how the Simple References is convenient is RandomInt is really part of the Xojo.Math framework but with Simple References on you can simply use RandomInt rather than the full Xojo.Math.RandomInt.

Another thing that’s new for iOS is Auto Layout.  In the View Editor we no longer have the Top/Left/Right/Bottom lock properties.  It’s been replaced with Auto Layout and it can be confusing to use.  I promise you that it gets easier with use.  Auto Layout is not perfect in this release as it seems rather finicky.  I have no doubt it will improve with time.

Screen Shot 2014-12-09 at 10.07.35 AMPerhaps that hardest part of Auto Layout is coding the position of the controls since you can’t just say control.left = 10.  You have to add or change the Constraint of the control.  To understand the complexity of this, take a look at the UI in the Inspector.  Now translate that into code.   To say that this is going to take some adjustment by everyone is to be an understatement.  But, in the long run this will make complex UI easier and eventually it will be coming to the web and desktop targets.

For a first release, iOS is pretty solid.  To say that it’s 100% complete would be an incorrect.  There are a number of things missing in the first release that might make life hard for a while.  There are no built-in Date/Time pickers though you can add them via declares (there is an example of this in the iOS examples folder).  There is no picker control (the equivalent of popup menus) and there is no scrollable view yet.  No camera support.  No Location support, There is also not a Style Editor that allows you create an overall look and feel of your application though you can certainly set Fonts, colors, sizes, etc. via the Inspector and code.

Overall there is a lack of depth in supporting libraries.  During the beta process users figured out the declares to get the Date/Time pickers working via declares as well as several other useful things (check out the iOS declare examples that ship with Xojo).  I’m sure the community will come together to fill the needs we come up with and I expect the iOSLib project be birthed soon (if it’s not already in the works).  Check the iOS forum for news on this if and when it appears.

The New Framework

iOS requires the new framework, but you can start using the new, non-iOS, framework in the console, desktop, and web applications.  You are not required to use it in R3 or even in the near future.  I’ve heard that the existing framework will be around for a minimum of five years (forever in computer terms) so there’s no imperative to start using it this instant.

The new framework is very cool, though, because it adds some much desired consistency to the framework.  You’ll never have to remember if an index is 1 based or 0 based.  Everything is zero based.  Method and property names try to be explicit in what they do, and, in general, the new framework helps eliminate common mistakes in code.  One example of this is the Date class and with the current framework it’s often used incorrectly which leads to code that fails subtly (I know because I’ve  been the victim of this).  The new Xojo.Core.Date class is very explicit how it’s used and eliminates the most common mistakes.

There are two major data type changes to the new framework.  The first is the Text data type.  Really, it’s still just a string to us, but it makes a distinction about encodings and characters.  No longer is it byte-based but a character is now a ‘user-perceived character’.  This means that a user-perceived character in Japanese is one character but it’s multiple bytes in length and the various string methods will be able to work properly with them (there are no byte string operations now).

The major implication of this change is that sockets that used to bring things back as a string now bring things back in a MemoryBlock and you’ll have to extract the data from it.  This one change eliminates various issues that many people have had over the years with string data that has no encoding information and being able to decode the data properly.

The other major data type is the new Auto type.  This is the replacement for Variants.  Variants have always been weird because they implicitly convert data from one type to another.  This led to some subtle data errors (think double to integer and back again) that were hard to find.  The new Auto does zero implicit conversions.  It’s up to you to figure out what’s in the Auto variable (using Introspection this is pretty easy) and then you have to covert it yourself.  If you stick an integer into an Auto variable it will come out as an integer and if you want to convert it you’ll have to do it on your own.

Before you freak out about the Auto data type I spent 30 minutes coming up with my own Auto extends module that did a number of things.  First, it checked to see what was in the variable so if I wanted to convert it to an Integer I’d check to see if it already was an integer.  If it was the conversion is easy.  If it’s not, I then used the various conversion routines to convert it to an integer.  Example, if the Auto variable is set to “Bob”, the type check will come back as Text.  Then I can assign the integer value using the Integer.FromText shared method that’s in the Integer datatype.

So will this cause some heartache?  Yes, yes it will.  Will it cause a lot?  Nope.  Our ActiveRecord classes used a bunch of variants to hold data of any type.  I spent maybe 30 minutes converting it over to use Auto and Text and another 30 minutes or so testing.  The more complex your classes the more complex this conversion but I don’t expect it to be as awful as you think it is.

As a reminder, I did say that you don’t have to start using the framework immediately.  I highly recommend that you start working with it because I think you’ll find some gems that you’ll want to start using.  The drawback, of course, is that your code will not be backwards compatible with older versions of Xojo.

Web Apps

WebLabels had some work done on them to improve IE 9+ compatibility.  Unfortunately, this may have caused some other issues with WebLabels in dynamically embedded WebContainers.  Look in the forums for a temporary fix if you have this problem.

Web apps on Windows can now use Windows Service events.

Web apps now have a HandleURL event for handling any request that would normally results in a 404 Not Found error.  This should allow you to use almost any URL within your web app for whatever purpose you want.

Miscellaneous Stuff

The R3 compiler is now much pickier about some things.  Properties and structures that are defined in multiple modules will get flagged as being duplicates.  In one of my projects I found that I had two global db as SQLiteDatabase variables.  How did the compiler know which one to use and could some odd user bug reports point to this type of bug?  I don’t know but I’m glad the compiler is smart enough to figure this out now.  Users of MacOSLib will want to update to the latest version since it is a major offender of this particular issue.

The IDE has a slew of changes.  Obviously the addition of iOS is the biggest change but a lot of cleanup in the editors and Inspector has occurred.

The debugger received some love this release too.  No longer do you have to have over variables to get them to refresh.  Variants now display and behave the same as the data stored in them.

Yosemite is now fully supported in the IDE and in compiled applications.

Be aware of a possible behavior change if you use HTTPSocket or HTTPSecureSocket.  It no longer strips off user specified content-length or content-type headers if no post content was specified.

The desktop hierarchical listbox has two new methods.  The RowDepth returns the nesting level of a row.  The RowIsFolder allows the user to get or set the ‘folder’ status.

The SSLSocket class now has TLS v1.1 and v1.2 support.  This means that HTTPSecureSocket, Pop3SecureSocket, and SMTPSecureSocket support it as well.

The Currency data type received some love and should be more accurate in both Xojo and in XojoScript.

Conclusion

As always, check the release notes to see the complete list.  This release has more than normal list of new and changed things.

The addition of iOS is a huge deal.  For a first release it’s pretty solid and I expect that will generate some interest in the product.  The new framework is both exciting and frightening at the same time because it introduces some uncertainty of when to start converting over to it.  But, as I said earlier, you don’t have to start now and it’s advisable to start looking at it and become familiar with it.

What excites you?  What concerns you?  Anything big that I didn’t cover?

[Update] Change ‘upgrade’ to ‘renewal’.  You can upgrade from a lessor license to a better one still but the 50% off renewal pricing has been discontinued.

Change is the Only Constant

No one likes change.  I know I don’t.  It introduces an unknown element and unknown equates to scary.

Back in college (granted, this was decades ago) the language dejour was Pascal and C was an upper level CS course (being an electrical engineering student I never had to take it).  Visual Basic wasn’t heard of and Xojo wasn’t even a wet dream yet.  Since then C++, C#, Java, Javascript and a myriad of other languages have come.  And some have gone too.  Then came the frameworks that made life much easier because no longer did we have to reinvent the wheel on every project.  The only constant in software development is change.

Xojo has been around for over fifteen years.  I think anyone that’s been using the product for any length of time can say it is not a static product.  It supported 68k Mac’s back in the day, then PPC Mac, then Universal Mac apps, then Carbon, and now Cocoa.  For Windows there’s been a bit more stability but things have changed from Windows XP to Windows 8.  Linux, well, it seems that there’s a new Linux distribution every month that are slightly different from each other.

Xojo introduced the ability to create web apps that ran on Mac, Windows, and Linux and introduced a new framework for the controls and for web specific things.  Overall, however, the web framework was exactly the same as the standard framework even when it didn’t make much sense (e.g. web controls having drag events when there’s no way they’d work like the desktop version).

And now Xojo is working on an iOS version (due out soon) which uses an entirely new framework.  iOS is a completely new beast.  It most definitely is not a Mac, Windows, or Linux desktop or console app.  When you think about it, making web apps is really just a console app so it wasn’t a big stretch since Xojo has been doing console apps for a while.

iOS is very different.  It uses a completely different processor which requires new system calls.  Heck, there are no ‘windows’ but has ‘views’ that are sort of, kind of, like windows.  The metaphors between mobile and desktop (and web) are completely different.

For 15 years the Xojo framework has had a lot of new stuff bolted on.  Different Xojo developers did different things but for the most part it’s just worked.  It was wildly inconsistent and every developer, like myself, that has spent a lot of time working with the language still has trouble remembering which framework calls used zero or a one index.  Names weren’t always consistent and some things were simply harder than they needed to be.

So Xojo is making a new framework that eliminates the confusion.  All indexes are zero based – no exceptions.  Methods and properties are consistently named so (theoretically, at least) if you are using an object you’ve never used before you should be able to make reasonable guess at what the method you want is.  Obviously, there will be exceptions to this rule but the goal is to make it easier on us developers in the long run.

In the long run…That’s that key phrase.  What we’re finding out is that it’s generating a bunch of concern amongst Xojo developers.  I get it.  Change is hard and it’s scary.  But it’s not that bad.

Here are the facts:

1.  The existing framework isn’t going away.  It will be around for many years (if not forever).  Xojo has said the existing framework will be 64bit and will be released sometime in 2015.

2.  The new framework is only required with iOS.  There are zero Xojo iOS customers right now.  All desktop, console, and web applications, are okay and need zero modifications in Release 3 to work.  NO CHANGES REQUIRED!

3.  You will be able to intermingle the new and old framework.  Xojo has introduced a Using keyword that allows you to use both at the same time.

Xojo isn’t forcing you to use the new framework in Release 3.  Your apps will still compile and work just like they used to (the compiler does find new types of bugs so don’t be surprised if you have to fix a few things).

Should you start looking at the new framework?  Absolutely!  Should you start converting code over to the new framework soon?  Well, I would hold off a release since the new framework is still in some flux (I think).

Porting code to the new framework isn’t all that difficult.  Is it work?  Yes – especially if you have extensive code libraries that are shared between console, desktop, web, and iOS.  Co-mingling new and old frameworks will be painful for a while but the nice thing is that the new framework (that parts that exist, at least) will work on all platforms in Xojo 2014 Release 3 and beyond.

The new framework is different.  You might have to looking at every line of code.  I personally won’t do this with existing code but certainly all new code will probably use the new framework.  It is the future and I hate coding things twice.  The biggest problem is legacy code and that the new framework is not backwards compatible.  As a 3rd party controls and library developer this has the potential to mess up development for a while.

The new framework is coming and it’s not all that scary – really.  iOS users will bear the brunt of the changes, at first, but everyone can start using it now and I encourage you to start looking at it.