Show Start Page
Next, you will set up the server content to be displayed in the WebView.
The rest of this tutorial considers the game server domains to be as shown below, but you should keep in mind that you will be substituting the domain or IP address of the development environment you are using.
Development game server
Production game server
The content in a WebView application that uses the Shell App Framework is displayed via the gadget server, therefore, you must set up gadget.xml where the starting URL is defined.
Create gadget.xml for the Sandbox environment as follows and define the start page of the game.
This gadget.xml definition displays http://dev.gameserver.com/index.html, which is the start page of a game on the development game server when the game is to be accessed from a smartphone (the view attribute is touch).
Place the gadget.xml described above on the game server so that it is identified as http://dev.gameserver.com/gadget.xml and register it on the Mobage Developer Site.
Click "Common" tab on "Manage Application" screen, press the "Change the information" button, and registerhttp://dev.gameserver.com/gadget.xml for the URL of gadget.xml.
To use a game server domain other than the start URL that was recorded in gadget.xml, you must add it to the whitelist. Note that a link to a domain that is not specified in the whitelist will end up being recognized as an external site, an intermediate page will be inserted, and the link will be displayed in an external browser outside of the application.
Although it will not be used in the tutorial, add the provisional domain dev2.gameserver.com to the whitelist at this time.
Normally, when gadget.xml is parsed, the start URL information is displayed as follows.
Note that when gadget.xml is registered, its contents are cached by the platform. Therefore, if gadget.xml is modified, you must click "Refresh" to clear the cache.
Creating the Start Page
Finally, create the following simple index.html file and place it so that it is located at http://dev.gameserver.com/index.html, which is the URL of the start page.
Displaying the Start Page in the Sandbox
Try to access the Sandbox from the actual device and see if the start URL of the game is displayed. You can access the Sandbox from a browser to send a smartphone user agent for debugging.
Verify the Sandbox development URL, which is displayed on the "SP Web" tab on the Mobage Developer Site and try accessing it from the browser.
Log in to the Sandbox environment using the test account that you created. (Login as MobageID)
Please see here about createing a test account.
If the start page is displayed as shown below, it indicates successful processing.
This completes the registration of gadget.xml and display of the start page.
For more information about the detailed schema of gadget.xml, please see here.
- Initial release