You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Dan Ardelean (Created) (JIRA)" <ji...@apache.org> on 2012/01/19 12:30:40 UTC

[jira] [Created] (CB-187) WP7 Issues with Accelerometer.cs

WP7 Issues with Accelerometer.cs
--------------------------------

                 Key: CB-187
                 URL: https://issues.apache.org/jira/browse/CB-187
             Project: Apache Callback
          Issue Type: Bug
          Components: WP7
    Affects Versions: 1.3.0
         Environment: On Windows Phone in italian language
            Reporter: Dan Ardelean
            Assignee: Jesse MacFadyen


There is a bug in the Accelerometer.cs. The formattated date won't be parsed on some CultureInfo because of the decimal separator. The solution is pretty simple, add  CultureInfo.InvariantCulture to the ToString method. 

Here is how it should look:
  private string GetCurrentAccelerationFormatted()
        {
            string resultCoordinates = String.Format("\"x\":{0},\"y\":{1},\"z\":{2}",
                            accelerometer.CurrentValue.Acceleration.X.ToString("0.00000", CultureInfo.InvariantCulture),
                            accelerometer.CurrentValue.Acceleration.Y.ToString("0.00000", CultureInfo.InvariantCulture),
                            accelerometer.CurrentValue.Acceleration.Z.ToString("0.00000", CultureInfo.InvariantCulture));
            resultCoordinates = "{" + resultCoordinates + "}";
            return resultCoordinates;
        }
To reproduce the error set you phone to italian and you will see you won't get the notifications


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CB-187) WP7 Issues with Accelerometer.cs

Posted by "Jesse MacFadyen (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13189394#comment-13189394 ] 

Jesse MacFadyen edited comment on CB-187 at 1/19/12 9:34 PM:
-------------------------------------------------------------

Will be available in v1.4.0
commit: 440d430e2fcbfa4288fa12b19de7a146e16b0d8e

#CB-141
                
      was (Author: purplecabbage):
    Will be available in v1.4.0
commit: 440d430e2fcbfa4288fa12b19de7a146e16b0d8e
                  
> WP7 Issues with Accelerometer.cs
> --------------------------------
>
>                 Key: CB-187
>                 URL: https://issues.apache.org/jira/browse/CB-187
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.3.0
>         Environment: On Windows Phone in italian language
>            Reporter: Dan Ardelean
>            Assignee: Jesse MacFadyen
>              Labels: patch
>             Fix For: 1.4.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> There is a bug in the Accelerometer.cs. The formattated date won't be parsed on some CultureInfo because of the decimal separator. The solution is pretty simple, add  CultureInfo.InvariantCulture to the ToString method. 
> Here is how it should look:
>   private string GetCurrentAccelerationFormatted()
>         {
>             string resultCoordinates = String.Format("\"x\":{0},\"y\":{1},\"z\":{2}",
>                             accelerometer.CurrentValue.Acceleration.X.ToString("0.00000", CultureInfo.InvariantCulture),
>                             accelerometer.CurrentValue.Acceleration.Y.ToString("0.00000", CultureInfo.InvariantCulture),
>                             accelerometer.CurrentValue.Acceleration.Z.ToString("0.00000", CultureInfo.InvariantCulture));
>             resultCoordinates = "{" + resultCoordinates + "}";
>             return resultCoordinates;
>         }
> To reproduce the error set you phone to italian and you will see you won't get the notifications

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-187) WP7 Issues with Accelerometer.cs

Posted by "Jesse MacFadyen (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse MacFadyen resolved CB-187.
--------------------------------

       Resolution: Duplicate
    Fix Version/s: 1.4.0

Will be available in v1.4.0
commit: 440d430e2fcbfa4288fa12b19de7a146e16b0d8e
                
> WP7 Issues with Accelerometer.cs
> --------------------------------
>
>                 Key: CB-187
>                 URL: https://issues.apache.org/jira/browse/CB-187
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.3.0
>         Environment: On Windows Phone in italian language
>            Reporter: Dan Ardelean
>            Assignee: Jesse MacFadyen
>              Labels: patch
>             Fix For: 1.4.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> There is a bug in the Accelerometer.cs. The formattated date won't be parsed on some CultureInfo because of the decimal separator. The solution is pretty simple, add  CultureInfo.InvariantCulture to the ToString method. 
> Here is how it should look:
>   private string GetCurrentAccelerationFormatted()
>         {
>             string resultCoordinates = String.Format("\"x\":{0},\"y\":{1},\"z\":{2}",
>                             accelerometer.CurrentValue.Acceleration.X.ToString("0.00000", CultureInfo.InvariantCulture),
>                             accelerometer.CurrentValue.Acceleration.Y.ToString("0.00000", CultureInfo.InvariantCulture),
>                             accelerometer.CurrentValue.Acceleration.Z.ToString("0.00000", CultureInfo.InvariantCulture));
>             resultCoordinates = "{" + resultCoordinates + "}";
>             return resultCoordinates;
>         }
> To reproduce the error set you phone to italian and you will see you won't get the notifications

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira