This new service expands on our previous web app solution, which enabled hosted mobile web sites to publish apps to the Amazon Appstore. This works well for thousands of mobile web developers who are already serving content to the web, and we'll be continuing to offer hosted web apps in the future. But for many other developers, hosted apps aren't an ideal solution - they might not have a server, don't want to deal with the extra burden and cost of maintaining a server-side host for their app, or want their app to work seamlessly while offline.
Amazon's packaged web app solution solves this problem by letting web developers bundle all the files needed for their app into a zip file. Similar to other pure HTML5 solutions, web developers can submit apps to the Amazon Appstore without any need to worry about native packaging or distribution. Developers can concentrate on creating cutting edge web apps that take advantage of the advanced capabilities of our Chromium-based Amazon WebView available on our Kindle Fire tablets, or create more cross platform web apps that run on any device where Amazon Appstore is installed. Web developers can focus on creating great apps, and Amazon takes care of the native app creation and hosting process.
How to Package Your HTML5 Web App
Creating a new packaged app is as simple as creating any other type of zip file. Make sure the app has an index.html file as its starting page, or indicate the path to the app's main launch page when submitting the app. To ensure the app works offline, include all those assets as well.
A packaged HTML5 app project looks and works like a normal web project folder on a server. For example:
./project/index.html ./project/js/main.js ./project/js/libs/jquery.min.js ./project/css/main.css ./project/images/logo.png ./project/images/picture.jpg ... etc.
You can use a GUI application like WinZip, or using zip from the command line. This command for zipping a folder will result in the basic zip file you need:
$ zip -r project.zip ./project adding: project/ (stored 0%) adding: project/css/ (stored 0%) adding: project/css/main.css (stored 0%) adding: project/images/ (stored 0%) adding: project/images/logo.png (deflated 7%) adding: project/images/picture.jpg (deflated 1%) adding: project/index.html (deflated 47%) adding: project/js/ (stored 0%) adding: project/js/libs/ (stored 0%) adding: project/js/libs/jquery.min.js (deflated 65%) adding: project/js/main.js (deflated 69%)
Testing Your Packaged Web App
The Amazon Web App Tester has been upgraded to handle packaged web apps as well. If you're not familiar with the Web App Tester, check out this blog post, Getting the most out of the Web App Tester, which shows you how to use it to test your web app before submission, including enabling and using the Remote Development Tools and other tips and tricks.
In addition to entering URLs for hosted web apps, developers can now load their zipped web app files on to the device, which will be pulled in by the Web App Tester for viewing/debugging. Using the Android File Transfer tool, copy the zipped web app files you want to test to a folder in the root of the device:
The app package file should then show up in Web App Tester, where you can click Extract and use the app as per normal. You can also enter a URL pointing to a packaged zip file instead and follow the same steps above.
Submitting your HTML5 Packaged Web App to the Amazon Appstore
Developers need to follow the following simple steps to submit their web apps:
1. Create a Free Amazon Developer account.
2. Go to the New Web App Submission page and provide details about the packaged web app:
- General Information (title, category, support details, privacy URL)
- Availability and Pricing (release date and base list price)
- Images and Multimedia (screen shots, icons)
- Content rating
3. Choose whether or not to submit a hosted web app or a packaged web app. (In this case, the latter).
That's it! Creating HTML5 packaged apps for the Amazon Appstore is straight forward, but if you have any problems, be sure to check out the web app support forum, where you can find answers or post questions.
Amazon's packaged web apps are a great step forward for the open web. Creating cross platform apps using HTML5 technologies will enable a whole new class of apps created by a whole new generation of developers. We're excited to launch this new functionality and can't wait to see what developers do.