Download SB1 User Guide

Transcript
CHAPTER 6
ADDITIONAL NOTES
The following notes are recommendations and best practices for using the SB1 Shell.
• Please refrain from using the JQueryMobile library when developing SB1 applications as it can use a
significant amount of memory at run time, which could lead to low memory issues on the SB1
NOTE Developers should reference the internal shell ASL.
• Integration of the asl library in all pages of the client application prevents unexpected behavior of the
SB1 Shell.
• All the application pages must refer to asl.js from the SB1 location as a first line in head tag.
Example
<head>
<script type="text/javascript"
src="http://127.0.0.1:83/Application/www/sapp/src/asl.js"></script>
</head>
• It is recommended to call the asl.back, asl.title and asl.options functions on every page as they are
persistent across page loads and may cause unexpected behavior of a client application. For example, if
you set the title on one page and do not set the title on the next page, the next page uses the previously
set title.
• Always clear application data (sessionStorage, localStorage, cookies, databases, caches when
application onExit/onKill or onCradleInsert events). This prevents unexpected behavior of an application.
• It is recommended that all JavaScript calls in a page should be done in asl.events.types.loaded event
subscription. This ensures application developers that the page is loaded and the communication
between SB1 Shell and the client application has already been setup. . It is recommended that use
asl.events.types.loaded event subscription instead of body onload or DOMContentLoaded.
• Careful consideration of the scope of application variables. Some of the callback functions that
application developers can define might be executed in a completely different scope than the one that is
expected. This prevents applications and callbacks from crashing.
• Logging of application specific events or errors in RhoElements log is important for future debugging of
the applications.