{"action":"created","issue":{"url":"https://api.github.com/repos/pires/android-obd-reader/issues/107","labels_url":"https://api.github.com/repos/pires/android-obd-reader/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/pires/android-obd-reader/issues/107/comments","events_url":"https://api.github.com/repos/pires/android-obd-reader/issues/107/events","html_url":"https://github.com/pires/android-obd-reader/issues/107","id":94255433,"number":107,"title":"Settings for the polling rate or enable \"adaptive\" polling","user":{"login":"MaxBenChrist","id":13162426,"avatar_url":"https://avatars.githubusercontent.com/u/13162426?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxBenChrist","html_url":"https://github.com/MaxBenChrist","followers_url":"https://api.github.com/users/MaxBenChrist/followers","following_url":"https://api.github.com/users/MaxBenChrist/following{/other_user}","gists_url":"https://api.github.com/users/MaxBenChrist/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxBenChrist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxBenChrist/subscriptions","organizations_url":"https://api.github.com/users/MaxBenChrist/orgs","repos_url":"https://api.github.com/users/MaxBenChrist/repos","events_url":"https://api.github.com/users/MaxBenChrist/events{/privacy}","received_events_url":"https://api.github.com/users/MaxBenChrist/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pires/android-obd-reader/labels/improvement","name":"improvement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pires/android-obd-reader/milestones/2","html_url":"https://github.com/pires/android-obd-reader/milestones/2.0","labels_url":"https://api.github.com/repos/pires/android-obd-reader/milestones/2/labels","id":385828,"number":2,"title":"2.0","description":null,"creator":{"login":"pires","id":1752631,"avatar_url":"https://avatars.githubusercontent.com/u/1752631?v=3","gravatar_id":"","url":"https://api.github.com/users/pires","html_url":"https://github.com/pires","followers_url":"https://api.github.com/users/pires/followers","following_url":"https://api.github.com/users/pires/following{/other_user}","gists_url":"https://api.github.com/users/pires/gists{/gist_id}","starred_url":"https://api.github.com/users/pires/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pires/subscriptions","organizations_url":"https://api.github.com/users/pires/orgs","repos_url":"https://api.github.com/users/pires/repos","events_url":"https://api.github.com/users/pires/events{/privacy}","received_events_url":"https://api.github.com/users/pires/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":26,"state":"open","created_at":"2013-07-24T13:16:42Z","updated_at":"2015-07-17T17:48:32Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-07-10T09:00:36Z","updated_at":"2015-07-17T18:29:30Z","closed_at":null,"body":"It would be nice to be able to either set the update period in \r\n\r\n```java\r\n\r\npublic static int getObdUpdatePeriod(SharedPreferences prefs) {\r\n    String periodString = prefs\r\n        .getString(ConfigActivity.OBD_UPDATE_PERIOD_KEY, \"4\"); // 4 as in seconds\r\n    int period = 4000; // by default 4000ms\r\n```\r\n\r\na) to a user selected value in the configure menu (maybe in the range of 1-6 seconds)\r\nor \r\nb) make the polling adaptive by a caller/listener combination to achieve the fastest possible rate.\r\n\r\nFor example my obd and car combination is able to send data every 1.5-2 seconds.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pires/android-obd-reader/issues/comments/122366403","html_url":"https://github.com/pires/android-obd-reader/issues/107#issuecomment-122366403","issue_url":"https://api.github.com/repos/pires/android-obd-reader/issues/107","id":122366403,"user":{"login":"nomwerp","id":10109262,"avatar_url":"https://avatars.githubusercontent.com/u/10109262?v=3","gravatar_id":"","url":"https://api.github.com/users/nomwerp","html_url":"https://github.com/nomwerp","followers_url":"https://api.github.com/users/nomwerp/followers","following_url":"https://api.github.com/users/nomwerp/following{/other_user}","gists_url":"https://api.github.com/users/nomwerp/gists{/gist_id}","starred_url":"https://api.github.com/users/nomwerp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomwerp/subscriptions","organizations_url":"https://api.github.com/users/nomwerp/orgs","repos_url":"https://api.github.com/users/nomwerp/repos","events_url":"https://api.github.com/users/nomwerp/events{/privacy}","received_events_url":"https://api.github.com/users/nomwerp/received_events","type":"User","site_admin":false},"created_at":"2015-07-17T18:29:30Z","updated_at":"2015-07-17T18:29:30Z","body":"sorry if i'm missing something but shouldn't it already be taken from the settings, or it is broken?\r\n\r\n```java\r\n  public static int getObdUpdatePeriod(SharedPreferences prefs) {\r\n    String periodString = prefs.\r\n            getString(ConfigActivity.OBD_UPDATE_PERIOD_KEY, \"4\"); // 4 as in seconds\r\n    int period = 4000; // by default 4000ms\r\n\r\n    try {\r\n      period = (int) (Double.parseDouble(periodString) * 1000);\r\n    } catch (Exception e) {\r\n    }\r\n\r\n    if (period <= 0) {\r\n      period = 4000;\r\n    }\r\n\r\n    return period;\r\n  }\r\n```"}}