i try use azure mobile services simple forms app , don't work. last command run forever. checked internet connection webclient , okay. code works fine in simple windows console application.
var ms = new mobileserviceclient( @"https://xxx.azure-mobile.net/", @"xxx" ); imobileservicetable<todoitem> todotable = ms.gettable<todoitem>(); list<todoitem> items = todotable .where(todoitem => todoitem.complete == false).tolistasync().result;
edit: use xamarin studio because have indie license. debug tried samsung galaxy s3 , huawei ascend p7, result same. have updated xamarin , produces interesting exception if use async-await result.
java.lang.runtimeexception: java.lang.reflect.invocationtargetexception @ --- end of managed exception stack trace --- @ java.lang.runtimeexception: java.lang.reflect.invocationtargetexception @ at com.android.internal.os.zygoteinit.main(zygoteinit.java:675) @ at dalvik.system.nativestart.main(native method) @ caused by: java.lang.reflect.invocationtargetexception @ 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:859) @ ... 2 more @ caused by: md52ce486a14f4bcd95899665e9d932190b.javaproxythrowable: system.nullreferenceexception: object reference not set instance of object @ at xamarin.forms.platform.android.formsapplicationactivity.onprepareoptionsmenu (android.views.imenu) <il 0x00007, 0x00050> @ android.app.activity.n_onprepareoptionsmenu_landroid_view_menu_ (intptr,intptr,intptr) [0x00011] in /users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d23da369/source/monodroid/src/mono.android/platforms/android-21/src/generated/android.app.activity.cs:4151 @ at (wrapper dynamic-method) object.fcd55d8e-49be-4c8f-b3a6-37be6bdb988f (intptr,intptr,intptr) <il 0x00017, 0x0005b> @ at md5530bd51e982e6e7b340b73e88efe666e.formsapplicationactivity.n_onprepareoptionsmenu(native method) @ at md5530bd51e982e6e7b340b73e88efe666e.formsapplicationactivity.onprepareoptionsmenu(formsapplicationactivity.java:110) @ at android.app.activity.onpreparepanel(activity.java:2612) @ at com.android.internal.policy.impl.phonewindow.preparepanel(phonewindow.java:518) @ at com.android.internal.policy.impl.phonewindow.doinvalidatepanelmenu(phonewindow.java:872) @ at com.android.internal.policy.impl.phonewindow$1.run(phonewindow.java:243) @ at android.view.choreographer$callbackrecord.run(choreographer.java:780) @ at android.view.choreographer.docallbacks(choreographer.java:593) @ at android.view.choreographer.doframe(choreographer.java:561) @ at android.view.choreographer$framedisplayeventreceiver.run(choreographer.java:766) @ at android.os.handler.handlecallback(handler.java:733) @ at android.os.handler.dispatchmessage(handler.java:95) @ at android.os.looper.loop(looper.java:136) @ at android.app.activitythread.main(activitythread.java:5290) @ ... 5 more
are sure not blocking ui combination of async / await (deadlock)? modify code follows:
imobileservicetable<todoitem> todotable = await ms.gettable<todoitem>(); list<todoitem> items = todotable.where(todoitem => todoitem.complete == false).tolistasync().configureawait(false);
see here more information specific problem: http://blog.stephencleary.com/2012/07/dont-block-on-async-code.html
for further informations deadlock, stephen clary has excellent blog this: http://blog.stephencleary.com/2012/02/async-and-await.html