Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 /
This question was closed Mar 14, 2016 at 02:49 PM by EnriqueL for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by EnriqueL · Jul 30, 2015 at 10:01 AM · c#androidiosnetwork

How can I get the WiFis name?

Hi, i'm doing a game to both android and IOs platforms, and i need to know if the users is connected to a certain WiFi, i can know if the user is conected to a WiFi using

 `if(Application.internetReachability==NetworkReachability.ReachableViaLocalAreaNetwork)`


but i need to know more info about that WiFi, overall the name of the WiFi, how can it be done in C#?

Thanks in advance.


[EDIT]

Now i'm using [Managed WiFi Api][1], in the PC I can get the WiFi name using:

 using System.Net;
 using System.Net.NetworkInformation;
 using System.Net.Sockets;
 using NativeWifi;
 
 public void InterfacesNetwork(){
 
             WlanClient wlan = new WlanClient();
             List<string> connectedSsids = new List<string>();
             foreach (WlanClient.WlanInterface wlanInterface in wlan.Interfaces)
             {
                 Wlan.Dot11Ssid ssid = wlanInterface.CurrentConnection.wlanAssociationAttributes.dot11Ssid;
                 //connectedSsids.Add(new String(Encoding.ASCII.GetChars(ssid.SSID,0, (int)ssid.SSIDLength)));
                 Debug.Log("ssid en string: "+ssid.ToString());
                 Debug.Log(ssid.SSID.ToString());
             }
             foreach(WlanClient.WlanInterface wlanIface in wlan.Interfaces){
                 foreach(Wlan.WlanProfileInfo profileinfo in wlanIface.GetProfiles()){
                     Debug.Log("nombre red: "+profileinfo.profileName);
                 }
                         }
 
             
     }

But when I try it on Android give me an error: ![DLL import error][2]

i've tried downloading and adding the DLL, but it's still the same. Any one has a clue? thaks!! [1]: http://managedwifi.codeplex.com/ [2]: /storage/temp/51332-errorunity.jpg

errorunity.jpg (57.2 kB)
Comment
Add comment · Show 2
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 NeverHopeless · Jul 30, 2015 at 11:13 AM 0
Share

I don't think so you can get more than that. Native functions are not offering more on that.

avatar image MrShneebli · Jan 24, 2018 at 07:55 AM 0
Share

Any luck with this in the end? I just need to know which wifi I am connected to.

1 Reply

  • Sort: 
avatar image
1

Answer by PAHeartBeat · Jul 30, 2015 at 11:18 AM

Hi,

you need to write some platform spesisfic code need to use as plugin. you can also call use this one using c# (https://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkinterface(v=vs.80).aspx) but I am not sure its work or not in mobile device or console games.

here is another example but I fear it;s only support windows device (http://www.codeproject.com/Articles/35329/How-to-access-wireless-network-parameters-using-na)

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

Follow this Question

Answers Answers and Comments

24 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

Related Questions

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

Distribute terrain in zones 3 Answers

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

Detect RAM usage of program 0 Answers

Scriptable object doesn't load in the build of the project 1 Answer


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