flamparski / areabase Goto Github PK
View Code? Open in Web Editor NEWAreabase is a project to create an Android app to bring UK census and police data into one place (also tells you how good or bad your area is)
Areabase is a project to create an Android app to bring UK census and police data into one place (also tells you how good or bad your area is)
Because as we all know, testing is key. The specification to adhere to is on the Police website.
The handler for most messages still uses a default, clunky message.
Sometimes, the Geocoder will return an incomplete postcode (ie SE4 instead of SE6 4NX) and thus cause the area lookup to fail. Some method of ensuring valid postcode will have to be implemented.
The user has requested a breakdown of the crimes that were reported to the Police in a given area.
The user has requested a breakdown of how crimes were dealt with by the police in a given area
The breakdown will be shown as a pie chart on the Crime tab of Areabase, where data aggregated from last year will be shown.
A Summary Card may be shown, or this may be a piece of text on the Crime tab
Out of 289 reported incidents, 205 were resolved successfully.
The OpenSpace map does not re-centre properly on device orientation changes -- on first orientation change, the map returns to being an overview of the whole of the UK, on subsequent orientation changes it re-centers on the required coordinates.
The calls GetTables and GetChildAreaTables need more extensive testing, and so does the returned List of Datasets.
Use (Google GSON)[https://code.google.com/p/google-gson/] to speed up the processing of JSON responses returned by the Police API.
The app should consist of the following pages:
Note that some of these may drop or gain adapters and components.
Since I want to use the webpage at http://flamparski.github.io/areabase as the user manual, I need to get it ready to print and display some index stuff. Quite possibly I will just have to copy it into Publisher or something like that and just print it from there.
Because TRWTF are AQA: mark computing coursework from a paper-only code distribution.
Changes that need to be done:
body { background-color: #FFFFFF; }
and then a slightly darker grey for the .jumbotron-section
elementsDevices that do run Areabase but are marked incompatible by the Play Store:
Revise screen filters?
Workaround: open Google Maps and wait for the location to update.
This can be fixed by implementing a better location update listener flow.
Finish wrapping the Discovery API (skip the unnecessary methods)
This should be changed to Area.getCompatibleSubjects()
. Now.
After getting the search functionality to work in ba479bf, I've noticed that many areas don't have the required dataset for model-based income estimates; but they do contain many benefits-related information that can be used to forecast the economy.
Possible approach: instead of using mean income as a key economic variable, focus on unemployment rate, and take into account benefits such as jobseeker's allowance and income support (under the assumption that the economy is going down as the number of claimants increases).
Use the Androguide fork to get the Google Play style cards with colours and overflow menus -- way easier than rolling a new library.
Seems like the value of largestEconomySector
is not always set: investigate
LogCat:
01-16 14:25:26.282: I/System.out(30647): Calling: http://neighbourhood.statistics.gov.uk/NDE2/Disco/GetDatasets?SubjectId=4&AreaId=6275998
01-16 14:25:27.343: I/System.out(30647): Calling: http://neighbourhood.statistics.gov.uk/NDE2/Deli/getTables?Areas=6275998&Datasets=266,2484,2513
01-16 14:25:29.516: E/AreaDataService(30647): Error processing card for Economy: NullPointerException
01-16 14:25:29.516: E/AreaDataService(30647): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase(java.util.Locale)' on a null object reference
01-16 14:25:29.516: E/AreaDataService(30647): at lamparski.areabase.cardproviders.EconomyCardProvider.getBiggestEconomySector(EconomyCardProvider.java:91)
01-16 14:25:29.516: E/AreaDataService(30647): at lamparski.areabase.cardproviders.EconomyCardProvider.economyCardForArea(EconomyCardProvider.java:60)
01-16 14:25:29.516: E/AreaDataService(30647): at lamparski.areabase.services.AreaDataService$1.doInBackground(AreaDataService.java:131)
01-16 14:25:29.516: E/AreaDataService(30647): at lamparski.areabase.services.AreaDataService$1.doInBackground(AreaDataService.java:1)
01-16 14:25:29.516: E/AreaDataService(30647): at android.os.AsyncTask$2.call(AsyncTask.java:288)
01-16 14:25:29.516: E/AreaDataService(30647): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-16 14:25:29.516: E/AreaDataService(30647): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
01-16 14:25:29.516: E/AreaDataService(30647): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
01-16 14:25:29.516: E/AreaDataService(30647): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
01-16 14:25:29.516: E/AreaDataService(30647): at java.lang.Thread.run(Thread.java:811)
01-16 14:25:29.516: E/SummaryFragment(30647): Error processing NDE data
01-16 14:25:29.516: E/SummaryFragment(30647): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase(java.util.Locale)' on a null object reference
01-16 14:25:29.516: E/SummaryFragment(30647): at lamparski.areabase.cardproviders.EconomyCardProvider.getBiggestEconomySector(EconomyCardProvider.java:91)
01-16 14:25:29.516: E/SummaryFragment(30647): at lamparski.areabase.cardproviders.EconomyCardProvider.economyCardForArea(EconomyCardProvider.java:60)
01-16 14:25:29.516: E/SummaryFragment(30647): at lamparski.areabase.services.AreaDataService$1.doInBackground(AreaDataService.java:131)
01-16 14:25:29.516: E/SummaryFragment(30647): at lamparski.areabase.services.AreaDataService$1.doInBackground(AreaDataService.java:1)
01-16 14:25:29.516: E/SummaryFragment(30647): at android.os.AsyncTask$2.call(AsyncTask.java:288)
01-16 14:25:29.516: E/SummaryFragment(30647): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-16 14:25:29.516: E/SummaryFragment(30647): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
01-16 14:25:29.516: E/SummaryFragment(30647): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
01-16 14:25:29.516: E/SummaryFragment(30647): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
01-16 14:25:29.516: E/SummaryFragment(30647): at java.lang.Thread.run(Thread.java:811)
01-16 14:25:29.516: D/SummaryFragment(30647): Not a NDE2Exception, got: NullPointerException
From the test log:
Calling http://data.police.uk/api/crimes-street/all-crime?poly=52.22599,0.109064:52.225876,0.109453:52.225802,0.109712:52.225685,0.110069:52.22565,0.110239:52.225573,0.110501:52.225443,0.11094:52.225387,0.111128:52.225224,0.111666:52.225193,0.111919:52.22487,...&date=2013-08
API error: Code 400; message: A non-200 code was returned
The offending postcodes, area names and ons codes:
Police API docs do not mention why the error would occur -- though it may be because the area is larger than 20 km sq?
Things get hella confusing when fragments try to pull the area again, so why not keep the current area in the AreaActivity? Will also fix the orientation change issues (as Areas can be serialised).
Unfortunately it will not fix the postcode issue.
Use GSON as per #1; hopefully this will be much easier than ONS.
For speed, skip unnecessary methods. If possible, extend functionality so that resulting datatypes call the web methods automatically.
Use much more extensive tests than the current jUnit test cases -- do MORE jUnit test cases!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.