Take the 2-minute tour ×

I need to do a project on J2me and Android. So I just want to create a common library in webservice for both android and j2me, so that I can use in both as common. I have tried in J2ME and I get response with ksoap2-j2me-core-2.1.2 and in Android I tried with ksoap2-android-assembly-2.4-jar-with-dependencies and it is working. But I could not use same in both as the

HttpTransportSE j2meHttpTransport = new HttpTransportSE(URL);

HttpTransportSE is for Android and for J2me

HttpTransport j2meHttpTransport = new HttpTransport(URL);    

it is HttpTransport.

So can anyone please help me to give information about a common jar for ksoap2 in J2me and android so that I can use common library?

share|improve this question
you haven't added j2me tag, should add it. –  Lalit Poptani Dec 28 '11 at 6:59
anybody pls give some information.Please at least some ideas. –  user977808 Dec 28 '11 at 7:23
why would you need that? I mean you're OK having two distributables one for J2ME another for Android aren't you? what would you expect to gain from such a common library? –  gnat Dec 28 '11 at 9:47
Obviously if you have a common library you can develop it once and test it once and then just write two UI layers for it. Reduces a lot of work.. –  Manfred Moser Dec 29 '11 at 18:31
add comment

1 Answer

You could just implement your own transport that works on both.. or you could create a helper class that decides dynamically at runtime which transport to use and have it in your library that you use on both platforms. Keep in mind though that for j2me you will need to make sure the library is compiled for Java 1.3...

share|improve this answer
add comment

Your Answer


