put() in ResponseCache invoked with a wrong URI?

by Guitou » Mon, 03 Aug 2009 15:27:29 GMT


Sponsored Links
 Hi,
I extended ResponseCache as follow :

public class DataLoader extends ResponseCache {

        @Override
        public CacheResponse get(URI uri, String arg1,
                        Map<String, List<String>> arg2) throws IOException {
                // TODO Auto-generated method stub
                Log.i("DataLoader", "Get()" + uri);
                return null;
        }

        @Override
        public CacheRequest put(URI uri, URLConnection conn) throws
IOException {
                // TODO Auto-generated method stub
                Log.i("DataLoader", "Put()" + uri);
                return null;
        }
}

I use this code to retrieve datas :

                ResponseCache.setDefault(new DataLoader());
                URI uri;
                HttpURLConnection conn;
                try {
                        uri = new 
URI(" http://www.google.com/intl/en_ALL/images/logo.gif" ;);
                        conn = (HttpURLConnection)uri.toURL().openConnection();
                        InputStream inputStream;
                        inputStream = conn.getInputStream();
                        inputStream.close();
                } catch (MalformedURLException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                } catch (URISyntaxException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                }

But when I look to my logs, the URI sent to the get() method is good
( http://www.google.com/intl/en_ALL/images/logo.gif ) but in the put()
it does not give me the same URI but only  http://www.google.com 
Is that normal?
How to get the full url in put() ?
Thanks for your help!
--~--~---------~--~----~------------~-------~--~----~



put() in ResponseCache invoked with a wrong URI?

by Matt Kanninen » Sat, 19 Sep 2009 08:45:03 GMT


 I am seeing the same thing.



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


put() in ResponseCache invoked with a wrong URI?

by Matt Kanninen » Sat, 19 Sep 2009 11:13:24 GMT


 To answer the question of how to get the full url, my work around was
to use conn.getURL() instead of the passed URI.  So it would be:

        public CacheRequest put(URI uri, URLConnection conn) throws
IOException {
                // TODO Auto-generated method stub
                Log.i("DataLoader", "Put() " + conn.getURL);
                return null;
        }




--~--~---------~--~----~------------~-------~--~----~



put() in ResponseCache invoked with a wrong URI?

by Guitou » Wed, 30 Sep 2009 02:49:28 GMT


 I will give it a try! Thanks Matt





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. why in emulator, "/dev/eac" is connected with the audio?

Hi Buddies,

I wanna get understood that why in emulator "dev/eac" is the device of
audio,

as I know, in external/qemu/audio, there is all kinds audio drivers,
such as oss, alsa,

but I am very curious why in the android linux system, the "dev/eac"
is connected with those drivers.

Anybody can give me some light on that?

Max
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. How can we build a debug image of the Android?

Hi,

I wanted to build the debug image of the Android source.
I am using the following command
make TARGET_BUILD_TYPE=debug or HOST_BUILD_TYPE=debug

but i am getting errors and the build is not complete.

Is there anything wrong with the command?
How can I build a debug image of the Android source? What is the
command for the same?

Thanks and Regards,
-Devaraj
--~--~---------~--~----~------------~-------~--~----~

3. does media provider have private media file?

4. Using DNS Lookup

5. SlidingDrawer throws RuntimeException in onMeasure

6. Q: kernel module compilation / inside vs. outside kernel source tree

7. Creation of XML