RE: Re: Android and WCF DataService
We may have to drop back and remove RestLet if we cannot get the high GC and chatty call count figured out. Any Luck? Matthew -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2607173
RE: Re: Android and WCF DataService
Any luck with whats going on with the Android version of Restlet? Thierry- I have been working on my android app...but noticed some strange behaviors in the android logs that I wanted to pass your way. Here is a cut of sample code I am using in my app. String remoteServiceEndPoint = http://blah.blah.blah/iMMeta/webdataservice.svc;; Service myService = new Service(remoteServiceEndPoint); SysShoot ActiveShoot= new SysShoot(); ShootProviderHelper myHelper = new ShootProviderHelper(); QuerySysShoot theShootQuery = myService.createQuery(/sysShoots()?$filter=isActive eq true, SysShoot.class); IteratorSysShoot iShoot= theShootQuery.iterator(); Below is a snipit of log from my app that spits out for the above code. I wanted to check with you on a few things. 04-30 11:15:32.625: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:15:33.115: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:15:33.575: INFO/org.restlet(518): Starting the default HTTP client 04-30 11:15:34.034: INFO/global(518): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:15:34.055: INFO/global(518): Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:15:45.764: INFO/org.restlet(518): Get the metadata for http://digital-furnace.com/iMMeta/webdataservice.svc/ at http://digital-furnace.com/iMMeta/webdataservice.svc/$metadata 04-30 11:15:45.945: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:15:46.485: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:15:46.965: INFO/org.restlet(518): Starting the default HTTP client 04-30 11:15:47.275: INFO/global(518): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:15:47.295: INFO/global(518): Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:15:53.944: DEBUG/dalvikvm(518): GC freed 12463 objects / 646712 bytes in 109ms 04-30 11:16:01.104: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:16:01.725: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:16:02.234: INFO/org.restlet(518): Starting the default HTTP client 04-30 11:16:02.555: INFO/global(518): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:16:02.574: INFO/global(518): Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:16:06.775: DEBUG/dalvikvm(518): GC freed 14622 objects / 764968 bytes in 98ms 04-30 11:16:11.654: DEBUG/dalvikvm(518): GC freed 13481 objects / 835208 bytes in 107ms 04-30 11:16:16.834: DEBUG/dalvikvm(518): GC freed 13575 objects / 809480 bytes in 92ms 04-30 11:16:22.145: DEBUG/dalvikvm(518): GC freed 13529 objects / 808816 bytes in 111ms 04-30 11:16:27.974: DEBUG/dalvikvm(518): GC freed 14672 objects / 874640 bytes in 113ms 04-30 11:16:33.394: DEBUG/dalvikvm(518): GC freed 13786 objects / 820520 bytes in 99ms 04-30 11:16:38.265: DEBUG/dalvikvm(518): GC freed 13235 objects / 822288 bytes in 101ms So for Service myService = new Service(remoteServiceEndPoint); QuerySysShoot theShootQuery = myService.createQuery(/sysShoots()?$filter=isActive eq true, SysShoot.class); IteratorSysShoot iShoot= theShootQuery.iterator(); 1- It is doing a roundtrip to the server...Is there anyway to cache the requests until the query is actually called by hitting the iterator or someother method to start getting the results? It seems kinda Chatty over Chunky 2-There is a TON of GC going on for all the objects getting created as you can tell by the logs. The result of the query is not very big...but there are a log of objects being subject to GC. Is that normal? My app becomes non-responsive until the last GC(although I thought the GC was non-blocking..unless the CPU is maxed). As you can tell from the timestamps...it takes quite a while for the GC to finish. Any help sorting out what is going on with
RE: Re: Android and WCF DataService
Thierry- I have been working on my android app...but noticed some strange behaviors in the android logs that I wanted to pass your way. Here is a cut of sample code I am using in my app. String remoteServiceEndPoint = http://blah.blah.blah/iMMeta/webdataservice.svc;; Service myService = new Service(remoteServiceEndPoint); SysShoot ActiveShoot= new SysShoot(); ShootProviderHelper myHelper = new ShootProviderHelper(); QuerySysShoot theShootQuery = myService.createQuery(/sysShoots()?$filter=isActive eq true, SysShoot.class); IteratorSysShoot iShoot= theShootQuery.iterator(); Below is a snipit of log from my app that spits out for the above code. I wanted to check with you on a few things. 04-30 11:15:32.625: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:15:33.115: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:15:33.575: INFO/org.restlet(518): Starting the default HTTP client 04-30 11:15:34.034: INFO/global(518): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:15:34.055: INFO/global(518): Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:15:45.764: INFO/org.restlet(518): Get the metadata for http://digital-furnace.com/iMMeta/webdataservice.svc/ at http://digital-furnace.com/iMMeta/webdataservice.svc/$metadata 04-30 11:15:45.945: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:15:46.485: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:15:46.965: INFO/org.restlet(518): Starting the default HTTP client 04-30 11:15:47.275: INFO/global(518): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:15:47.295: INFO/global(518): Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:15:53.944: DEBUG/dalvikvm(518): GC freed 12463 objects / 646712 bytes in 109ms 04-30 11:16:01.104: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:16:01.725: INFO/global(518): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 04-30 11:16:02.234: INFO/org.restlet(518): Starting the default HTTP client 04-30 11:16:02.555: INFO/global(518): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:16:02.574: INFO/global(518): Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required. 04-30 11:16:06.775: DEBUG/dalvikvm(518): GC freed 14622 objects / 764968 bytes in 98ms 04-30 11:16:11.654: DEBUG/dalvikvm(518): GC freed 13481 objects / 835208 bytes in 107ms 04-30 11:16:16.834: DEBUG/dalvikvm(518): GC freed 13575 objects / 809480 bytes in 92ms 04-30 11:16:22.145: DEBUG/dalvikvm(518): GC freed 13529 objects / 808816 bytes in 111ms 04-30 11:16:27.974: DEBUG/dalvikvm(518): GC freed 14672 objects / 874640 bytes in 113ms 04-30 11:16:33.394: DEBUG/dalvikvm(518): GC freed 13786 objects / 820520 bytes in 99ms 04-30 11:16:38.265: DEBUG/dalvikvm(518): GC freed 13235 objects / 822288 bytes in 101ms So for Service myService = new Service(remoteServiceEndPoint); QuerySysShoot theShootQuery = myService.createQuery(/sysShoots()?$filter=isActive eq true, SysShoot.class); IteratorSysShoot iShoot= theShootQuery.iterator(); 1- It is doing a roundtrip to the server...Is there anyway to cache the requests until the query is actually called by hitting the iterator or someother method to start getting the results? It seems kinda Chatty over Chunky 2-There is a TON of GC going on for all the objects getting created as you can tell by the logs. The result of the query is not very big...but there are a log of objects being subject to GC. Is that normal? My app becomes non-responsive until the last GC(although I thought the GC was non-blocking..unless the CPU is maxed). As you can tell from the timestamps...it takes quite a while for the GC to finish. Any help sorting out what is going on with RestLet and WCF would be great. Matthew Hello Matthew, I just would like to tell you that the internal connector now works on Android.
Re: Android and WCF DataService
Working great now. Thanks for the fix On Mon, Mar 22, 2010 at 7:23 AM, Thierry Boileau thierry.boil...@noelios.com wrote: Hello Matthew, thanks for your report. I've updated the svn repository. Best regards, Thierry Boileau Thanks again Thierry... That totally cleared up somethings that were getting in my way. As I started to take the objects and expanding some of the children objects, I needed to use the .expand() functions open to OData. According to the docs, this should now work in RC1. Using your generated code, I tried to expand the objects with: QueryRefFolderLocation query = service.createRefFolderLocationQuery(/refFolderLocations(1)).expand(refURIType); The previous code does not load the child object's data(refURIType), although it doesnt blow any errors. If we change the query to return a list: (/refFolderLocations).expand(refURIType) We get Can't parse the content of http://digital-furnace.com/OtherMeta/webdataservice.svc/refFolderLocations?$expand=refURIType java.io.IOException: Couldn't parse the source representation: java.lang.NullPointerException This may be a bug? Matthew Hello Matthew, I send you a sample project that consumes your service using the classes generated by the OData extension (actually the RefForlderLocation entity). I was able to get and display the data. I hope this will help you. Best regards, Thierry Boileau Thanks Thierry- I added Engine.getInstance().getRegisteredClients().clear(); Engine.getInstance().getRegisteredClients().add(new HttpClientHelper(new Client(Protocol.HTTP))); Service myWCF = new Service(http://digital-furnace.com/OtherMeta/webdataservice.svc/; http://digital-furnace.com/OtherMeta/webdataservice.svc/); But no luck. Same outcome. No errors...but the objects are not getting loaded. I do now get - [WARNING][org.restlet] No available client connector supports the required protocols: 'HTTP' . Please add the JAR of a matching connector to your classpath. But the correct JAR is in the classpath, as Protocol.HTTP is being resolved from that JAR. Thanks Matthew Hello Matthew, I think your problem is due to the internal connector which does not work with Android (seehttp://restlet.tigris.org/issues/show_bug.cgi?id=304). Can you try by adding the net extension (org.restlet.ext.net;jar) to the classpath of your project with the following lines, for example in the onCreate() method. Engine.getInstance().getRegisteredClients().clear(); // Add the net client connector Engine.getInstance().getRegisteredClients().add(new HttpClientHelper(new Client(Protocol.HTTP))); Note that this is a workaround since the connectors are nor properly discovered on the Android plate-form (http://restlet.tigris.org/issues/show_bug.cgi?id=941). Regarding the log, we will provide a bridge between the classic Logger and the android Log class. Best regards, Thierry Boileau --http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2460828 --http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2461210 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2463854
Logging and Android
Ok.. So before I put this out there..No bashing the newbie! I am starting to do development on the Android using Restlet to talk with my WCF OData services. Using the examples, I had working code talking to my back-end services using a snapshot build from 2 weeks ago. I updated to the latest snapshot this AM, and my code stopped returning objects. I dont get any errors in the console of Eclipse I just get [INFO][org.restlet] Get the metadata for http://digital-furnace.com/iMMeta/webdataservice.svc/ at http://digital-furnace.com/iMMeta/webdataservice.svc/$metadata [INFO][org.restlet] Starting the default HTTP client So no errors, but the objects are not populated. If I look @ the ODATA feed, there is valid JSON data there for the code to work with. My question is two-fold- How can I, via code, get the info, and debug logging? I want to help figure out what happened, but am flying blind. Second-Did anything change that would make this no longer work? As I said, it work with the last snapshot build. Service myWCF = new Service(http://digital-furnace.com/iMMeta/webdataservice.svc/;); QuerySysFolder myFolders = myWCF.createQuery(/sysFolders,SysFolder.class); I could fall back and user the M7 build, but the OData namespace was changed, and i am trying to just move forward with the new namespace/objects. Thanks Matthew -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2458802
RE: Re: Logging and Android
Gotcha. But as an aside... How can I quickly enable DEBUG logging via Eclipse? I have read the docs...but there is nothing around quickly getting a deeper output. Or do I need to get the whole mylogging.properties file config'd, set the VM to start with it? MJD -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2458815