Permalink
Browse files

WebAppSplashScreen: Created app to show how to display a plain splash…

… screen while loading HTML in the WebView.
  • Loading branch information...
1 parent 889c48a commit c28f96a5a3c03ef058234b4c8012fbae28e89b84 Mikael Kindborg committed Mar 20, 2013
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<buildSequence>
+<buildStep type="com.mobilesorcery.sdk.html5.debugsupport"/>
+<buildStep type="resource"/>
+<buildStep type="compile"/>
+<buildStep type="link"/>
+<buildStep type="pack"/>
+<buildStep type="copy.build.results"/>
+</buildSequence>
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="org.eclipse.cdt.core.default.config.919617267">
+ <storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.919617267" moduleId="org.eclipse.cdt.core.settings" name="Configuration">
+ <externalSettings/>
+ <extensions/>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.pathentry">
+ <pathentry kind="con" path="com.mobilesorcery.mosync.includepaths"/>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+</cproject>
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project supports-build-configs="true" version="1.5">
+<build.cfg id="Debug" types="Debug"/>
+<build.cfg id="Release" types="Release"/>
+<criteria>
+<filter type="com.mobilesorcery.sdk.capabilities.devices.elementfactory">
+<capabilities optional="" required="HTML5"/>
+</filter>
+</criteria>
+<properties>
+<property key="build.prefs:additional.libraries" value="MAUtil.lib, NativeUI.lib, MAFS.lib, Wormhole.lib, yajl.lib, Notification.lib"/>
+<property key="build.prefs:additional.libraries/Debug" value="MAUtilD.lib, NativeUID.lib, MAFSD.lib, WormholeD.lib, yajlD.lib, NotificationD.lib"/>
+<property key="build.prefs:memory.data/Debug" value="4096"/>
+<property key="build.prefs:memory.data/Release" value="4096"/>
+<property key="build.prefs:memory.heap/Debug" value="3072"/>
+<property key="build.prefs:memory.heap/Release" value="3072"/>
+<property key="build.prefs:memory.stack/Debug" value="512"/>
+<property key="build.prefs:memory.stack/Release" value="512"/>
+<property key="com.mobilesorcery.sdk.html5.support" value="true"/>
+<property key="profile.mgr.type" value="0"/>
+<property key="template.id" value="project.html5.hybrid"/>
+</properties>
+</project>
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>WebAppSplashScreen</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.mobilesorcery.sdk.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.mobilesorcery.sdk.core.nature</nature>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ </natures>
+ <filteredResources>
+ <filter>
+ <id>1363786451762</id>
+ <name></name>
+ <type>6</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-true-.*rebuild.build.cpp</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
+</projectDescription>
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<!--
+* @file index.html
+*
+* Template application that shows how to send custom messages to C++
+* using the HybridMoblet class. The C++ support code is implemented
+* in file main.cpp.
+-->
+<html>
+ <head>
+ <meta name="viewport" content="width=320, user-scalable=no">
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <title>Wormhole Template App</title>
+ <link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8">
+ <script type="text/javascript" charset="utf-8" src="js/wormhole.js"></script>
+ <script type="text/javascript">
+ /**
+ * Displays the device information on the screen.
+ */
+ function displayDeviceInfo()
+ {
+ document.getElementById("platform").innerHTML = device.platform;
+ document.getElementById("version").innerHTML = device.version;
+ document.getElementById("uuid").innerHTML = device.uuid;
+ document.getElementById("name").innerHTML = device.name;
+ document.getElementById("width").innerHTML = screen.width;
+ document.getElementById("height").innerHTML = screen.height;
+ }
+
+ /**
+ * Vibrate device.
+ */
+ function vibrate()
+ {
+ mosync.bridge.send(["Custom", "Vibrate", "500"]);
+ }
+
+ /**
+ * Play one beep sound.
+ */
+ function beep()
+ {
+ // Send message to C++ to make device beep.
+ // Here we used the string stream format.
+ mosync.bridge.send(["Custom", "Beep"]);
+ }
+
+ /**
+ * "Dry-run" the ability to call JS in another WebView.
+ * Note that we call back into this very same WebView,
+ * just for testing purposes. This is useful in a NativeUI
+ * app that has multiple WebViews that need to communicate.
+ */
+ function changeColor()
+ {
+ mosync.nativeui.callJS(
+ mosync.nativeui.MAIN_WEBVIEW,
+ "performChangeColor()");
+ }
+
+ /**
+ * Change page background to a random color.
+ */
+ function performChangeColor()
+ {
+ var color = "#" +
+ (Math.random() * 0xFFFFFF + 0x1000000)
+ .toString(16).substr(1,6);
+ document.documentElement.style.backgroundColor = color;
+ document.body.style.backgroundColor = color;
+ }
+
+ // Register event listeners.
+
+ // The "deviceready" event is sent when the system
+ // has finished loading.
+ document.addEventListener(
+ "deviceready",
+ displayDeviceInfo,
+ true);
+
+ // Close the application when the back key is pressed.
+ document.addEventListener(
+ "backbutton",
+ function() { mosync.app.exit(); },
+ true);
+ </script>
+ </head>
+ <body>
+ <div id="screen">
+ <div class="pane" id="heading">Customized Wormhole Technology</div>
+ <div class="pane" id="info">
+ <div class="infoItem">Platform: <span id="platform">&nbsp;</span></div>
+ <div class="infoItem">Version: <span id="version">&nbsp;</span></div>
+ <div class="infoItem">UUID: <span id="uuid">&nbsp;</span></div>
+ <div class="infoItem">Name: <span id="name">&nbsp;</span></div>
+ <div class="infoItem">Width: <span id="width">&nbsp;</span></div>
+ <div class="infoItem">Height: <span id="height">&nbsp;</span></div>
+ </div>
+ <div class="pane button" onclick="vibrate()">Vibrate</div>
+ <div class="pane button" onclick="beep()">Beep</div>
+ <div class="pane button" onclick="changeColor()">Change Color</div>
+ </div>
+ </body>
+</html>
Oops, something went wrong.

0 comments on commit c28f96a

Please sign in to comment.