Important update for the NativeMaps ANE

As of today, we've released an important update to the NativeMaps ANE.

Summary of features

  • Android 4.4 (KitKat) visibility problems fixed (see below for information)
  • Added functionality to get BitmapData of map view in Android
  • Android NativeMapEvent.MAP_CREATED event should now be more reliable
  • Important: New meta tag required for Android descriptor (see below)

Android 4.4 fixes
The main addition is a fix to resolve problems with the map visibility on devices running Android 4.4 (KitKat). Using the new version of the Android NativeMaps ANE (version 2.0), maps should now be visible on KitKat devices.

Unfortunately there is a downside to this, because of the change in z-order rendering required, the UI buttons on the map will not be visible in KitKat. This includes the zoom controls and the user location control buttons which normally appear above the map. It's recommended to provide additional UI controls in your application if these buttons are required.

Android BitmapData now available!
Retrieving a BitmapData object of the map view is now possible in Android. The old method (for iOS) drawMapToBitmapData() is now deprecated in favour of the new method requestMapBitmapData().

You should now listen for the new event type NativeMapBitmapEvent.READY, and retrieve the BitmapData object from the event payload. This is standard across iOS and Android now.

AIR SDK
It's strongly recommended to use the AIR 4.0 SDK or newer for your application. The fixes for the NativeMaps ANE on Android may not work correctly for older versions of the AIR SDK.

New meta tag required for Android descriptor
As of this version, you must now include an additional meta tag in your descriptor XML. The following entry should be added inside the section of your Android manifest. You can place it below the google maps API key entry.

<meta-data android:name="com.google.android.gms.version" android:value="4030500"/>

Also, you must ensure that your Android manifest permissions include android.permission.ACCESS_NETWORK_STATE

As always, please let us know if you encounter any problems!

Native Extensions // Support Site

After over a year of trying to handle support through email we've finally got a forum, feature requests and knowledge base up and running for the native extensions.

We'd love all our users to check it out, enter any suggestions for future ANE's, and to discuss any questions you may have regarding the use of the ANE's.

support-screenshot-1

We've tried out several solutions and have decided to use the awesome Uservoice platform. We're hoping this will improve all our native extension users experience with our support and help you to get going with the native extensions faster.

http://distriqt.uservoice.com

Using the NativeMaps ANE with Starling/Feathers

We generally use Starling & Feathers to build most of our iOS and Android apps these days. The performance of Starling is great, and while Feathers is mostly aimed at game development, it's an awesome framework for building regular apps as well.

Recently we were building an app which also used our NativeMaps native extension (check it out here: labs.distriqt.com/native-extensions)

