Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 broesby · Dec 19, 2013 at 05:43 PM · androidnetworkaccelerometer

Access android accelerometer via Wifi / 3g-4g

Would it be possible to access an android phones accelerometer data in near real-time from a standalone PC unity program via Wifi/LAN ... or even better : a Unity webplayer via 3g/4g ??

I was thinking to set up a client on the phone and server on the PC. I am in the process of learning network functionality of Unity now.

The SPECIFIC answer I look for is this: Would the above be possible WITHOUT the need for "the customer" to set up a server, open up data traffic for UDP, closing down firewall and stuff like that.

Just don't want to go through the process of creating a killer-app only to discover that it only works if my customers are computer savvy enough to set up a server.

Cheers, Jesper

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Dec 19, 2013 at 06:26 PM

Your description is confusing and contradicting with some of your requirements. Also it's missing the exact purpose. Who is the customer? (not which person, what does he get from you? where should it be run on? Is it a multiplayer "thing" / game or singleplayer?) What do you consider "setting up" a server? A server is an application that needs to be started in the first place.

Now some assumptions since i probably don't get all required information from the next post ;)

From what i can read it seems you want to create a PC game / application and use an Android device as remote control for the PC game / application. Generally it doesn't matter if you run your PC game as Standalone application or as webplayer application. The basic features of Unity work on all platforms.

If it's a singleplayer game you can simply open a local server and let your Android device connect to your game. If the device is in the same wlan as the PC you shouldn't have much connection problems unless the user has a strict firewall. However connecting from a 3g connection means the android device connects from the internet, i.e. from outside. Now it depends on whether your customers router does "support" NAT punchthrough or not. If not you can't connect if your customer doesn't port-forward your specific port.

As for the "near realtime", even on the Android device itself it's not realtime since the hardware runs seperate from your game and could have a lower sample rate than your frame rate. Network traffic always has latency, even when you have a really, really good connection it's still there.

As for the "firewall closing / configuration" that's the wrong way to process this issue. If your customer has an active firewall, it's his problem. All you can do is tell him that a firewall might cause problems. A firewall is made for causing problems for foreign applications. That's the one and only purpose of a firewall. It has to be configured by your customer, there's no way around this. If there was a way around, the firewall would be useless.

We live in a more and more complex and complicated world. You can't make everything idiot-proof. If there was a petition for the requirement of an "internet license" to be allowed to use the internet, i would sign it, any time.

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 broesby · Dec 19, 2013 at 07:12 PM 0
Share

Thx a lot Bunny,..

I kinda knew I was vague in the description because I lack knowledge in the network field, most program$$anonymous$$g as a matter of fact. But I learn as I go along and until now been quite successfull :) I know it must be a pain for all you REAL programmers... Thanks a lot for keeping up with me and others :)

You were quite successful in figuring out my needs. I want to use the android device as a controller for a bigger screen, PC or other. Although not in the traditional controller way... :)

... And you gave me the answer I needed. As long as it is inside a LAN it should work fairly easily. Via the internet it would be more difficult....

Is NAT punchthrough support common??

About the "real-time" I just meant decent for a controller. I know there will be delay.

All in all it seems I should focus on LAN/wifi... for now at least ;-)

Thx m8

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.

Follow this Question

Answers Answers and Comments

19 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

Related Questions

Can you use Unity to make multiplayer IOS/Android games? 1 Answer

Troubles with network in development build with Android 0 Answers

Jet Accelerometer Script 1 Answer

How to set mobile device position zero 1 Answer

Does UnityEngine.Ping currently support ipv6 addresses on mobile devices? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges