How to export to appMobi with directCanvas

1

Stats

6,869 visits, 12,541 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 14 May, 2012. Last updated 28 Feb, 2019

The Intel® XDK provides HTML5 publishing services. Like PhoneGap, this allows you to package up your game as a native iOS or Android app and publish it to the app stores.

Intel also provide a technology called App Game Interfaces which boosts the performance of games using hardware acceleration. This can result in a 5-10x performance increase, often resolving performance problems. This is similar to the CocoonJS technology.

Note: the Intel® XDK and App Game Interfaces were formerly known as appMobi and directCanvas respectively before Intel acquired them. Please note some older materials may still refer to the appMobi or directCanvas names.

Use the Intel AGI object

By adding the Intel AGI object to your project you can access Intel AGI specific features. For example, you can force a specific orientation by using Set auto-rotate to prevent auto-rotate followed by the Set orientation action.

Create an XDK project

To get started, sign up an account with Intel. Then, launch the Intel XDK. It is recommended to use Google Chrome browser. The XDK is the testing space for your app, and you can test and publish to real devices with it. You may see some Java security prompts. Make sure you allow it to run.

Click the 'Start new project' button.

Leave Type as Client side, and click Next.

Enter a project name, e.g. MyProject. The ID will automatically set to something like YourCompany.MyProject. Click Next.

In the API Injection screen, you do not need to change anything. Click Next.

After your app is created, click Finish.

You should now be seeing a device emulator, with a picture of a device like an iPhone or iPad showing a blank placeholder app.

There are also controls to test on different devices, and to change the device orientation or simulate the accelerometer. This can help you test simple features if you do not have a real device, although testing on a real device is always preferable.

Exporting to the Intel XDK

In Construct 2's Export Project dialog, select Export for Intel XDK.

For the export folder, you need to select the folder for the XDK project that was created previously. This will overwrite the blank template project with your Construct 2 game. By default this is a folder in Documents something like this:

Documents\Intel XDK\MyCompany.MyProject\3.4.0[/b]

Notice the folder with the version number at the end - this contains the actual project. Exporting to the parent folder will not overwrite the blank template project.

In the next screen, you can decide whether or not to use App Game Interfaces.

The options are as follows:

Use App Game Interfaces: use Intel's App Game Interfaces technology (formerly known as directCanvas) to boost performance with hardware acceleration. This can improve performance by 5-10x. It is highly recommended to use this if it works, since the performance can be significantly better. Note for technical reasons not all of Construct 2's features can be supported in this mode. See the section on compatibility below for more information.

Use phone browser: use the phone's built-in browser to run the game. This does not currently use any other browser, so it makes no difference if the user installs another browser (e.g. Firefox for Mobile), it will still use the built-in browser. Since many devices have slow browsers, performance can be significantly worse with this option. However, it works with all features that the device's browser supports.

For best performance, it is recommended to use App Game Interfaces whenever possible.

Once you have exported over the existing project, click the Reload button in the XDK.

Your game should now appear running in the device emulator.

App Game Interfaces compatibility

The following features are not supported by the App Game Interfaces, but should be supported when using the phone browser.

- The form control plugins Textbox and Button are not supported.

- The AJAX object is not supported.

- the XML object is not supported.

- The Facebook object is not supported.

- The letterbox fullscreen modes are not supported. If they are selected, it will fall back to simple Scale mode instead.

- The Text plugin's 'Set web font' action is not supported.

- Most features of the Browser object are not supported.

Testing your game

There are two ways to test your game:

Test on Local Wifi: test your game over a local Wifi network.

Test Anywhere: test your game over the Internet.

You'll also need to install the app•lab app to be able to test using these options.

app•lab for Android on the Google Play store

app•lab for iOS on the Apple app store

Note: directCanvas is not yet supported on Android.

Click the relevant button to test. Then visit the following URL on your mobile device's browser:

http://services.appmobi.com/mobile

You'll need to log in with your Intel account. Then you can see a list of your apps. Inside each are two options to Test Local or Test Anywhere. Press the one which matched the button you pressed in the XDK. Your game should launch on the device.

Note: if you have exported for App Game Interfaces (currently iOS only), you should be able to test the performance boost by testing this way. Preview on LAN from Construct 2 always uses the phone browser so will not reflect the performance boost that App Game Interfaces gives you.

Building for the app store

Click the Build for app store button in the XDK.

The XDK will guide you through the process of building for the Android or iOS app stores. You can either request the XDK take care of the process for you, or go through the process yourself, which can be a little complicated. If you are exporting to iOS you'll need to be a registered iOS developer.

  • 0 Comments

Want to leave a comment? Login or Register an account!