Posted on by

Tomorrow’s daily build (942) is going to be action-packed!

Improved Android audio

Ask our engineers and they’ll tell you that getting audio right on devices is hard. Even Apple gets it wrong — constantly — but they just get it less wrong than everyone else.

Starting in daily build 942, we’ve upgraded our audio backend to start using OpenSL-ES on Android 2.3+ devices. (On 2.2, we’ll continue to use the less than stellar AudioTrack path.)

What does this back-end do?

For starters, it fixes a perennial problem on a small subset of devices where audio just wouldn’t work (e.g. the Vizio, one of the Samsung SII models, etc). In addition, you may notice subtle performance improvements, but because of Android issues, your mileage may vary. For example, distortions like hisses and pops due to playing too many simultaneous sounds may be slightly improved.

If you played with the ‘EggBreaker’ sample, you’ll know notice that the sound doesn’t play at the same time as the bounce. This is a longstanding latency problem that has plagued Android from the beginning, meaning it’s one of the oldest core OS issues out there. The recent changes ameliorate this ever so slightly. However, the biggest improvement (it’s not perfect) has come from a core OS change in Android, which is only available starting in JellyBean (Android 4.1).

New Widgets!

We’ve been hard at work at revamping and cleaning up our widget framework. When we created the initial framework, we took a lot of shortcuts that made a lot of the original code brittle, fragile, and just unmaintainable.

Now, there are a lot of things we want to do with the widget framework, but the foundation simply wasn’t there. What we’ve decided to do is rethink how we want the guts of each widget to work. So we’re building a new foundation for widgets.

The danger with rewrites is that you end up burning cycles reinventing the wheel with nothing to show for it. What we decided would make more sense is to build new widgets on top of this foundation, make sure it’s solid, and then transition the old widgets to it.

Daily build 942 will offer several new widgets:

  • On/Off Switch. This comes in 3 flavors: an actual on/off switch, a checkbox, and a single radio button.
  • Spinner. The canonical use-case is lots of photos being download asynchronously. Note if you make a blocking API call (e.g. a luasocket call), this will not animate. For that case, you should use native.setActivityIndicator().
  • Stepper. You tap ‘+’ or ‘-’ and the values go up and down within a predefined range.
  • Progress view. A bar that goes from 0% to 100% filled.

More information will be available in the daily build 942 snapshot of the API docs. That build will also include an updated WidgetDemo sample app (Note: Windows users, the sample will be updated in a daily build to follow).

The next widgets on our hit list are segmented controls and search fields.

A Teaser

Finally, I’m going to talk about something that I’m not really going to talk about — yet. What I mean is, this topic deserves a post of its own, so we’re saving that for next week. What am I talking about?

In daily build 942, you’re going to see this little gem:

Android: Added local/scheduled notification support.

And there’s a lot that went behind that one commit summary. It’s the kind of thing that will make you thank your lucky stars you are using a cross-platform development framework like Corona.

Suffice it to say, notifications are very different across platforms. We could have just passed the buck, pushing those differences to you, and said: “Tough, deal with it!” but as I said at the end of last week’s post, you expect more from us.

In other words, we work through the big challenges so that it’s zero work for you.


Posted by . Thanks for reading...

15 Responses to “Improved Android audio + new widgets + a teaser”

  1. Ferdi

    I’m thankful for all the updates that we get, but when are we going to see a better newText or newTextBox function? One that allows line-height, letter-spacing, paragraph alignment, etc? I’d say that would be a high priority.

    Thanks for the update, though!

    Reply
  2. Dave Baxter

    The trouble with all these updates is, I have to keep changing my app to implement them ;-)

    3 widgets from this will be going straight into 2 of my apps.

    Dave

    Reply
  3. J. A. Whye

    As someone who’s using Corona SDK for more and more business-type apps, I’m very happy to see this update. Looking forward to the rest of the widget updates, too. :)

    Jay

    Reply
    • Mitaten

      Agreed! Also those searchfield widgets sound awesome, can’t wait to replace my homemade one with the widget! There is however a bug with the search fields which I think will complicate the usage of the widget, a bug that has been in the bugbase for about 3 months without any light. It would be great if you guys could take a look at bug #15926 :-)

      Thanks!

      Reply
    • sondlerd

      I agree, the widget updates are great and needed! Kudos to the loading, slider and yes/no widgets.

      When will we see just a little bit of Error Handling, though? Try Catch blocks or some sort of global exception catch. PCall just doesn’t cut it.

      thanks

      Reply
  4. Ivke

    I’m also very happy to see some Widget updates for my business apps.

    Can we expect more widgets besides the segmented controls and search fields?

    Ivo

    Reply
  5. Gary

    As someone who mostly makes business apps its great to see the new widgets. This does come just a few weeks after I programmed up my own on/off toggle switch. Nagdammit!

    Reply

Leave a Reply

  • (Will Not Be Published)