nativescript magnetometer data access with javascript











up vote
0
down vote

favorite












how can I access the magnetometer data on iOS or Android through NativeScript without using native APIs? Just looking to get a simple heading reading.
I'm using the JavaScript framework for development










share|improve this question




























    up vote
    0
    down vote

    favorite












    how can I access the magnetometer data on iOS or Android through NativeScript without using native APIs? Just looking to get a simple heading reading.
    I'm using the JavaScript framework for development










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      how can I access the magnetometer data on iOS or Android through NativeScript without using native APIs? Just looking to get a simple heading reading.
      I'm using the JavaScript framework for development










      share|improve this question















      how can I access the magnetometer data on iOS or Android through NativeScript without using native APIs? Just looking to get a simple heading reading.
      I'm using the JavaScript framework for development







      javascript nativescript magnetometer






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 11 at 21:10

























      asked Nov 11 at 17:53









      Ihab Ali

      11




      11
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Well we have the Core Motions plugin already, did you try that?



          As per plugin's author, these sensors are not yet available for Android, neither I found any official docs on that.






          share|improve this answer





















          • Thanks, I’m aware of the plugin but as you mentioned Android is not supported and while I would like to be able to develop a cross platform app, Android is what I need for now. The accelerometer plugin from npm works well but I’m just looking for a simple way to access compass heading so I can get full device orientation for an AR application that I’m trying to build. Is there a way to access the javascript HTML5 devicemotion event handler inside NativeScript?
            – Ihab Ali
            Nov 11 at 21:08










          • Yes, you can. Use nativescript-webview-interface plugin to communicate between WebView and your native app.
            – Manoj
            Nov 11 at 21:17











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53251533%2fnativescript-magnetometer-data-access-with-javascript%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          Well we have the Core Motions plugin already, did you try that?



          As per plugin's author, these sensors are not yet available for Android, neither I found any official docs on that.






          share|improve this answer





















          • Thanks, I’m aware of the plugin but as you mentioned Android is not supported and while I would like to be able to develop a cross platform app, Android is what I need for now. The accelerometer plugin from npm works well but I’m just looking for a simple way to access compass heading so I can get full device orientation for an AR application that I’m trying to build. Is there a way to access the javascript HTML5 devicemotion event handler inside NativeScript?
            – Ihab Ali
            Nov 11 at 21:08










          • Yes, you can. Use nativescript-webview-interface plugin to communicate between WebView and your native app.
            – Manoj
            Nov 11 at 21:17















          up vote
          0
          down vote













          Well we have the Core Motions plugin already, did you try that?



          As per plugin's author, these sensors are not yet available for Android, neither I found any official docs on that.






          share|improve this answer





















          • Thanks, I’m aware of the plugin but as you mentioned Android is not supported and while I would like to be able to develop a cross platform app, Android is what I need for now. The accelerometer plugin from npm works well but I’m just looking for a simple way to access compass heading so I can get full device orientation for an AR application that I’m trying to build. Is there a way to access the javascript HTML5 devicemotion event handler inside NativeScript?
            – Ihab Ali
            Nov 11 at 21:08










          • Yes, you can. Use nativescript-webview-interface plugin to communicate between WebView and your native app.
            – Manoj
            Nov 11 at 21:17













          up vote
          0
          down vote










          up vote
          0
          down vote









          Well we have the Core Motions plugin already, did you try that?



          As per plugin's author, these sensors are not yet available for Android, neither I found any official docs on that.






          share|improve this answer












          Well we have the Core Motions plugin already, did you try that?



          As per plugin's author, these sensors are not yet available for Android, neither I found any official docs on that.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 11 at 18:44









          Manoj

          3,4231920




          3,4231920












          • Thanks, I’m aware of the plugin but as you mentioned Android is not supported and while I would like to be able to develop a cross platform app, Android is what I need for now. The accelerometer plugin from npm works well but I’m just looking for a simple way to access compass heading so I can get full device orientation for an AR application that I’m trying to build. Is there a way to access the javascript HTML5 devicemotion event handler inside NativeScript?
            – Ihab Ali
            Nov 11 at 21:08










          • Yes, you can. Use nativescript-webview-interface plugin to communicate between WebView and your native app.
            – Manoj
            Nov 11 at 21:17


















          • Thanks, I’m aware of the plugin but as you mentioned Android is not supported and while I would like to be able to develop a cross platform app, Android is what I need for now. The accelerometer plugin from npm works well but I’m just looking for a simple way to access compass heading so I can get full device orientation for an AR application that I’m trying to build. Is there a way to access the javascript HTML5 devicemotion event handler inside NativeScript?
            – Ihab Ali
            Nov 11 at 21:08










          • Yes, you can. Use nativescript-webview-interface plugin to communicate between WebView and your native app.
            – Manoj
            Nov 11 at 21:17
















          Thanks, I’m aware of the plugin but as you mentioned Android is not supported and while I would like to be able to develop a cross platform app, Android is what I need for now. The accelerometer plugin from npm works well but I’m just looking for a simple way to access compass heading so I can get full device orientation for an AR application that I’m trying to build. Is there a way to access the javascript HTML5 devicemotion event handler inside NativeScript?
          – Ihab Ali
          Nov 11 at 21:08




          Thanks, I’m aware of the plugin but as you mentioned Android is not supported and while I would like to be able to develop a cross platform app, Android is what I need for now. The accelerometer plugin from npm works well but I’m just looking for a simple way to access compass heading so I can get full device orientation for an AR application that I’m trying to build. Is there a way to access the javascript HTML5 devicemotion event handler inside NativeScript?
          – Ihab Ali
          Nov 11 at 21:08












          Yes, you can. Use nativescript-webview-interface plugin to communicate between WebView and your native app.
          – Manoj
          Nov 11 at 21:17




          Yes, you can. Use nativescript-webview-interface plugin to communicate between WebView and your native app.
          – Manoj
          Nov 11 at 21:17


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53251533%2fnativescript-magnetometer-data-access-with-javascript%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          List item for chat from Array inside array React Native

          Thiostrepton

          Caerphilly