Noman Ud Din
Lurker
I know this question has been asked several time but not a single solution worked for me. I spent almost three days on all the available solutions
I am using android studio.
I have used code and libraries provided on this link: Github link for ews project
But I am facing following error:
My Build.gradle file:
My code where I am calling ews:
I am using android studio.
I have used code and libraries provided on this link: Github link for ews project
But I am facing following error:
Java:
java.lang.VerifyError: microsoft/exchange/webservices/data/ExchangeServiceBase
at culha.roomdispaly.MainActivity.onCreate(MainActivity.java:125)
at android.app.Activity.performCreate(Activity.java:5411)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2396)
at android.app.ActivityThread.access$800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
My Build.gradle file:
Java:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'}
defaultConfig {
applicationId "culha.roomdispaly"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile files('libs/commons-lang-2.6.jar')
compile files('libs/commons-logging-1.1.1.jar')
compile files('libs/ical4j-1.0.3.jar')
compile files('libs/backport-util-concurrent.jar')
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile files('libs/ews-java-api-2.0.jar')
compile files('libs/jcifs-1.3.15.jar')}
}
My code where I am calling ews:
Java:
try {
ExchangeService service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials("xxxxx", "xxxx");
service.setCredentials(credentials);
service.setUrl(new URI("https://xxx.xxx.comxxxx"));
FolderView view = new FolderView(10);
PropertySet set = new PropertySet(BasePropertySet.IdOnly);
set.add(FolderSchema.DisplayName);
view.setPropertySet(set);
SearchFilter searchFilter = new SearchFilter.IsGreaterThan(FolderSchema.TotalCount, 0);
view.setTraversal(FolderTraversal.Deep);
FindFoldersResults findFolderResults = service.findFolders(WellKnownFolderName.Root, searchFilter, view);
for (Folder folder : findFolderResults)
{ if (folder instanceof CalendarFolder)
{ System.out.println("Calendar folder: " + folder.getDisplayName());
//calendarNames.add(folder.getDisplayName() + "," + folder.getId());
}
}
//ewstest.connectViaExchangeManually("Meetingroom1@culha-consulting.de","Meeting1234");
//ExchangeWebservice.connectViaExchangeManually("Meetingroom1@culha-consulting.de","Meeting1234");
} catch (Exception e) {
e.printStackTrace();
}