One issue with this, however, is that because of the way Starling runs on the GPU, it severely affected the interaction and performance of the native maps interface on iOS. (I'm not sure of the effects on Android, but we used the same technique here across platforms.)

This post is a rough guide to the way we worked around the problem in order to get better performance from the map UI.

Continue reading Using the NativeMaps ANE with Starling/Feathers

iPhone 5 Optimization Requirement

All applications as of the 1st of May must now support the iPhone 5 resolution.

iPhone 5 Optimization Requirement - Your binary is not optimized for iPhone 5. As of May 1, all new iPhone apps and app updates submitted must support the 4-inch display on iPhone 5. All apps must include a launch image of the appropriate size. Learn more about iPhone 5 support by reviewing the iOS Human Interface Guidelines.

There is a little trick to get your AIR application to use the new resolution, you need to include a new Default image, otherwise you're application will always appear in the iPhone 4's resolution.

This new image must have the following:

  • Named: Default-568h@2x.png
  • Resolution 640w x 1136h

And make sure you package it with your application.

Native Maps ANE – New features and changes

We've released another update to the NativeMaps ANE, which includes some new features and changes.

Getting BitmapData of the map view (iOS only)
Firstly, we've added a new method to allow you to draw the current map view to a BitmapData object on iOS. Unfortunately due to the way Android renders maps internally, it is currently not possibly to do this in the Android version.

Example:

var bmd:BitmapData = NativeMaps.service.drawMapToBitmapData();

Custom marker icon changes
This is a breaking change to the way custom marker icons are used. This new method should make it easier and less memory intensive when using a lot of custom icons.

This example shows how you should create and use custom markers now:

var icon:CustomMarkerIcon = new CustomMarkerIcon("myCustomIcon", someBitmap.bitmapData);
NativeMaps.service.addCustomMarkerIcon( icon );

var marker:MapMarker = new MapMarker("someMarker");
marker.customIconId = "myCustomIcon";

This new change also fixes a possible bug that could have occurred when using many different custom markers on a map.

As always we'd love to hear feedback about our ANEs, so feel free to get in touch.

Native Extensions // Using Native Extensions

This tutorial will cover adding a Native Extension for Adobe AIR to your application.
We are going to be focusing on the native extensions developed by distriqt, but this guide should apply to any native extension (ANE).

Native Extensions for Adobe AIR are code libraries that contain native code wrapped with an ActionScript API. Native extensions provide easy access to device-specific libraries and features that are not available in the built-in ActionScript classes.

Their usage is similar to a SWC package of precompiled Flash symbols.

In the following tutorial we’re going to go through the process of adding an ANE to your AIR application using some of the most common AIR development tools. We assume you already understand the process of developing and deploying mobile applications using AIR so will just be concentrating on the additional steps required to get an ANE working.

Read the full tutorial online
Tutorial // Using Native Extensions
Download a pdf of the tutorial
Download PDF

Native Extensions // Push Notifications Tutorial // Part 2

This tutorial is the second part of our tutorials covering setting up and running the Push Notifications Native Extension for Adobe AIR from distriqt.

The Push Notifications extension enables the push notification functionality in your mobile AIR application allowing you to send (or push) notifications and data to users of your application. The extensions API will have you up and running with remote notifications in minutes.

Importantly this extension allows you to write code once and have access to push notifications on multiple platforms allowing you to quickly integrate push notifications no matter what platform you are developing for!

In this tutorial we will run through the concepts involved in getting your application setup and running with push notifications including:

  • Including the extension in your application
  • Registering for notifications
  • Listening for notifications
  • Sending a test notification

Continue reading Native Extensions // Push Notifications Tutorial // Part 2

Native Extensions // Push Notifications Tutorial // Part 1

This tutorial will cover setting up and running the Push Notifications Native Extension for Adobe AIR from distriqt.

With the Push Notifications extension enables the push notification functionality in your mobile AIR application allowing you to send (or push) notifications and data to users of your application. The extensions API will have you up and running with remote notifications in minutes.

Importantly this extension allows you to write code once and have access to push notifications on multiple platforms allowing you to quickly integrate push notifications no matter what platform you are developing for!

In this first tutorial we will run through the concepts involved in getting your application setup and running with push notifications including:

  • Setup and registering certificates for APNS
  • Setup for GCM

Continue reading Native Extensions // Push Notifications Tutorial // Part 1

Native Extension Tip // iOS Push Notification Custom Sound

Playing a custom sound when a push notification arrives from the Apple Push Notification Service (APNS) is quite simple.

This tip assumes you're using our extension and that you've already got push notifications running.

Firstly you need to create your sound and export as an iOS supported format, such as caf.

Then you need to include the sound to your AIR application and make sure it's packaged with the application. If you are using adt then you just need to make sure it's included as a packaged resource in your script / command line. In Flash Builder you should make sure the sound is checked to be packaged in the following location:

Project / Properties / Actionscript Build Packaging / Apple iOS / Package Contents

To play this sound you must specify the filename of the sound in the notification payload. For example, lets say you've added a sound file named example.caf into your application, we can play this sound with the notification payload as below:

  1. {
  2. aps =
  3. {
  4. alert = "test example notification message";
  5. sound = "example.caf";
  6. };
  7. }

Then the custom sound will play when your notification arrives.