• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Hekatonk · Oct 02, 2015 at 01:31 PM · c#androidiosmobileaccelerometer

Is it possible to access the native step-counter on mobile platforms.

I was wondering if there was a way to see the number of steps displayed in the native health apps for ios and android.

I'm not looking for a way to count steps using the accelerometer on the device. Although if someone with more experience on mobile platforms recommends this method i would be willing to look into it.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Lukezin · Jul 29, 2016 at 12:29 PM

It is possible to access step-counter on Android by performing a query:

 #if UNITY_ANDROID
 [code goes here]
 #endif

There is a free plugin that allows Unity to access sensors natively using the Android API. https://github.com/kshoji/Unity-Android-Sensor-Plugin

Remember, this is Android only, for iOS I have nothing figured out yet.

Hope to have helped.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Lukezin · Jul 28, 2016 at 05:40 PM

It is possible to access step-counter on Android by performing a query:

 #if UNITY_ANDROID
 [code goes here]
 #endif

There is a free plugin that allows Unity to access sensors natively using the Android API. https://github.com/kshoji/Unity-Android-Sensor-Plugin

Just go to https://github.com/kshoji/Unity-Android-Sensor-Plugin/tree/develop/library/release Get the .jar file and drop it on your project's assets. The repository has more information on how to use, it's pretty straight forward and it works with the latest Google Android API calls.

Remember, this is Android only, for iOS I have nothing figured out yet.

Hope to have helped!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

35 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Should I leave space for Ad's while designing my game?Also how are they implemented? 0 Answers

Can I export IOS project from Windows machine with Unity 5.x ? 2 Answers

Shadows problem on mobile device 0 Answers

Is It Bad to be Tired of my Own Mobile Game? 1 Answer

How to send notifications while the game is closed? 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges