Problems using the EWS Java API on Android

南楼画角 提交于 2019-11-30 09:12:14
user1106480

You can use microsoft's EWS api for android by doing the following steps,

  1. download the source code available in the URL, http://archive.msdn.microsoft.com/ewsjavaapi EWSJavaAPI_1.1.5.zip

  2. Make the changes to above api to work for JDK 1.4 in eclipse like remove override annotations e.t.c

  3. Download source code of javax.* package available in below URL, http://www.java2s.com/Code/JarDownload/jsr173/jsr173_1.0_src.jar.zip

  4. Download source code of stax api available in below URL, http://dist.codehaus.org/stax/distributions/stax-src-1.2.0.zip

  5. Keep all the sources under the single java project in eclipse

  6. Open the project explorer and select the package which are starts with "javax" and rename to your company name eg: com. Note: Eclipse will ask for all the naming contexts will change then click OK.

  7. Export all the java sources to one single jar file.

  8. Then You good to go to use the jar in Android application with out any problems.

I used the same way explained above and it worked in android application 100% perfectly.

This isn't a useful answer but I've also been struggling to look at the EWS API over the last couple of weeks, with no success. The main issue I've found is it references a lot of the javax APIs which aren't on Android. There's a hack you can find that explains how to "re-class" these but I've not got it working yet; in addition, the DnsClient references some namespaces that jarsearches only return for rt.jar - the main runtime. And including this in an Android app would just be crazy!

Before finding the API I was trying to use KSOAP to communicate with EWS but again ran into problems - you need to be able to do NTLM and SSL and I couldn't find any way of combining all these with KSOAP in any simple way.

The EWS API looks the way to go (why re-invent the wheel) but getting it working on Android looks very tricky (if not impossible)

Faison N.P

Please check this library for the solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!