Note that there are some explanatory texts on larger screens.

plurals
  1. POjava.net.SocketException: Address family not supported by protocol
    primarykey
    data
    text
    <p>in android I am getting the following error:</p> <blockquote> <p>NativeStart.main(String[]) line: not available [native method]</p> </blockquote> <p>my code is trying to use webservices:</p> <pre><code>import java.io.IOException; import android.app.Activity; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; import org.xmlpull.v1.XmlPullParserException; import android.app.*; import android.content.Context; import android.os.*; import android.widget.TextView; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Project_InvokeServiceActivity extends Activity { /** Called when the activity is first created. */ private static final String SOAP_ACTION = "http://tempuri.org/userg"; private static final String METHOD_NAME = "userg"; private static final String NAMESPACE = "http://tempuri.org/"; private static final String URL = "https://amaman.NewService/Permissions.asmx"; // TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // tv=(TextView)findViewById(R.id.text1); // call(); TextView tv = new TextView(this); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); request.addProperty("username", "222222"); request.addProperty("ID", "123"); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); setContentView(tv); try { HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); tv.setText("t"); ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = cm.getActiveNetworkInfo(); if (netInfo != null &amp;&amp; netInfo.isConnectedOrConnecting()) { tv.setText("connected"+netInfo.getExtraInfo()); } else{ tv.setText("not conn"); } try{ androidHttpTransport.call(SOAP_ACTION, envelope); tv.setText("t1"); }catch(Exception e){ //tv.setText(e.getClass().getName()); } // tv.setText("inside2"); Object result = (Object)envelope.getResponse(); } catch (Exception e2) { // TODO Auto-generated catch block //e.printStackTrace(); TextView tv5 = new TextView(this); //tv3.setText(e1.getMessage()); // tv.setText(result.toString()); tv5.setText("exception"+e2.getClass()+"xxx"); setContentView(tv); } // tv.setText(result.toString()); // tv.setText("inside"); // setContentView(tv); } </code></pre> <p>my program is connecting to internet....but it is throwing exception in the line below:</p> <pre><code>androidHttpTransport.call(SOAP_ACTION, envelope); </code></pre> <p>and exception messege is NULL. All the parameter passed are correct.AndroidManifest.xml is also ok.</p> <p>In Log Cat i am getting this exception: java.net.SocketException: Address family not supported by protocol </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload