6. September 2012 04:15
Jeff made the demo project available via Git: https://github.com/spartyspartan/TweetScan
Resources on Win8: http://goo.gl/Wu4NH
Here are a few things you need to know about developing a win8 RT app on the JS stack (some of these would apply to a xaml app on WinRT, too):
- You can't reference js from a CDN or internet; has to be local. The app has to be able to run disconnected, and has to be run in one security context
- In un-snapped view, the app layout needs to scroll horizontally, not vertically
- The app is suspended when it is not visible. After a while, if resources get low, Win8 will terminate your app and not tell you! So, on receiving the suspend event, assume you are/will be terminated because there is no event for terminated and go ahead and save state or whatever you need to do.
- You have to have win8 & vs12 to develop the apps – they use WinJs which relies on WinRT
- The app has to support snap view – when the app gets snapped to the side. At that point, it needs to either scroll vertically or handle the change gracefully. For instance, a game might just put up a “paused” screen in that case.
- The most common architecture will probably be a single-page-app. You can use js namespaces to avoid script collissions.
- Make sure to check the project’s manifest in the package settings to set the capabilities and available declarations so that the app can access more than just the Internet.
- You can hook into the Search/Share/Settings charms to set up how your app will interact with these
- You can add custom buttons to the app bar – be sure to check the metro design guidelines for where to put global vs context-sensitive tools.
- The app store reviews all apps. If you are selling yours, there is a tiered pricing structure starting at $1.99. MS takes 30% of sales up to $25k, and 20% after. If you don’t sell the app, it can be added to the store for free and MS provides advertising tools (or you can use others), and you can still use a payment gateway in the app without having to pay MS. So, the only time you pay MS is if the app is for sale. There are very easy ways to make it a trial software for 7/14/30 days (e.g.) and MS will handle users trying to trick the trial by uninstall/reinstall or other means.
- When an app is off-screen, it gets 0 CPU. A device can have up to 7 apps that are running background processes (think email, IM), and the user will choose which of their apps win if there are >7, so don’t assume your background polling process will be running if your app is suspended. You can also do live tiles for the start screen that use push notifications or toast notifications, and this is a free service that MS provides. For some rare cases, like a skype app, there are ways to keep a connection open even if the device is locked.
- You can have multiple tiles for one app – think a separate tile for each stock you are tracking in the financial app.