{"action":"created","issue":{"url":"https://api.github.com/repos/ncornette/OkCacheControl/issues/1","repository_url":"https://api.github.com/repos/ncornette/OkCacheControl","labels_url":"https://api.github.com/repos/ncornette/OkCacheControl/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/ncornette/OkCacheControl/issues/1/comments","events_url":"https://api.github.com/repos/ncornette/OkCacheControl/issues/1/events","html_url":"https://github.com/ncornette/OkCacheControl/issues/1","id":163505194,"number":1,"title":"HTTP FAILED: java.net.UnknownHostException: Unable to resolve host \"<host_name>\": No address associated with hostname","user":{"login":"nikunjgundaniya","id":13249228,"avatar_url":"https://avatars.githubusercontent.com/u/13249228?v=3","gravatar_id":"","url":"https://api.github.com/users/nikunjgundaniya","html_url":"https://github.com/nikunjgundaniya","followers_url":"https://api.github.com/users/nikunjgundaniya/followers","following_url":"https://api.github.com/users/nikunjgundaniya/following{/other_user}","gists_url":"https://api.github.com/users/nikunjgundaniya/gists{/gist_id}","starred_url":"https://api.github.com/users/nikunjgundaniya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikunjgundaniya/subscriptions","organizations_url":"https://api.github.com/users/nikunjgundaniya/orgs","repos_url":"https://api.github.com/users/nikunjgundaniya/repos","events_url":"https://api.github.com/users/nikunjgundaniya/events{/privacy}","received_events_url":"https://api.github.com/users/nikunjgundaniya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-02T06:39:26Z","updated_at":"2016-07-02T10:52:19Z","closed_at":null,"body":"I have used your class to provide offline support to network calls. But got this error. I am using Control class this way. It's works well when online though!\r\n\r\n    private static OkHttpClient provideOkHttpClient() {\r\n\r\n        return OkCacheControl.on(new OkHttpClient.Builder())\r\n                .overrideServerCachePolicy(30, TimeUnit.MINUTES)\r\n                .apply() // return to the OkHttpClient.Builder instance\r\n                .build();\r\n\r\n    }"},"comment":{"url":"https://api.github.com/repos/ncornette/OkCacheControl/issues/comments/230095976","html_url":"https://github.com/ncornette/OkCacheControl/issues/1#issuecomment-230095976","issue_url":"https://api.github.com/repos/ncornette/OkCacheControl/issues/1","id":230095976,"user":{"login":"nikunjgundaniya","id":13249228,"avatar_url":"https://avatars.githubusercontent.com/u/13249228?v=3","gravatar_id":"","url":"https://api.github.com/users/nikunjgundaniya","html_url":"https://github.com/nikunjgundaniya","followers_url":"https://api.github.com/users/nikunjgundaniya/followers","following_url":"https://api.github.com/users/nikunjgundaniya/following{/other_user}","gists_url":"https://api.github.com/users/nikunjgundaniya/gists{/gist_id}","starred_url":"https://api.github.com/users/nikunjgundaniya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikunjgundaniya/subscriptions","organizations_url":"https://api.github.com/users/nikunjgundaniya/orgs","repos_url":"https://api.github.com/users/nikunjgundaniya/repos","events_url":"https://api.github.com/users/nikunjgundaniya/events{/privacy}","received_events_url":"https://api.github.com/users/nikunjgundaniya/received_events","type":"User","site_admin":false},"created_at":"2016-07-02T10:52:19Z","updated_at":"2016-07-02T10:52:19Z","body":"Thanks for the reply. I have added the cache like this.\r\n\r\n    private static Cache provideCache() {\r\n        Cache cache = null;\r\n        try {\r\n            cache = new Cache(new File(AdeptAndroid.getInstance().getCacheDir(), \"http-cache\"),\r\n                    10 * 1024 * 1024); // 10 MB\r\n        } catch (Exception e) {\r\n            Log.d(\"Test\", \"Could not create Cache!\");\r\n        }\r\n        return cache;\r\n    }\r\n\r\nChanged OkHttpControl initialization\r\n\r\n    private static OkHttpClient provideOkHttpClient() {\r\n\r\n        return OkCacheControl.on(new OkHttpClient.Builder())\r\n                .overrideServerCachePolicy(30, TimeUnit.MINUTES)\r\n                .apply() // return to the OkHttpClient.Builder instance\r\n                .cache(provideCache())\r\n                .build();\r\n    }\r\n\r\nFor forceCacheWhenOffline() it's requires the NetworkMonitor. Can you please tell me how can I get one?"}}
{"actor":{"display_login":"nikunjgundaniya"}}