• 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 /
avatar image
0
Question by goo-muffin · Nov 26, 2013 at 04:11 PM · androidinputlocationgps

Get Real GPS not WiFi GPS

Hi!

I figuered out that the Input.location has nothing to do with the built in GPS function of andoid! It is just the position of that last wifi you have been at. Is there a way to access the GPS function of android?

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
0

Answer by tanoshimi · Nov 26, 2013 at 05:02 PM

There's a thorough guide on how to write a plugin to obtain data from the GPS sensor on Android here: http://www.mat-d.com/site/unity-gps-plugin-development-tutorial-building-a-android-plugin-for-unity-with-eclipse-and-ant/

Comment
Add comment · Show 1 · 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 goo-muffin · Nov 27, 2013 at 04:59 PM 0
Share

Is there a way to do this for iOS too?

avatar image
2

Answer by Troula · Apr 10, 2014 at 08:11 PM

It might me late for an answer but just in case somebody else might look for something like this in the future I would like to add that Input.location.lastdata actually uses the GPS function on android and gives pretty accurate results as well (for the latitude and longtitude at least).


I am using the code that the documendation has with the Input.location to retrieve the information without having wifi or 3g enabled on my phone.

Comment
Add comment · Show 1 · 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 KnightRiderGuy · Dec 18, 2015 at 01:47 PM 0
Share

@Troula, Would this kind of thing work on a Stand Alone Player build for either a $$anonymous$$ac or PC car computer?

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

20 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

Related Questions

AR + GPS location based object/ collider 1 Answer

How to import GPS location coordinates from Android device? 4 Answers

Input.location problem 0 Answers

Radius around GPS location 1 Answer

Ask for Location permission at the start of the App 1 Answer

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