10
Views
3
Comments
How to use a compass and accelerator plugin
Application Type
Mobile

Hi

I'm building an mobile app for a school project and I'm a complete noob. I'm trying to build an app for a mobile device and need to access the compass and accelerometer. I need to access the compass to get the current heading and also to point the user in the direction to turn to find the current heading. 

Can anyone help out with which plugin I should use and how to create the event to call it, I tried using the compass plugin from Forge and I called it using a client action but after using the emulator when it is published nothing happens? 

Do I need to launch application on the device directly to get access to the compass and accelerometer, if so how do I got about that?


Any help would be greatly appreciated  

2019-01-07 16-04-16
Siya
 
MVP

You can achieve the same using JavaScript. Attached a sample implementation for your reference. Please note that this will work only in Mobile.

Compass.oml
UserImage.jpg
Nicholas Sankeralli

How can I use this in my app, and how exactly can I test to make sure its working?

I am completely new to this  and would greatly appreciate any help.

2019-01-07 16-04-16
Siya
 
MVP

You can deploy the OML file you received earlier on your environment ( Service Center -> Environment -> Open file -> Compass.oml )

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.