Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by codeZero · Jun 16, 2011 at 02:14 AM · androidwww

WWW didnt work on device ON UNITY 3.3?

i make this code using C Sharp to send the data to the server. it works on the unity simulator but didnt work on android device. im using nexus S and nexus one. Is there any problem with my code? it works on unity 3.0 but in unity 3.3(trail version) it didnt work anymore. using UnityEngine; using System.Collections;

public class SendDetails : MonoBehaviour {

 public string url = "test url";
 public string key = "test key";
 public string urlCheck = "test url";
 
 [HideInInspector]
 public bool sent = false; 
 public bool loading = false;
 public void SumUpData(string name, string ic, string contact, int score, int level, float height)
 {
     loading=true;
     WWWForm form = new WWWForm();
     form.AddField("key", key);
     form.AddField("ic", ic);
     form.AddField("username", name);
     form.AddField("contact", contact);
     form.AddField("score", score.ToString());
     form.AddField("level", level.ToString());
     form.AddField("height", height.ToString());
     WWW www = new WWW(url, form);

     StartCoroutine(WaitForRequest(www));
 }
 public void checkInternet()
 {
     WWW www = new WWW(url);

     StartCoroutine(WaitForRequest(www));
 }
 
 IEnumerator WaitForRequest(WWW www)
 {
    yield return www;

     if (www.error == null)
     {
         
         Debug.Log("WWW Ok!: " + www.text);
         loading=false;
         sent = true;
     } 
     else 
     {
         
         Debug.Log("WWW Error: "+ www.error);
         loading=false;
         sent = false;
     
     }    
     
      
 }
 
 

     


}

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 DaveA · Jun 16, 2011 at 05:39 AM

One thing to try is can you get your content by using Android's web browser (any of them)? I just had this happen to me, where I couldn't see some content in Unity, but tried the browser, didn't see it there either.

The problem stems from something I don't quite understand having to do with DNS (default?) on Android. It doesn't have one or something. Hitting the numeric IP address got me what I needed.

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 codeZero · Jun 17, 2011 at 03:49 AM 0
Share

im not quite understand about the hitting the numeric IP address. Did you means that i need to change the ip inside my android or change the url?

public string url = "http://www.google.com"; into public string url = "http://192.168.0.0"; ?

Thanks

avatar image
0

Answer by Richard 3 · Nov 16, 2011 at 02:11 PM

Upgrade Unity to 3.4.1 or higher. I had a similar problem, upgrading sorted it out.

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.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Guys please help me!!how to download xml file from url in android device runtime 1 Answer

Unable to stream online video on android 1 Answer

Save an image to PersistentDataPath then access it again 1 Answer

Get file list from a directory on Android 4 Answers

WWW.GetAudioClip hardware decoding? ( on iphone and android ) 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