• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Import Problem

 
prazannag Kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to include the following header files but these are can't resolved.

import android.net.http.EventHandler;
import android.net.http.Headers;
import android.net.http.RequestQueue;

I got the Error Message:
"The import android.net.http.RequestQueue cannot be resolved"

Can anyone please tell me, how to fix this issue.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Android API does not have any of these classes, in any package, as can be easily verified by looking at the API docs. What makes you think that they exist?
 
prazannag Kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to connect the android application with PHP page. So these classes are needed to perform. I found the android.net.http does not contain any of the classes i mentioned before. Let me know how to fix it..
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you actually read -and think about- what I wrote? What is the answer to the question I asked?
 
prazannag Kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I got it now. I just confused by refer some sample codes. So we have to write those classes. Thanks a lot. Also i have one more doubt in ksoap2. I tried to connect the android application to PHP. But it seems no response. Let me know what I did wrong...
---------
package com.org.WebTest;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class WebTest extends Activity {
/** Called when the activity is first created. */

private static final String SOAP_ACTION = "HelloYou";
private static final String METHOD_NAME = "getHello";
private static final String NAMESPACE = "urn:HelloYou";
private static final String URL = "http://115.240.187.197/mypro/services.php";



private Object resultsRequestSOAP = null;

@Override
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
TextView tv = new TextView(this);
setContentView(R.layout.main);
// final TextView ot=(TextView)findViewById(R.id.tvv);

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);


//SoapObject
request.addProperty("firstname", "prasanna");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);


HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try
{
androidHttpTransport.call(SOAP_ACTION, envelope);
resultsRequestSOAP = envelope.getResponse();
String[] results = (String[]) resultsRequestSOAP;
tv.setText( results[0].toString());


}
catch (Exception aE)
{
aE.printStackTrace ();
tv.setText(aE.toString());
}
}
-----
my PHP code is :

<?php
echo "prasanna";
?>
-------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic