Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
271 views
in Technique[技术] by (71.8m points)

ksoap2 - How do I import jars in an android project?

I am using Eclipse. I have followed multiple tutorials for setting up ksoap on my android project. The ksoap2 jar file is included in my build path. The tutorial includes the lines below.

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    SoapSerializationEnvelope envelope = new SoapSerializaionEnvelope(SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);

SoapObject is underlined in red and when I hover over it I'm not prompted with an option to import it. Create class, Create interface, etc. are options.

Any help is greatly appreciated.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I copy the jars into my project's libs folder. Make the libs dir if its not there. Go into Eclipse select your project, right-click/refresh (F5 works?). You'll see the lib folder show up in your files panel.

Once the lib displays in your project, go into project->properties->java build path [add jars]. You should see your lib folder with the jar in that folder. Select it and you should be good.

Once that is setup, the project should see it... try using clean.

enter image description here

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...