on 01-20-2015 2:25 PM
Hello,
I am creating the native Android app that is using oData and connects to NW Gateway or SMP 3.0 for data provisioning. Following how-to guides for android from Claudia Pacheco I managed well along the way to connect to SMP, get some entities back and parse data.
However one of my requirements is to download the binary attachment that are modeled as mediaLink in NW gateway and are accessible over urls like Document('ID00001')/$value
When I try to put a code like one below system fails with message that I have wrong conversation
OnlineODataStore store = openListener.getStore();
ODataResponseSingle resp = store.executeReadEntity("Document('ID00001')/$value", null);
When I look at logs in SMP server or testing the URL in Gateway I see that file content is sent to mobile device and apparently it fails at parsing it inside ODataResponseSingle handler also, when I test the same URL from browser pointing directly to NW Gateway I can get the file downloaded without any problems.
Can someone point me in right direction on how to download media content properly to mobile devices as I am a bit stuck there at the moment?
Best regards, Artem
Hi Artem,
Could you try using this method?
store.executeReadPropertyRaw(<resourcepath>,<options>)
where resourcePath
is the resource path of the raw value of a property to be read
More information about this method can be found here http://help.sap.com/saphelp_smp305sdk/helpdata/en/83/3d99c280d71014b270ceb0b562eaea/content.htm
Let me know,
Best regards
Claudia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Claudia,
Thank you for following up on it.
Yes, I will do the ticket for it.
For those who run in the same issue - it looks like processing code in Android side some how changes as stream so usual processing is not possible. As workaround we catch the stream in ResponseFilter where the stream is still OK - we take it from there.
Best regards, Artem
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.