Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Three two one #399

Merged
merged 40 commits into from

6 participants

@asarrafi
Owner

No description provided.

grigaci and others added some commits
@grigaci grigaci MOSYNC-2880 "Slider doesn't FF the video on IOS"
Cenvert seek to value from milliseconds to seconds.
ba5c840
@grigaci grigaci MOSYNC-2896 "Send button not visible for LocalNotificationSender app …
…on iOS"
d2db98e
@spiridon-alexandru spiridon-alexandru MOSYNC-2884: changed the bing maps api key; added a Readme file to th…
…e native ui MapTest program
a89ae15
@spiridon-alexandru spiridon-alexandru MOSYNC-2884: small wp7 runtime map widget refactorization 6f43fe3
@grigaci grigaci MOSYNC-2905 "OK button from maAlert dialog not shown in LocalNotifica…
…tionSender"
8367db2
@grigaci grigaci MOSYNC-2906 "Fire date not working in LocalNotificationSender" 974ab79
@grigaci grigaci MOSYNC-2907 "Too small width for EditBox widgets in LocalNotification…
…Sender"
1be5363
@grigaci grigaci MOSYNC-2902 "Sensor test is scrambled on ipad" b86c4be
@spiridon-alexandru spiridon-alexandru MOSYNC-2884: added a readme file to the NativeUIMap example program e2bfbb1
mircea MOSYNC-2903. Fix for WikiSearchNativeUI crash. 0f57a23
Fredrik Eldh examples/soap: now uses our own soap server.
Third-party services are not reliable.
9c05468
Ali Sarrafi Merge pull request #383 from grigaci/ThreeTwoOne
Three two one
1ddd99d
@grigaci grigaci MOSYNC-2910 "EuropeanCountries have the alphabetic letter at the foot…
… of the list on Android"
2868d8d
@grigaci grigaci Merge remote-tracking branch 'origin/ThreeTwoOne' into ThreeTwoOne 6888a3c
Mikael Kindborg [MOSYNC-2908] Examples/Wormhole: Updated upload button text in PhotoG…
…allery, added disclaimer, and fixed a memory leak in the File Upload library.
ab9a7e4
Mikael Kindborg Merge remote-tracking branch 'origin/ThreeTwoOne' into ThreeTwoOne f3538f4
@emmaTresanszki emmaTresanszki MOSYNC-2899 WikiSearch crash because Content-length field from respon…
…se header cannpt be retrieved
f72d6e2
@emmaTresanszki emmaTresanszki MOSYNC-2899 Part Two bc8da0c
Ali Sarrafi Merge pull request #388 from emmaTresanszki/ThreeTwoOne
MOSYNC-2899 WikiSearch crash because Content-length field from response ...
52bc927
Ali Sarrafi Merge pull request #387 from divineprog/ThreeTwoOne
MOSYNC-2908 PhotoGallery updated
9719a85
Ali Sarrafi Merge pull request #386 from mvasiliniuc/ThreeTwoOne
MOSYNC-2903. Fix for WikiSearchNativeUI crash.
cbbf599
Ali Sarrafi Merge pull request #385 from grigaci/ThreeTwoOne
MOSYNC-2910
6b1dff2
@emmaTresanszki emmaTresanszki MOSYNC-2920 LocalNotification destroy bug: it also cancelled the pend…
…ing intent
e446d50
@emmaTresanszki emmaTresanszki Merge branch 'ThreeTwoOne' of https://github.com/MoSync/MoSync into T…
…hreeTwoOne
b81862e
@milesm milesm Merge pull request #389 from emmaTresanszki/ThreeTwoOne
MOSYNC-2920
d8dfd84
Spiridon Alexandru MOSYNC-2884: - fixed - the crash was due to a string to double
conversion: on Lumia 920, '.' was not considered as a separator of the
integer and fractional part of the number so the resulting parsed
double value was very large and setting a label font size to a very
large value lead to an unhandled exception -> a crash. The parsing
now takes into consideration the dot as a separator.
d78472d
Spiridon Alexandru Merge remote-tracking branch 'origin_master/ThreeTwoOne' into ThreeTw…
…oOne
c675f91
Eric Svensson [WORMHOLE-3] Push Notification callback receives message string with …
…correct escaping
e192611
@milesm milesm Merge pull request #393 from Sionarch/ThreeTwoOne
[WORMHOLE-3] Push Notification callback receives message string with cor...
4cdc079
@spiridon-alexandru spiridon-alexandru MOSYNC-2884: small code review issue fixed d2115ae
@spiridon-alexandru spiridon-alexandru Merge remote-tracking branch 'github_origin/ThreeTwoOne' into github_…
…sandbox_threetwoone
6684296
@andersmalm andersmalm Fix for MOSYNC-2926. iOS memory leak in maWidgetSetProperty 6403e74
@spiridon-alexandru spiridon-alexandru Merge remote-tracking branch 'github_sandbox/ThreeTwoOne' into github…
…_sandbox_threetwoone
762c167
@milesm milesm Merge pull request #396 from andersmalm/ThreeTwoOne
Fix for MOSYNC-2926. iOS memory leak in maWidgetSetProperty
c431e67
@milesm milesm Merge pull request #394 from spiridon-alexandru/ThreeTwoOne
Map crash fixed
e17b192
Mikael Kindborg [MOSYNC-2930] Examples: Updated HTML5 examples to use appropriate UTF…
…-8 encoding attributes.
e634d9c
Mikael Kindborg Merge remote-tracking branch 'origin/ThreeTwoOne' into ThreeTwoOne 62ae5b0
@milesm milesm Merge pull request #397 from divineprog/ThreeTwoOne
MOSYNC-2930 Examples: Updated HTML5 examples to use appropriate UTF-8 encoding attributes.
1da8bba
mvasiliniuc MOSYNC-2903. Fix space replacement issue in url title. d6e6031
@milesm milesm Merge pull request #398 from mvasiliniuc/ThreeTwoOne
MOSYNC-2903. Fix space replacement issue in url title.
7befd7b
@asarrafi asarrafi merged commit f4a9b18 into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 1, 2013
  1. @grigaci

    MOSYNC-2880 "Slider doesn't FF the video on IOS"

    grigaci authored
    Cenvert seek to value from milliseconds to seconds.
  2. @grigaci
  3. @spiridon-alexandru
  4. @spiridon-alexandru
