revUp - Updates and news for the Revolution community
Issue 89 | March 23rd 2010 Contact the Editor | How to Contribute

New iPhone Pre-Alpha build: Core Location and More!
Pre-Alpha 6 brings you more powerful capabilities for your apps

by Kevin Miller

Our revMobile pre-release program is getting more exciting by the day. We've now added support for a whole slew of additional iPhone features in the latest build, pre-alpha release 6. In addition to all the goodies we already gave you, we've brought you these new capabilities:

Orientation
The orientation of the device can now be determined, and an application is notified when the orientation changes. When you want to find out which way up you are, find out by using the new orientationChanged message:

on orientationChanged
   put iphoneDeviceOrientation() into tOrientation
   -- respond to value in tOrientation here
end orientationChanged 
This function returns one of:
  • unknown – the orientation could not be determined
  • portrait – the device is being held upward with the home button at the bottom
  • portrait upside down – the device is being held upward with the home button at the top
  • landscape left – the device is being held upward with the home button on the right
  • landscape right – the device is being held upward with the home button on the left
  • face up – the device is lying flat with the screen upward
  • face down – the device is lying flat with the screen downward

Your application can rotate its interface to a new orientation at will using the new the new iphoneRotateInterface command. Use this command to have Rev rotate your entire interface to the correct orientation. This feature is great for games, picture viewing, reading text... you name it, its vital to delivering a native iPhone user experience.

on orientationChanged
   iphoneRotateInterface iphoneDeviceOrientation()
end orientationChanged 

Note: The syntax in this pre-alpha is still at prototype stage. As we get further through the development process we will be looking at providing better syntax than simply command and function calls.

Core Location
Need to use iPhone location information in your app? Now you can. We've added basic support for core location - your application can request updates to the location of the device.

The current location of the device can be fetched by using the iphoneCurrentLocation() function. If location tracking has not been enabled this function returns empty. Otherwise it returns an array with the following keys:

  • horizontal accuracy – the maximum error in meters of the position indicated by longitude and latitude
  • latitude – the latitude of the current location, measured in degrees relative to the equator. Positive values indicate positions in the Northern Hemisphere, negative values in the Southern.
  • longitude – the longitude of the current location, measured in degrees relative to the zero meridian. Positive values extend east of the meridian, negative values extend west.
  • vertical accuracy – the maximum error in meters of the altitude value.
  • altitude – the distance in meters of the height of the device relative to sea-level. Positive values extend upward of sea-level, negative values downward. • timestamp – the time at which the measurement was taken.

Send Email
Your revMobile application can prompt the user to send an email, using the standard iPhone mail composer interface. Once you know which way up and where you are, you can email your buddy to tell him, using the same revMail command that we implement on the desktop.

Folders & Fixes
Support has been added for specialFolderPath() to allow easy fetching of 'standard' folders.

As well as adding new features, we are of course working on the bugs which some of you have kindly reported. This release fixes the following issues:

  • A bug with file path 'root' problems has been fixed. All paths are now reported relative to the filesystem root, rather than the home directory.
  • A bug with the mouseLoc returning an incorrect y-coord has been fixed.
  • A bug with animated gifs not displaying correctly has been fixed.
  • Disabled controls are no longer considered when working out the target of touch messages (just as it is for mouse messages)
  • The answer command now returns the chosen button in the 'it' variable as it should

This is still designated a pre-alpha since the UI has not yet been added and you still can't build for the App store, but nonetheless, judging from the feedback we're getting from early purchasers, we think you'll find these features interesting, useful and fun!

Don't forget to check out our lessons area, which now has a dedicated revMobile section.

We'll be adding more lessons here to help you along with the new features. You can already find lessons on Accelerometer, Multitouch, Shake and image use here, as well as a couple of basic "getting started with revMobile" lessons. Remember, the more features you use the better your chance of winning our competition!

Also watch our brand new video series, the first one is available today, more will be coming over the next few days.

If you've already purchased, you should now have an email from us letting you know how to get this update. If you haven't, and you want to know more, you can read all about revMobile here.

Remember you only have until the end of March now to purchase the special pre-order plus conference Simulcast/DVDs, these benefits will not be part of the package come April 1st.

About the Author

Kevin Miller is CEO for RunRev Ltd.

Main Menu

What's New

Get revMobile Pre-Release