revUp - Updates and news for the LiveCode community
Issue 130 | March 8th 2012 Contact the Editor | How to Contribute

Coming Android Features
We're adding a slew of new Android features in LiveCode 5.5

By Heather Nagey

LiveCode 5.5 is currently in testing. Any purchases of LiveCode 5 made now will automatically receive 5.5 as a free update when it is released.

In the last edition of revUp we focused on the new Field features that 5.5 will be bringing you. But that's not all by any means. It has been our stated intention to bring our LiveCode Android platform offering in line with the feature set already offered on iOS. With LiveCode 5.5 we are proud to say we're getting very close to this goal. We've added many of your top feature requests in this release. You can look forward to no less than 15 major feature additions for Android:New Mobile Features

  • Native browser control
  • Push Notifications
  • In App Advertising
  • GPS
  • Compass
  • Gyroscope
  • Modal pick wheel support
  • Date picker support
  • Multi-channel sound
  • Busy indicators
  • Local notifications
  • Custom URL schemes
  • Vibrate
  • Beep
  • Text messaging

Some of these features are also new to iOS - Push Notifications and In App Advertising have been added for both platforms in this release. So, why should you get excited?

These are significant additions, which will greatly enrich your applications for LiveCode on mobile. You will be able to write your code for one of these major mobile platforms, and simply rebuild it for the other without worrying whether the features you've used are supported on that platform. We know how many of you have been asking for a Native Browser Control, GPS and Push Notifications. Now your app can tell when a significant event has occurred, and update itself and the end user accordingly. You can run a browser embedded in your app, tell your user exactly where he/she is, and perhaps even more excitingly, you can generate more revenue by using In App Advertising - we've partnered with a major in-app advertising platform to bring you this important feature (more details soon!). Because this is brand new to both iOS and Android, and may be something you haven't considered before, I'd like to go into a little more depth on this particular feature and how you can expect it to work.

Note: you cannot actually test this yet unless you are using a developer preview release of 5.5, available to members of the LiveCode Developer Program.

In App Advertising
This is a great way to earn money from free apps. Instead of charging the user, you charge the advertisers, and earn money everytime a particular ad is shown in your app. Everyone wins, the user gets to use your app without paying, the advertiser gets a targeted audience, and you get paid. Nice! So how does it actually work?

Ads are supplied by our ad partner and come in three different types: banner, full screen and text. Before you can begin placing ads, you must first register your app with Inneractive. Once registered, you will be provided with a unique key for your app, which you must register with LiveCode. You will now be ready to place ads, using the mobileAdCreate command.

Registering Your App Key
Before you can begin creating ads, you must first register your app's unique identifier. All ad activity, including any revenue generated, will be logged against this id:

mobileAdRegister appKey

Creating & Managing Ads
Once your app key has been registered, you are now ready to create an ad. To do so, use the
command mobileAdCreate.

mobileAdCreate ad, [type], [topLeft], [metaData]

The parameters are as follows:

  • type: The type of ad. One of "banner", "text" or "full screen". Defaults to "banner".
  • name: The name of the ad to create. This will be used to reference the ad throughout its lifetime.
  • topLeft: The location in pixels of the top left corner of the ad. Defaults to 0,0.
  • metaData: An array of values that will be used to target the ad. The keys are as follows:
    • refresh: A value in seconds defining how often the ad will refresh, between 30 and 300. Defaults to 120.
    • age: An integer defining the expected age of the target user.
    • gender: The expected gender of the target user. The allowed values are M, m F, f, Male, Female.
    • external id: An application specific id – the id of the requesting device in the partner's domain.
    • distribution id: The distribution Channel ID (559 for banner ads and full screen ads, 600 for text ads).
    • phone number: The user's mobile number (MSISDN format, with international prefix).
    • keywords: Keywords relevant to this user's specific session (comma separated, without spaces).

The internet permissions checkbox must be ticked in the Standalone Application Settings. It is also recommended that both the fine and coarse location checkboxes are ticked. This allows the ad served to be tailored to the user's location. Ads can be deleted at any time using the command mobileAdDelete.

mobileAdDelete ad

You can get and set the top left of an ad using the following:

mobileAdGetTopLeft(ad)

mobileAdSetTopLeft(ad, topLeft)

The top left is the pixel coordinates of the top left corner of the ad.

You can get and set the visibility of an ad using the following:

mobileAdGetTopVisible(ad)

mobileAdSetTopVisible(ad, visible)

The visible is a boolean, set to true if the ad is visible, false otherwise.
A list of all the currently active ads can be fetched using the function:

mobileAds()

This returns a return-delimited list of the ad names.

Cross-Mobile Note: This feature will work in the same way on both Android and iOS platforms.

I hope I've given you some idea of what you can expect in LiveCode 5.5. We can't wait to launch this important release! In the meantime don't forget that if you make a purchase of LiveCode now, you will of course receive this update free.

Mark

About the Author

Heather Nagey is Customer Services Manager for RunRev Ltd.

 

Main Menu

What's New


Get MobGUI free with a LiveCode purchase