Commits on Mar 3, 2013
  1. @grigaci
  2. @grigaci
  3. @grigaci
Commits on Mar 4, 2013
  1. @grigaci
  2. @spiridon-alexandru
  3. examples/soap: now uses our own soap server.

    Fredrik Eldh authored Ali Sarrafi committed
    Third-party services are not reliable.
  4. Merge pull request #383 from grigaci/ThreeTwoOne

    Ali Sarrafi authored
    Three two one
Commits on Mar 5, 2013
  1. @grigaci
  2. @grigaci
  3. [MOSYNC-2908] Examples/Wormhole: Updated upload button text in PhotoG…

    Mikael Kindborg authored
    …allery, added disclaimer, and fixed a memory leak in the File Upload library.
  4. @emmaTresanszki
  5. @emmaTresanszki

    MOSYNC-2899 Part Two

    emmaTresanszki authored
Commits on Mar 6, 2013
  1. Merge pull request #388 from emmaTresanszki/ThreeTwoOne

    Ali Sarrafi authored
    MOSYNC-2899 WikiSearch crash because Content-length field from response ...
  2. Merge pull request #387 from divineprog/ThreeTwoOne

    Ali Sarrafi authored
    MOSYNC-2908 PhotoGallery updated
  3. Merge pull request #386 from mvasiliniuc/ThreeTwoOne

    Ali Sarrafi authored
    MOSYNC-2903. Fix for WikiSearchNativeUI crash.
  4. Merge pull request #385 from grigaci/ThreeTwoOne

    Ali Sarrafi authored
    MOSYNC-2910
  5. @emmaTresanszki
  6. @emmaTresanszki
  7. @milesm
  8. MOSYNC-2884: - fixed - the crash was due to a string to double

    Spiridon Alexandru authored
    conversion: on Lumia 920, '.' was not considered as a separator of the
    integer and fractional part of the number so the resulting parsed
    double value was very large and setting a label font size to a very
    large value lead to an unhandled exception -> a crash. The parsing
    now takes into consideration the dot as a separator.
  9. Merge remote-tracking branch 'origin_master/ThreeTwoOne' into ThreeTw…

    Spiridon Alexandru authored
    …oOne
  10. [WORMHOLE-3] Push Notification callback receives message string with …

    Eric Svensson authored
    …correct escaping
  11. @milesm

    Merge pull request #393 from Sionarch/ThreeTwoOne

    milesm authored
    [WORMHOLE-3] Push Notification callback receives message string with cor...
Commits on Mar 7, 2013
  1. @spiridon-alexandru
  2. @spiridon-alexandru
  3. @andersmalm
  4. @spiridon-alexandru
  5. @milesm

    Merge pull request #396 from andersmalm/ThreeTwoOne

    milesm authored
    Fix for MOSYNC-2926. iOS memory leak in maWidgetSetProperty
  6. @milesm
Commits on Mar 11, 2013
  1. [MOSYNC-2930] Examples: Updated HTML5 examples to use appropriate UTF…

    Mikael Kindborg authored
    …-8 encoding attributes.
  2. @milesm

    Merge pull request #397 from divineprog/ThreeTwoOne

    milesm authored
    MOSYNC-2930 Examples: Updated HTML5 examples to use appropriate UTF-8 encoding attributes.
Commits on Mar 12, 2013
  1. MOSYNC-2903. Fix space replacement issue in url title.

    mvasiliniuc authored
  2. @milesm

    Merge pull request #398 from mvasiliniuc/ThreeTwoOne

    milesm authored
    MOSYNC-2903. Fix space replacement issue in url title.
