• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Import Problem

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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";
?>
-------
reply
    Bookmark Topic Watch Topic
  • New Topic