Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
278 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 Reply

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...