This page is out of date. Refresh to see the latest.
Showing with 209 additions and 110 deletions.
  1. +3 −2 examples/cpp/Moblet/Soap/Soap.cpp
  2. +11 −6 examples/cpp/Moblet/Soap/SoapTest.cpp
  3. +13 −0 examples/cpp/NativeUIMap/Readme.txt
  4. +1 −1  examples/cpp/SensorTest/consts.h
  5. +14 −0 examples/cpp/WikiSearchNativeUI/Util.h
  6. +11 −6 examples/cpp/WikiSearchNativeUI/WikiEngine.cpp
  7. +2 −1  examples/html5/PhotoGallery/LocalFiles/index.html
  8. +10 −2 examples/html5/PhotoGallery/LocalFiles/page-about.html
  9. +5 −2 examples/html5/PhotoGallery/LocalFiles/page-camera.html
  10. +2 −3 examples/html5/PhotoGallery/LocalFiles/page-gallery.html
  11. +18 −14 examples/html5/PhotoGallery/Server/upload.php
  12. +9 −0 examples/html5/PhotoGallery/readme.txt
  13. +1 −1  examples/html5/WebViewLoveSMS/LocalFiles/index.html
  14. +6 −6 examples/html5/WebViewTwitter/LocalFiles/index.html
  15. +2 −2 examples/html5/WormholeNativeUI/LocalFiles/index.html
  16. +2 −0  libs/Notification/LocalNotification.cpp
  17. +2 −0  libs/Notification/LocalNotification.h
  18. +15 −8 libs/Wormhole/Libs/Notification/PushNotificationManager.cpp
  19. +6 −0 libs/Wormhole/Libs/PhoneGap/PhoneGapFile.cpp
  20. +18 −4 runtimes/cpp/platforms/iphone/Classes/MoSyncView.mm
  21. +12 −8 runtimes/cpp/platforms/iphone/Classes/NativeUI/Syscalls/MoSyncUISyscalls.mm
  22. +3 −0  runtimes/cpp/platforms/iphone/Classes/NativeUI/WidgetUtils/WidgetUtils.h
  23. +2 −0  runtimes/cpp/platforms/iphone/Classes/NativeUI/Widgets/ButtonWidget.mm
  24. +6 −1 runtimes/cpp/platforms/iphone/Classes/NativeUI/Widgets/ListViewItemWidget.mm
  25. +3 −1 runtimes/cpp/platforms/iphone/Classes/NativeUI/Widgets/VideoViewWidget.mm
  26. +4 −3 runtimes/cpp/platforms/iphone/Classes/NativeUI/Widgets/WebViewWidget.mm
  27. +0 −3  runtimes/cpp/platforms/iphone/Classes/notifications/NotificationManager.mm
  28. +4 −1 runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncLabel.cs
  29. +1 −29 ...orms/androidJNI/AndroidProject/src/com/mosync/internal/android/notifications/LocalNotificationsManager.java
  30. +2 −0  runtimes/java/platforms/androidJNI/AndroidProject/src/com/mosync/nativeui/ui/widgets/ListViewSection.java
  31. +1 −1  testPrograms/native_ui_lib/MapTest/MainScreen.cpp
  32. +13 −0 testPrograms/native_ui_lib/MapTest/Readme.txt
  33. +4 −5 testPrograms/notification/LocalNotificationSender/ReadMe.txt
  34. +3 −0  tools/idl2/maapi.idl
