Kofi
Kofi

Reputation: 65

How to use ksoap2 on Android 3.0+ Honeycomb

So I created a simple hello world program that uses ksoap2 on Android 2.3 and it works perfectly fine. However, when I use the exact same code on Android 3.0 Honeycomb (actually I'm using Android 3.1), it does not work. The app doesn't crash or anything, but it seems as if the ksoap2 operations is not completed or doesn't respond. Even though I have added:

to my AndroidManifest.xml file, it seems like ksoap2 is not responding. I was wondering if I have to make any additional changes since I'm using the Android 3.0+ sdk? Thanks.

Upvotes: 1

Views: 664

Answers (2)

Mustafa Güven
Mustafa Güven

Reputation: 15754

You must use another thread to call a webservice if the application which you are developing runs on the honeycomb (3.0) because UI thread does not support for this action otherwise it will be throwed out an exception called NetworkOnMainThreadException. for further information: Designing For Responsiveness

here is a tutorial about using soap on honeycomb without ksoap2 http://aaarkonusurum.blogspot.com/2011/10/3-party-kutuphane-kullanmadan-ksoap2.html

Upvotes: 0

Manfred Moser
Manfred Moser

Reputation: 29912

Most likely you are running the webservice request on the main UI thread, which is not allowed anymore in 3.0 upwards. Move it into an AsyncTask.

Upvotes: 2

Related Questions