{"pull_request":{"user":{"id":530659,"login":"alexbirkett","url":"https://api.github.com/users/alexbirkett","avatar_url":"https://secure.gravatar.com/avatar/541e744d6552b91e24db6691f33b62ed?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"541e744d6552b91e24db6691f33b62ed"},"merged_at":null,"title":"Another attempt.","created_at":"2011-12-18T12:20:45Z","updated_at":"2011-12-18T12:58:55Z","review_comments":0,"state":"closed","id":607264,"patch_url":"https://github.com/commonsguy/cwac-locpoll/pull/3.patch","html_url":"https://github.com/commonsguy/cwac-locpoll/pull/3","closed_at":"2011-12-18T12:58:55Z","deletions":93,"mergeable":true,"base":{"ref":"master","user":{"id":103772,"login":"commonsguy","url":"https://api.github.com/users/commonsguy","avatar_url":"https://secure.gravatar.com/avatar/5ff53c2b4f6cc66ee989bb9d9effe119?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"5ff53c2b4f6cc66ee989bb9d9effe119"},"sha":"f294850934548c8b4f9cbfac6198465eaf6ab676","repo":{"open_issues":0,"watchers":25,"git_url":"git://github.com/commonsguy/cwac-locpoll.git","created_at":"2011-01-07T16:11:46Z","updated_at":"2011-12-16T21:35:52Z","fork":false,"id":1230452,"language":"Java","html_url":"https://github.com/commonsguy/cwac-locpoll","name":"cwac-locpoll","master_branch":null,"description":"CWAC Location Poller: Finding Your Location Periodically","ssh_url":"git@github.com:commonsguy/cwac-locpoll.git","url":"https://api.github.com/repos/commonsguy/cwac-locpoll","pushed_at":"2011-12-09T19:42:26Z","clone_url":"https://github.com/commonsguy/cwac-locpoll.git","forks":3,"owner":{"id":103772,"login":"commonsguy","url":"https://api.github.com/users/commonsguy","avatar_url":"https://secure.gravatar.com/avatar/5ff53c2b4f6cc66ee989bb9d9effe119?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"5ff53c2b4f6cc66ee989bb9d9effe119"},"homepage":"http://commonsware.com/cwac","svn_url":"https://svn.github.com/commonsguy/cwac-locpoll","size":141,"private":false},"label":"commonsguy:master"},"issue_url":"https://github.com/commonsguy/cwac-locpoll/issues/3","body":"Once again I´m surprised by Android. This seems like a massive bug in fundamental functionality. It´s a pretty crappy marshaling system if it can´t marshal and unmarshal data!\r\n\r\nSo it seems to me that the only choices are:\r\n\r\n1. add every parameter to the bundle individually. This is the status quo. IMHO there are several drawbacks to this. Each key is long and bloats the app. It becomes error prone as more parameters are added. The code to get and set the keys is not as readable as simple method calls. The keys for input and output are all jumbled up.\r\n\r\n2. Internalize and Externalize an object to a byte array and send the byte array via the intent.\r\n\r\nI´ve gone for 2. It may look a bit like over engineering given that I´ve only added two extra parameters but I plan to add more. I want to add some heuristics to give up using the GPS quicker if it´s obvious from the satellite signal strengths that it´s not going to get a lock.\r\n\r\n\r\nDo you think it´s a good idea to throw a RuntimeException in the case below? If an IOException is thrown by the ByteArrayOutputStream then it´s pretty much game over for the app.\r\n\r\n\r\n```java\r\n/**\r\n\t * Externalize object that implements SimpleSerializable\r\n\t * @param objectToExternalize object to externalize\r\n\t * @return byte array representing object\r\n\t */\r\n\tpublic static byte[] externalize(SimpleSerializable objectToExternalize) {\r\n\r\n\t\tByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\r\n\t\tDataOutputStream dataOutputStream = new DataOutputStream(\r\n\t\t\t\tbyteArrayOutputStream);\r\n\t\ttry {\r\n\t\t\tobjectToExternalize.writeToStream(dataOutputStream);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// IOException should only occur in an OOM situation since we´re\r\n\t\t\t// writing to memory. App should not proceed.\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t}\r\n\r\n\t\treturn byteArrayOutputStream.toByteArray();\r\n\r\n\t}\r\n```","commits":6,"additions":376,"number":3,"url":"https://api.github.com/repos/commonsguy/cwac-locpoll/pulls/3","_links":{"review_comments":{"href":"https://api.github.com/repos/commonsguy/cwac-locpoll/pulls/3/comments"},"html":{"href":"https://github.com/commonsguy/cwac-locpoll/pull/3"},"self":{"href":"https://api.github.com/repos/commonsguy/cwac-locpoll/pulls/3"},"comments":{"href":"https://api.github.com/repos/commonsguy/cwac-locpoll/issues/3/comments"}},"merged_by":null,"diff_url":"https://github.com/commonsguy/cwac-locpoll/pull/3.diff","comments":1,"head":{"ref":"master","user":{"id":530659,"login":"alexbirkett","url":"https://api.github.com/users/alexbirkett","avatar_url":"https://secure.gravatar.com/avatar/541e744d6552b91e24db6691f33b62ed?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"541e744d6552b91e24db6691f33b62ed"},"sha":"3cc3dbbf8c8ed5d424a9483c505f2479f532bf34","repo":{"open_issues":0,"watchers":1,"git_url":"git://github.com/alexbirkett/cwac-locpoll.git","created_at":"2011-12-10T19:54:08Z","updated_at":"2011-12-18T11:58:47Z","fork":true,"id":2954965,"language":"Java","html_url":"https://github.com/alexbirkett/cwac-locpoll","name":"cwac-locpoll","master_branch":null,"description":"CWAC Location Poller: Finding Your Location Periodically","ssh_url":"git@github.com:alexbirkett/cwac-locpoll.git","url":"https://api.github.com/repos/alexbirkett/cwac-locpoll","pushed_at":"2011-12-18T11:58:47Z","clone_url":"https://github.com/alexbirkett/cwac-locpoll.git","forks":0,"owner":{"id":530659,"login":"alexbirkett","url":"https://api.github.com/users/alexbirkett","avatar_url":"https://secure.gravatar.com/avatar/541e744d6552b91e24db6691f33b62ed?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"541e744d6552b91e24db6691f33b62ed"},"homepage":"http://commonsware.com/cwac","svn_url":"https://svn.github.com/alexbirkett/cwac-locpoll","size":112,"private":false},"label":"alexbirkett:master"},"changed_files":6,"merged":false},"number":3,"action":"closed"}