View
5 examples/cpp/Moblet/Soap/Soap.cpp
@@ -35,7 +35,7 @@ MA 02110-1301, USA.
//static const data
// These particular headers and footers are compatible with
-// Flickr services.
+// gSOAP demowebserver.
// They will need modification to operate properly with other SOAP servers.
#define SOAPNS "SOAP-ENV"
@@ -45,7 +45,8 @@ MA 02110-1301, USA.
static const char sSoapHeader[] =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
"<"SOAPNS":Envelope xmlns:"SOAPNS"=\"http://schemas.xmlsoap.org/soap/envelope/\""
-" xmlns:ns1=\"urn:localhost-scramble\""
+" xmlns:ns=\"urn:demowebserver\""
+" xmlns:f=\"urn:form\""
" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\""
View
17 examples/cpp/Moblet/Soap/SoapTest.cpp
@@ -24,13 +24,14 @@ MA 02110-1301, USA.
using namespace MAUtil;
-// This request will return a text string, scrambled with rot-13.
+// This request will return a the result of a multiplication.
-static const char sUrl[] = "http://www.joelhainley.com/examples/soap/server.php";
+static const char sUrl[] = "http://modev.mine.nu:12346/";
static const char sData[] =
-"<ns1:getRot13><symbol xsi:type=\"xsd:string\">"
-"Hello World!"
-"</symbol></ns1:getRot13>"
+"<ns:mul>\n"
+ "<param-7>6.0</param-7>\n"
+ "<param-8>7.0</param-8>\n"
+"</ns:mul>\n"
;
@@ -43,9 +44,13 @@ class MyMoblet : public Moblet, SoapListener {
}
void soapError(int code) {
- printf("soapError(%i)\n", code);
// an error code -6 (CONNERR_CLOSED) is normal after soapEnd(),
// as the server closes the HTTP connection.
+ if(code == CONNERR_CLOSED) {
+ printf("Connection closed by server.\n");
+ return;
+ }
+ printf("soapError(%i)\n", code);
}
void soapEnd() {
printf("soapEnd()\n");
View
13 examples/cpp/NativeUIMap/Readme.txt
@@ -0,0 +1,13 @@
+Purpose:
+The test program shows the native ui map functionality and provides UI elements for doing
+the following:
+ - add/remove multiple random map pins
+ - set/get visible area
+ - set zoom level
+ - center the map
+ - a map control is visible and available for interraction to the user
+
+IMPORTANT:
+ ADD YOU OWN MAP CREDENTIALS INSIDE THE MAP CONSTRUCTOR:
+ MainScreen.cpp:
+ mMap = new Map("google maps test credentials", "bing maps test credentials");
View
2  examples/cpp/SensorTest/consts.h
@@ -37,7 +37,7 @@ MA 02110-1301, USA.
#define SCALE_FACTOR (gScreenWidth / BASE_SCREEN_WIDTH)
#define TEXT_SIZE (10 * SCALE_FACTOR)
#define OFFSET_X (10 * SCALE_FACTOR)
-#define OFFSET_Y 20
+#define OFFSET_Y TEXT_SIZE
// useful texts
#define TXT_NONE ""
View
14 examples/cpp/WikiSearchNativeUI/Util.h
@@ -122,6 +122,20 @@ const MAUtil::String ERROR_NO_RESULTS = "There are no results.";
/** The results cannot be parsed. **/
const MAUtil::String ERROR_INVALID_DATA = "Invalid results.Error:";
+// Some Http request and response field names.
+/**
+* Field name that can be used for #maHttpSetRequestHeader.
+*/
+const String HTTP_REQUEST_HEADER_USER_AGENT = "User-Agent";
+/**
+* Field name that can be used for #maHttpSetRequestHeader.
+*/
+const String HTTP_REQUEST_HEADER_ACCEPT_ENCODING = "Accept-Encoding";
+/**
+* Field name that can be used for @maHttpGetResponseHeader.
+*/
+const String HTTP_RESPONSE_HEADER_CONTENT_LENGTH = "Content-Length";
+
/**
* Utility functions for creating NativeUI widgets.
*/
View
17 examples/cpp/WikiSearchNativeUI/WikiEngine.cpp
@@ -224,12 +224,18 @@ void MediaWiki::search(MAUtil::String searchTerm, int resultsLimit)
constructApiUrl();
int res = mHttp.create(mWiki->apiUrl.c_str(), HTTP_GET);
+
+ // Enforce compress disabling, so we can count on a real content length value.
+ mHttp.setRequestHeader(HTTP_REQUEST_HEADER_ACCEPT_ENCODING.c_str(),"identity");
+ mHttp.setRequestHeader(HTTP_REQUEST_HEADER_USER_AGENT.c_str(),"WikipediaSearchNativeUI");
+
if(res < 0) {
// It have failed for some reason.
- mHomeScreen->engineError(ERROR_NO_CONNECTION);
+ mHomeScreen->engineError("The error is " + MAUtil::integerToString(res));//ERROR_NO_CONNECTION);
+ mHttp.close();
+ mIsConnected = false;
}
else {
- mHttp.setRequestHeader("User-Agent","WikipediaSearchNativeUI");
mHttp.finish();
mIsConnected = true;
}
@@ -248,14 +254,13 @@ void MediaWiki::httpFinished(MAUtil::HttpConnection *conn, int result)
if ( result >= 0)
{
MAUtil::String contentLengthStr;
- // todo: check return value.
- mHttp.getResponseHeader("Content-Length",
+ mHttp.getResponseHeader(HTTP_RESPONSE_HEADER_CONTENT_LENGTH.c_str(),
&contentLengthStr);
int contentLength = 0;
contentLength = atoi(contentLengthStr.c_str());
- if (contentLength >= CONNECTION_BUFFER_SIZE || contentLength == 0) {
+ if (contentLength >= CONNECTION_BUFFER_SIZE || contentLength != 0) {
// Receive in chunks.
// Calculate how many chunks we receive, so that we can increment
// a progress bar for this action.
@@ -282,7 +287,7 @@ void MediaWiki::httpFinished(MAUtil::HttpConnection *conn, int result)
else
{
// Notify UI on the error.
- mHomeScreen->engineError( ERROR_NO_CONNECTION );
+ mHomeScreen->engineError( MAUtil::integerToString(result));//ERROR_NO_CONNECTION );
mHttp.close();
mIsConnected = false;
View
3  examples/html5/PhotoGallery/LocalFiles/index.html
@@ -19,7 +19,8 @@
<html>
<head>
<title>Photo Gallery</title>
- <script src="js/wormhole.js"></script>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <script src="js/wormhole.js" charset="utf-8"></script>
<script type="text/javascript">
var app = (function()
{
View
12 examples/html5/PhotoGallery/LocalFiles/page-about.html
@@ -8,6 +8,7 @@
<html>
<head>
<meta name="viewport" content="width=device-width">
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>About</title>
<link rel="stylesheet" href="style.css">
<style type="text/css">
@@ -21,9 +22,16 @@
<div id="screen">
<div id="heading">About</div>
<div class="pane button">
- <p>PhotoGallery is a demo app created with the MoSync Mobile SDK (mosync.com)</p>
- <p>Author: Mikael Kindborg, MoSync AB</p>
+ <p>PhotoGallery is an example application created
+ with the MoSync Mobile SDK (mosync.com)</p>
<p>Tab icons by Glyphish (glyphish.com)</p>
+ <p>DISCLAIMER</p>
+ <p>This application can be used to upload photos
+ to the Internet, which will make them publicly
+ available.</p>
+ <p>MoSync AB takes no responsibility for uploaded
+ photos or any damage the use of this application
+ may cause.</p>
</div>
</div>
</body>
View
7 examples/html5/PhotoGallery/LocalFiles/page-camera.html
@@ -12,9 +12,10 @@
<html>
<head>
<meta name="viewport" content="width=device-width">
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Camera</title>
<link rel="stylesheet" href="style.css">
- <script src="js/wormhole.js"></script>
+ <script src="js/wormhole.js" charset="utf-8"></script>
<script type="text/javascript">
var camera = (function()
{
@@ -66,7 +67,9 @@
<div class="pane view">
<img id="photo" src="img/MoSyncLogo.png" style="width:100%"/>
</div>
- <div class="pane button" onclick="camera.uploadPhoto()">Upload Photo</div>
+ <div class="pane button" onclick="camera.uploadPhoto()">
+ Upload Photo<br/>(makes your photo publicly available)
+ </div>
</div>
</body>
</html>
View
5 examples/html5/PhotoGallery/LocalFiles/page-gallery.html
@@ -11,10 +11,10 @@
<html>
<head>
<meta name="viewport" content="width=device-width">
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Gallery</title>
<link rel="stylesheet" href="style.css">
- <script src="js/wormhole.js"></script>
- <script src="mosync-extensions.js"></script>
+ <script src="js/wormhole.js" charset="utf-8"></script>
<script>
var gallery = (function()
{
@@ -64,7 +64,6 @@
// Build new list (populate DOM).
var urls = JSON.parse(json);
- var limit = Math.min(20, urls.length);
for (var i = 0; i < urls.length; ++i)
{
var image = document.createElement('img');
View
32 examples/html5/PhotoGallery/Server/upload.php
@@ -3,18 +3,21 @@
ini_set("log_errors", "1");
error_reporting(-1);
+function mylog($message)
+{
+ $file = 'mylog.txt';
+ // Open the file to get existing content
+ $current = file_get_contents($file);
+ // Append a line to the file
+ $current .= "$message\n";
+ // Write the contents back to the file
+ file_put_contents($file, $current);
+}
+
function uploadPhoto()
{
$targetPath = "photos/" . basename($_FILES["file"]["name"]);
- echo "Target file: " . $targetPath;
- echo "<br/>";
-
- print_r($_FILES);
- echo "<br/>";
-
- echo fileIsImage($_FILES["file"]["name"]);
-
if (fileIsOK($_FILES["file"]))
{
$success = move_uploaded_file($_FILES["file"]["tmp_name"], $targetPath);
@@ -55,9 +58,8 @@ function endsWith($haystack, $needle)
function getPhotoURLs()
{
- $urls = getLast100PhotoURLs();
-
/*// For debugging.
+ $urls = getLastTenPhotoURLs();
foreach ($urls as $url)
{
echo "<a href='$url'>$url</a><br/>\n";
@@ -68,12 +70,13 @@ function getPhotoURLs()
function getPhotoURLsAsJSON()
{
- $urls = getLast100PhotoURLs();
+ $urls = getLastTenPhotoURLs();
return json_encode($urls);
}
-function getLast100PhotoURLs()
+// Gets last TEN photo urls.
+function getLastTenPhotoURLs()
{
$baseURL = "http://dev.mosync.com/mobilelua/PhotoGallery/photos/";
$baseDir = "photos/";
@@ -103,12 +106,13 @@ function getLast100PhotoURLs()
// List if URLs.
$urls = array();
- // Create a list of URLs to the most recent 100 files.
+ // Create a list of URLs to the most recent files.
$fileCounter = 0;
foreach ($files as $file)
{
++$fileCounter;
- if ($fileCounter > 100)
+ // We only get TEN recent files (100 is too many!).
+ if ($fileCounter > 10)
{
// TODO: Move excessive files to an archive directory?
break;
View
9 examples/html5/PhotoGallery/readme.txt
@@ -0,0 +1,9 @@
+DISCLAIMER
+
+This application can be used to upload photos
+to the Internet, which will make them publicly
+available.
+
+MoSync AB takes no responsibility for uploaded
+photos or any damage the use of this application
+may cause.
View
2  examples/html5/WebViewLoveSMS/LocalFiles/index.html
@@ -96,7 +96,7 @@
</style>
<!-- Import the Wormhole JavaScript Library. -->
-<script src="js/wormhole.js"></script>
+<script src="js/wormhole.js" charset="utf-8"></script>
<script>
// Global variables that hold message content.
View
12 examples/html5/WebViewTwitter/LocalFiles/index.html
@@ -8,7 +8,8 @@
-->
<html>
<head>
- <meta name="viewport" content="width=devicewidth; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
+ <meta name="viewport" content="width=devicewidth, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Twitter Reader</title>
@@ -16,12 +17,11 @@
<script src="jquery.mobile/jquery-1.8.2.min.js"></script>
<script src="jquery.mobile/jquery.mobile-1.2.0.min.js"></script>
- <script src="js/wormhole.js"></script>
- <script src="js/mosync.file.js"></script>
+ <script src="js/wormhole.js" charset="utf-8"></script>
+ <script src="js/mosync.file.js" charset="utf-8"></script>
- <script src="js/mosync.mock.js"></script>
- <script src="js/app.js"></script>
- <script src="js/app.ui.js"></script>
+ <script src="js/app.js" charset="utf-8"></script>
+ <script src="js/app.ui.js" charset="utf-8"></script>
<script>
/**
View
4 examples/html5/WormholeNativeUI/LocalFiles/index.html
@@ -9,8 +9,8 @@
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <script src="js/wormhole.js"></script>
- <script src="main.js"></script>
+ <script src="js/wormhole.js" charset="utf-8"></script>
+ <script src="main.js" charset="utf-8"></script>
<script>
/**
* Called by the NativeUI library when the UI is ready to
View
2  libs/Notification/LocalNotification.cpp
@@ -540,6 +540,8 @@ namespace Notification
/**
* Set the date and time when the system should deliver the notification.
+ * The notification will be fired when the system time is equal to the
+ * given param time value.
* @param tm A date and time struct that specifies when the system
* should deliver the notification.
* @return Any of the following result codes:
View
2  libs/Notification/LocalNotification.h
@@ -491,6 +491,8 @@ namespace Notification
/**
* Set the date and time when the system should deliver the notification.
+ * The notification will be fired when the system time is equal to the
+ * given param time value.
* @param time A date and time struct that specifies when the system
* should deliver the notification.
* @return Any of the following result codes:
View
23 libs/Wormhole/Libs/Notification/PushNotificationManager.cpp
@@ -144,18 +144,25 @@ namespace Wormhole
sprintf(
data,
- "\\'{\"message\": \"%s\","
+ "{\"message\": %s,"
"\"sound\": \"%s\","
- "\"iconBadge\":\"%d\"}\\'",
- message.c_str(),
+ "\"iconBadge\":\"%d\"}",
+ Encoder::JSONStringify(message.c_str()).c_str(),
sound.c_str(),
iconBadge);
- mMessageHandler->callSuccess(
- mListenerCallBack,
- PHONEGAP_CALLBACK_STATUS_OK,
- data,
- true);
+ String args = "";
+ args += "{";
+ args += "\"status\":" + ((MAUtil::String) PHONEGAP_CALLBACK_STATUS_OK);
+ args += ",\"message\":" + Encoder::JSONStringify(data);
+ args += ",\"keepCallback\":true";
+ args += "}";
+
+ String script = "PhoneGap.CallbackSuccess(";
+ script += "'" + mListenerCallBack + "',";
+ script += Encoder::JSONStringify(args.c_str()) + ")";
+
+ mMessageHandler->callJS(script);
}
/**
View
6 libs/Wormhole/Libs/PhoneGap/PhoneGapFile.cpp
@@ -1689,6 +1689,12 @@ namespace Wormhole
);
}
+ // Deallocate the data object.
+ if (NULL != data)
+ {
+ maDestroyPlaceholder(data);
+ }
+
// Delete the body of the request.
delete mRequestBody;
View
22 runtimes/cpp/platforms/iphone/Classes/MoSyncView.mm
@@ -199,13 +199,27 @@ - (void)deviceOrientationChanged:(NSNotification *)notification {
}
-(void) messageBox:(id) obj {
MessageBoxHandler *mbh = (MessageBoxHandler*) obj;
- UIAlertView *alert = [[UIAlertView alloc]
+ UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:mbh.title
message:mbh.msg
delegate:mbh
cancelButtonTitle:mbh.cancelTitle
- otherButtonTitles:mbh.button1Title, mbh.button2Title, mbh.button3Title, nil];
-
+ otherButtonTitles:nil];
+
+ // Add only valid strings as buttons.
+ if (mbh.button1Title)
+ {
+ [alert addButtonWithTitle:mbh.button1Title];
+ }
+ if (mbh.button2Title)
+ {
+ [alert addButtonWithTitle:mbh.button2Title];
+ }
+ if (mbh.button3Title)
+ {
+ [alert addButtonWithTitle:mbh.button3Title];
+ }
+
[touchHelper clearTouches];
if (mbh.cancelTitle == nil) {
alert.cancelButtonIndex = -1;
@@ -215,7 +229,7 @@ -(void) messageBox:(id) obj {
}
-(void) showMessageBox: (NSString*)msg withTitle: (NSString*)title shouldKill: (bool)kill {
- MessageBoxHandler *mbh = [[MessageBoxHandler alloc] retain];
+ MessageBoxHandler *mbh = [[[MessageBoxHandler alloc] init] autorelease];
mbh.kill = kill;
mbh.title = title;
mbh.msg = msg;
View
20 runtimes/cpp/platforms/iphone/Classes/NativeUI/Syscalls/MoSyncUISyscalls.mm
@@ -382,25 +382,29 @@ int maWidgetSetProperty(MAWidgetHandle handle, const char *property, const char*
IWidget* widget = [mosyncUI getWidget:handle];
if(widget == NULL) return MAW_RES_INVALID_HANDLE;
+ if(property == NULL)
+ return MAW_RES_INVALID_PROPERTY_NAME;
+
+ if(value == NULL)
+ return MAW_RES_INVALID_PROPERTY_VALUE;
+
NSString* propertyString = stringFromChar(property);
if([widget class] == [GLViewWidget class] || [widget class] == [GL2ViewWidget class] ) {
// do this from the MoSync thread. Maybe do a generic system for this later.
- if([propertyString isEqualToString:@"bind"]) {
+ if([propertyString isEqualToString:@"bind"])
+ {
+ [propertyString release];
return [widget setPropertyWithKey:@"bind" toValue:@""];
}
- if([propertyString isEqualToString:@"invalidate"]) {
+ if([propertyString isEqualToString:@"invalidate"])
+ {
+ [propertyString release];
return [widget setPropertyWithKey:@"invalidate" toValue:@""];
}
}
- if(property == NULL)
- return MAW_RES_INVALID_PROPERTY_NAME;
-
- if(value == NULL)
- return MAW_RES_INVALID_PROPERTY_VALUE;
-
int returnValue;
NSString *valueString = stringFromChar(value);
View
3  runtimes/cpp/platforms/iphone/Classes/NativeUI/WidgetUtils/WidgetUtils.h
@@ -34,6 +34,9 @@
return MAW_RES_INVALID_PROPERTY_VALUE; \
}
+// Used for converting milliseconds in seconds.
+#define SECOND 1000.0
+
/**
* Enums for widget size. Since iOS views are using only fixed sizes, the wrap and fill properties
* are custom.
View
2  runtimes/cpp/platforms/iphone/Classes/NativeUI/Widgets/ButtonWidget.mm
@@ -113,6 +113,7 @@ - (int)setPropertyWithKey:(NSString*)key toValue:(NSString*)value
Surface* imageResource = Base::gSyscall->resources.get_RT_IMAGE(imageHandle);
image = [UIImage imageWithCGImage:imageResource->image];
[button setBackgroundImage:image forState:UIControlStateNormal];
+ [self layout];
}
else
if([key isEqualToString:@MAW_IMAGE_BUTTON_IMAGE]) {
@@ -122,6 +123,7 @@ - (int)setPropertyWithKey:(NSString*)key toValue:(NSString*)value
Surface* imageResource = Base::gSyscall->resources.get_RT_IMAGE(imageHandle);
image = [UIImage imageWithCGImage:imageResource->image];
[button setImage:image forState:UIControlStateNormal];
+ [self layout];
}
else if([key isEqualToString:@"leftCapWidth"]) {
int newLeftCapWidth = [value intValue];
View
7 runtimes/cpp/platforms/iphone/Classes/NativeUI/Widgets/ListViewItemWidget.mm
@@ -248,7 +248,7 @@ -(UITableViewCell*)cell
*/
- (int)addChild:(IWidget*)child
{
- if (_children.count ==0 )
+ if (_children.count == 0 )
{
[super addChild:child toSubview:YES];
}
@@ -437,6 +437,11 @@ -(CGSize)sizeThatFitsForWidget
{
IWidget* child = [_children objectAtIndex:0];
size = child.size;
+ if (child.autoSizeWidth == WidgetAutoSizeFillParent)
+ {
+ size.width = self.width;
+ child.width = self.width;
+ }
}
else if (self.autoSizeHeight != WidgetAutoSizeFixed)
{
View
4 runtimes/cpp/platforms/iphone/Classes/NativeUI/Widgets/VideoViewWidget.mm
@@ -104,7 +104,9 @@ - (int)setPropertyWithKey:(NSString*)key toValue:(NSString*)value
else if ([key isEqualToString:@MAW_VIDEO_VIEW_SEEK_TO])
{
TEST_FOR_NEGATIVE_VALUE([value floatValue]);
- [_moviePlayerController setCurrentPlaybackTime:[value floatValue]];
+ // Value is in milliseconds we we have to convert it to seconds.
+ CGFloat timeInSeconds = [value floatValue] / SECOND;
+ [_moviePlayerController setCurrentPlaybackTime: timeInSeconds];
}
else if ([key isEqualToString:@MAW_VIDEO_VIEW_CONTROL])
{
View
7 runtimes/cpp/platforms/iphone/Classes/NativeUI/Widgets/WebViewWidget.mm
@@ -76,14 +76,15 @@ - (int)setPropertyWithKey: (NSString*)key toValue: (NSString*)value {
{
NSURL *url;
//Process a normal URL
+ //URLs can only be sent over the Internet using the ASCII character-set.
if (schemaLocation.location == NSNotFound) {
NSString *urlString = [NSString stringWithFormat:@"%@%@", baseUrl, value];
- NSString* webURLString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+ NSString* webURLString = [urlString stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
url = [[NSURL URLWithString: webURLString] filePathURL];
} else {
// Convert the string URL into ascii encoding.
- NSData* data = [value dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
- NSString* formattedURL = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+ NSData* data = [value dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
+ NSString* formattedURL = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
url = [NSURL URLWithString:formattedURL];
[formattedURL release];
}
View
3  runtimes/cpp/platforms/iphone/Classes/notifications/NotificationManager.mm
@@ -198,10 +198,7 @@ -(int) localNotificationSetProperty:(MAHandle) notificationHandle
}
// Notification fire date must be in GMT + 0:00 format(system time).
- // Received date is using local time.
double seconds = [value doubleValue];
- NSTimeZone* localTimeZone = [NSTimeZone localTimeZone];
- seconds -= [localTimeZone secondsFromGMT];
NSDate* date = [NSDate dateWithTimeIntervalSince1970:seconds];
notification.fireDate = date;
}
View
5 runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncLabel.cs
@@ -16,6 +16,7 @@
using System.Text.RegularExpressions;
using System.Reflection;
using System.Windows.Media;
+using System.Globalization;
namespace MoSync
{
@@ -207,7 +208,9 @@ public String fontSize
set
{
double size = 0;
- if (double.TryParse(value, out size))
+ NumberStyles style = NumberStyles.AllowDecimalPoint;
+ IFormatProvider provider = CultureInfo.InvariantCulture;
+ if (Double.TryParse(value, style, provider, out size))
{
// for some values better use the default size of the platform
mLabel.FontSize = size <= 0 ? 11 : size;
View
30 ...droidProject/src/com/mosync/internal/android/notifications/LocalNotificationsManager.java
@@ -100,35 +100,6 @@ public int destroy(int handle)
LocalNotificationObject notification = m_NotificationTable.get(handle);
if ( null != notification )
{
- // Remove the service notification if it is pending.
- if ( notification.isActive() )
- {
- LocalNotificationsService.removeServiceNotification(
- m_NotificationTable.get(handle).getId(),
- mMoSyncThread.getActivity());
-
- // Stop the service, even when the application is in background.
- LocalNotificationsService.stopService();
- }
- // Cancel the intent assigned to the notification if scheduled.
- if ( null != m_Intents.get(handle) )
- {
- AlarmManager alarmManager =
- (AlarmManager) mMoSyncThread.getActivity().getSystemService(Context.ALARM_SERVICE);
-
- // Set the unique request code as the handle.
- PendingIntent pendingIntent = PendingIntent.getBroadcast(
- mMoSyncThread.getActivity(),
- notification.getRequestCode(),
- m_Intents.get(handle),
- PendingIntent.FLAG_NO_CREATE);
- if ( pendingIntent != null )
- {
- alarmManager.cancel(pendingIntent);
- }
- m_Intents.remove(handle);
- }
-
// Remove the internal notification object.
m_NotificationTable.remove(handle);
@@ -296,6 +267,7 @@ public int schedule(final int handle, final Context appContext)
alarmManager.set(AlarmManager.RTC_WAKEUP, notification.getFireDate(), pendingIntent);
m_Intents.put(handle, intent);
+
return MA_NOTIFICATION_RES_OK;
}
}
View
2  ...atforms/androidJNI/AndroidProject/src/com/mosync/nativeui/ui/widgets/ListViewSection.java
@@ -185,6 +185,7 @@ public boolean setProperty(String property, String value)
createSegmentedSectionDefaultUI();
break;
case IX_WIDGET.MAW_LIST_VIEW_SECTION_TYPE_ALPHABETICAL:
+ mHasFooter = false;
break;
default:
Log.e("@@MoSync","maWidgetSetProperty invalid List View Section type");
@@ -516,6 +517,7 @@ public void setAlphaSectionFooter(String text)
{
// Create and add the footer after the last item - if that exists.
addSectionFooter();
+ mHasFooter = true;
setFooterText(text);
if (mAdapterListener != null)
mAdapterListener.itemAdded(mItems.get(mItems.size()), this, mItems.size());
View
2  testPrograms/native_ui_lib/MapTest/MainScreen.cpp
@@ -97,7 +97,7 @@ void MainScreen::createMainLayout() {
mMainLayout->addChild(mSetCenterButton);
// create the main map and add it to the main layout
- mMap = new Map("google test credentials", "AsIe6nHOHjIuf9MQS4fW7up92BO6HuCwspKJqYwffZiqUJsgXuLIXeBdCf9EM4yz");
+ mMap = new Map("google test credentials", "AuQ7GMB3AJPFp5GPHbuQ2WVyhQUd9DjYJ6u5aR6a_uXZZdX5KuHJ7XMU4GNvO6mh");
mMap->fillSpaceHorizontally();
mMap->fillSpaceVertically();
View
13 testPrograms/native_ui_lib/MapTest/Readme.txt
@@ -0,0 +1,13 @@
+Purpose:
+The test program shows the native ui map functionality and provides UI elements for doing
+the following:
+ - add/remove multiple random map pins
+ - set/get visible area
+ - set zoom level
+ - center the map
+ - a map control is visible and available for interraction to the user
+
+IMPORTANT:
+ ADD YOU OWN MAP CREDENTIALS INSIDE THE MAP CONSTRUCTOR:
+ MainScreen.cpp:
+ mMap = new Map("google maps test credentials", "bing maps test credentials");
View
9 testPrograms/notification/LocalNotificationSender/ReadMe.txt
@@ -4,10 +4,12 @@ On Android only there are two more texts to set:
- content body title and
- the ticker text.
(Ticker text: the text that flows by in the status bar when the notification first activates.)
+
Next, you can set for iOS only:
- the badge number,
-the alert action (the title of the action button or slider).
- Next the Default Sound can be enabled/disabled.
+
+Next the Default Sound can be enabled/disabled.
Below, settings available only on Android:
- the Vibration settings ( that are available only on Android): By checking the Vibration check box, the default
vibration pattern is applied. If the vibration duration is set, it will be used instead.
@@ -15,14 +17,11 @@ vibration pattern is applied. If the vibration duration is set, it will be used
pattern is applied to the notification. If the pattern is set(by filling the next 3 edit boxes), it will be used instead.
If the flashing is not supported on the device you will get the message "Not available" inside the edit boxes for this settings.
Note that you need to enable the Notification LED lights from device's Settings.
+
The Flashing pattern is consisted of:
- a color, in the format 0xRRGGBB, for instance red: 0xFF0000.
- led on = length of time, in seconds, to keep the light on.
- led off = length of time, in seconds, to keep the light off.
-- The "Show only when in background" setting. This is available only on Android. On iOS the user sees the notification only
-if the application is running in background. On Android this can be configured: by checking this setting the notification
-will be displayed only if the app is running in background. By un-checking it you will get the notification regardless of the
-focus state.
The last setting is the fire date: number of seconds for scheduling.
View
3  tools/idl2/maapi.idl
@@ -5900,9 +5900,12 @@ group NotificationAPI "Notification API" {
/**
* @brief Set the date and time when the system should deliver the notification.
+ * The notification will be fired when the system time is equal to the
+ * given param time value.
*
* @validvalue an int.
* The date is in seconds(UNIX time - seconds elapsed since January 1, 1970).
+ * The value should be given according to device system time.
*
* @setandget
*
Something went wrong with that request. Please try again.