From 43dfbdb57dd39f24a824c9c33c8886481ba25cb9 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 2 Feb 2012 13:47:55 +0000 Subject: Beginings of management of non Uni-Link data. --- res/xml/preferences.xml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'res/xml') diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 8aec00c..e0609f6 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -12,12 +12,26 @@ + android:title="@string/preferences_catagory_live_bus_times" > + android:summaryOff="@string/preferences_uni_link_live_bus_times_disabled" + android:summaryOn="@string/preferences_uni_link_live_bus_times_enabled" + android:title="@string/preferences_uni_link_live_bus_times" /> + + + + \ No newline at end of file -- cgit v1.2.3 From 6fe849cc34a06a3f5d7662ea6a4566a870b3edfa Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 2 Feb 2012 18:39:00 +0000 Subject: Improvements to the Preference management, begin allowing more bus data, need to rethink the data storage and retreval, perhaps using more semantic web stuff... --- assets/data.db | Bin 141312 -> 140288 bytes res/raw/org.rdf | 6168 ++++++++++++++++++++ res/xml/preferences.xml | 4 +- src/net/cbaines/suma/BuildingActivity.java | 88 + src/net/cbaines/suma/BusStop.java | 6 +- src/net/cbaines/suma/BusStopActivity.java | 10 +- src/net/cbaines/suma/BusStopOverlay.java | 9 +- src/net/cbaines/suma/DataManager.java | 72 +- src/net/cbaines/suma/Preferences.java | 12 + src/net/cbaines/suma/PreferencesActivity.java | 23 +- .../suma/SouthamptonUniversityMapActivity.java | 42 +- 11 files changed, 6378 insertions(+), 56 deletions(-) create mode 100644 res/raw/org.rdf create mode 100644 src/net/cbaines/suma/BuildingActivity.java create mode 100644 src/net/cbaines/suma/Preferences.java (limited to 'res/xml') diff --git a/assets/data.db b/assets/data.db index 05569fa..f941f32 100644 Binary files a/assets/data.db and b/assets/data.db differ diff --git a/res/raw/org.rdf b/res/raw/org.rdf new file mode 100644 index 0000000..db580f9 --- /dev/null +++ b/res/raw/org.rdf @@ -0,0 +1,6168 @@ + + + + + + + + + + + + + + + + 2011-11-30T09:43:54Z + + + 2011-11-30T09:43:55Z + + + + + + + + + + + + + + + 2011-11-30T09:43:55Z + + + 2011-11-30T09:43:56Z + + + + + + + + + + + + + + + + + + 2011-11-30 + + + This list of organisations and organisational units is taken from the table used by the "MUD" directory, so may not be authoritative. The University organisation is currently changing so these identifiers should be treated with caution. + + + + + + + + + + + + Organisation + + + + + + + + + Generated by OpenOrg Grinder using the org.xsl transform by Christopher Gutteridge. See http://wiki.openorg.ecs.soton.ac.uk/wiki/OpenOrg_Grinder. Generated at 2011-11-30T09:43:56+00:00 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2011-11-30T09:43:56Z + + + 2011-11-30T09:43:56Z + + + + + + + + + + + + University of Southampton + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Human Development & Health + + + AF + + + + + + + + + + + + + + + + + + + + + + + + Aeronautics, Astronautics & Comp. Eng + + + AK + + + + + + + + + + + + + + + + + + Civil Maritime & Env. Eng & Sci Unit + + + AT + + + + + + + + + + + + + + + + + + + + + Legal Services & Research Governance + + + BB + + + + + + + + + + + + + + + Health & Safety + + + BH + + + 13 + + + + + + Centre for Biological Sciences + + + BJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Centre for Innovation & Leadership + + + BN + + + + + + + + + + + + + + + Engineering Science Unit + + + BX + + + + + + + + + + + + + + + + + + + + + LATEU + + + BZ + + + + + + + + + + + + + + + Social Sciences + + + CC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Development & Alumni Relations + + + CD + + + + + + + + + + + + + + + + + + + + + + + + Southampton Education School + + + CJ + + + + + + + + + + + + + + + + + + + + + + + + + + + Cancer Sciences + + + CM + + + + + + + + + + + + + + + + + + Chaplaincy + + + CY + + + + + + + + + + + + Human Resources + + + DD + + + + + + + + + + + + + + + + + + + + + Faculty Hub + + + DF + + + + + + + + + + + + + + + Communications + + + DK + + + + + + + + + + + + + + + + + + + + + Chemistry + + + EB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Optoelectronics Research Centre + + + EH + + + + + + + + + + + + + + + + + + + + + Student Services + + + EW + + + + + + 10 + + + + + + + + + Faculty of Business and Law + + + F1 + + + + + + + + + + + + + + + + + + Graphics, Fine Art & Media + + + F1FH010000 + + + + + + Fashion & Textile Design + + + F1FH020000 + + + + + + Technical Services + + + F1FH030000 + + + + + + Research Centre + + + F1FH040000 + + + + + + International Studies + + + F1FH050000 + + + + + + Law + + + F1JJ010000 + + + + + + Management Science + + + F1TR010000 + + + + + + Knowledge & Information Systems + + + F1TR020000 + + + + + + Marketing + + + F1TR030000 + + + + + + Organisational Behaviour + + + F1TR040000 + + + + + + Strategy & Innovation + + + F1TR050000 + + + + + + Accounting + + + F1TR060000 + + + + + + Finance + + + F1TR070000 + + + + + + Academic Related + + + F1TR080000 + + + + + + + + + Faculty of Engineering and the Environment + + + F2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aerodynamics &Flight Mech Research Group + + + F2AK010000 + + + + + + Astronautics + + + F2AK020000 + + + + + + Computational Engineering & Design + + + F2AK030000 + + + + + + Energy & Climate Change Group + + + F2AT010000 + + + + + + Environment Research Group + + + F2AT020000 + + + + + + Fluid / Structure Interactions Research + + + F2AT030000 + + + + + + Infrastructure Research Group + + + F2AT040000 + + + + + + Tranportation Research Group + + + F2AT050000 + + + + + + Bioengineering Research Group + + + F2BX010000 + + + + + + Electro-Mechanical Research Group + + + F2BX020000 + + + + + + Energy Technology Research Group + + + F2BX030000 + + + + + + Engineering Materials & Surface Engineer + + + F2BX040000 + + + + + + nCATS Research Group + + + F2BX050000 + + + + + + General + + + F2DF010000 + + + + + + Signal Processing & Control Research Grp + + + F2KR010000 + + + + + + Dynamics Research Group + + + F2KR020000 + + + + + + Fluid Dynamics & Acoustics Research Grp + + + F2KR030000 + + + + + + Human Sciences Research Group + + + F2KR040000 + + + + + + Research Institute for Industry + + + F2LH010000 + + + + + + ISVR Consulting + + + F2LH020000 + + + + + + Wolfson Unit MTIA + + + F2LH030000 + + + + + + SOECIC + + + F2LH040000 + + + + + + + + + Faculty of Health Sciences + + + F3 + + + + + + + + + + + + + + + Leadership & Health Systems + + + F3BN010000 + + + + + + Advancing Clinical & Expert Practice + + + F3BN020000 + + + + + + Researcher Development + + + F3BN030000 + + + + + + Family, Child & Psycho-Social Health + + + F3KE020000 + + + + + + Physical & Rehabilitation Health + + + F3KE030000 + + + + + + Bio-Behavioural Sciences + + + F3KE040000 + + + 15 + + + + + + + + + Faculty of Humanities + + + F4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CLS + + + F4GC010000 + + + 13 + + + + + + + + + Faculty of Medicine + + + F5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Human Genetics + + + F5AF010000 + + + + + + Bone & Joint + + + F5AF020000 + + + + + + Epidermiology + + + F5AF030000 + + + + + + Human Nutrition & Metabolism + + + F5AF040000 + + + + + + Maternal, Fetal & Neonatal Physiology + + + F5AF050000 + + + + + + Tissue Infection & Repair + + + F5FC010000 + + + + + + Allergy & Inflammation Research + + + F5FC020000 + + + + + + Clinical Neurosciences + + + F5FC030000 + + + + + + Medical Education Development Unit + + + F5RA010000 + + + + + + Centre for Learning Anatomical Sciences + + + F5RA020000 + + + + + + NETSCC + + + F5VB020000 + + + 12 + + + + + + + + + Faculty of Natural and Environmental Sciences + + + F6 + + + + + + + + + + + + + + + + + + + + + Biological Sciences Technical + + + F6BJ010000 + + + + + + Biological Sciences Research + + + F6BJ020000 + + + + + + Academic + + + F6BJ030000 + + + + + + Molecular and Cellular + + + F6BJ110000 + + + + + + Environmental + + + F6BJ120000 + + + + + + Biomedicine + + + F6BJ130000 + + + + + + Biological Sciences Education/Training + + + F6BJ140000 + + + + + + Support Staff - Technical + + + F6BJ150000 + + + + + + Chemical Biology Group + + + F6EB010000 + + + + + + Electrochemistry & Surface Science Group + + + F6EB020000 + + + + + + Structure & Materials Group + + + F6EB030000 + + + + + + Synthetic Chemistry Group + + + F6EB040000 + + + + + + Support Staff + + + F6EB050000 + + + + + + Chemistry Technical + + + F6EB070000 + + + + + + Computational Systems Chemistry + + + F6EB080000 + + + + + + Electrochemistry + + + F6EB090000 + + + + + + Chemistry Education / Training + + + F6EB110000 + + + + + + Magnetic Resonance + + + F6EB120000 + + + + + + Molecular Assembly, Function & Structure + + + F6EB130000 + + + + + + Molecular Diagnostics & Thereputics + + + F6EB140000 + + + + + + Chemistry Research + + + F6EB150000 + + + + + + Ocean & Earth Science Technical + + + F6HN010000 + + + + + + Coastal & Shelf Research + + + F6HN020000 + + + + + + Geochemistry + + + F6HN030000 + + + + + + Geology & Geophysics + + + F6HN040000 + + + + + + Ocean Biochemistry & Ecosystems + + + F6HN060000 + + + + + + Paleooceanography & Palaeoclimate + + + F6HN070000 + + + + + + Physical Oceanography + + + F6HN080000 + + + + + + + + + Faculty of Physical and Applied Science + + + F7 + + + + + + + + + + + + + + + + + + ORC Research + + + F7EH010000 + + + + + + ORC - Enterprise + + + F7EH020000 + + + + + + Technical Support Staff + + + F7EH040000 + + + + + + ECML + + + F7FP010000 + + + + + + IT Innovation + + + F7FP020000 + + + + + + + + + MECH + + + F7FP030000 + + + + + + NANO + + + F7FP040000 + + + + + + + + + EEE + + + F7FP050000 + + + + + + + + + Comms, Signal Processing & Control + + + F7FP060000 + + + + + + + + + Electronic & Software Systems + + + F7FP070000 + + + + + + + + + Agents, Interactions & Complexity + + + F7FP080000 + + + + + + + + + Web & Internet Science + + + F7FP090000 + + + + + + + + + Theory Group + + + F7WF010000 + + + + + + Astronomy Group + + + F7WF020000 + + + + + + Quantum, Light & Matter Group + + + F7WF030000 + + + + + + Support Staff + + + F7WF040000 + + + + + + + + + Faculty of Social and Human Sciences + + + F8 + + + + + + + + + + + + + + + + + + + + + + + + + + + Social Statistics & Demography + + + F8CC010000 + + + + + + + + + + + + Centre for Population Change (CPC) + + + F8CC010600 + + + + + + ESRC National Centre - Research Methods + + + F8CC010700 + + + + + + Social Work Studies + + + F8CC020000 + + + + + + + + + SWAP + + + F8CC020300 + + + + + + Economics + + + F8CC030000 + + + + + + Politics & International Relations + + + F8CC040000 + + + + + + Sociology & Social Policy + + + F8CC050000 + + + + + + Gerontology + + + F8CC060000 + + + + + + Centre for Contemporary China + + + F8CC070000 + + + + + + Third Sector Research Centre + + + F8CC080000 + + + + + + Leadership School Improve &Effectiveness + + + F8CJ010000 + + + + + + Lifelong & Work-Related Learning + + + F8CJ020000 + + + + + + Mathematics & Science Education + + + F8CJ030000 + + + + + + Social Justice & Inclusive Education + + + F8CJ040000 + + + + + + Teaching Only Staff + + + F8CJ050000 + + + + + + Technical Staff + + + F8CJ060000 + + + + + + Clinical Neuroscience + + + F8JW010000 + + + + + + + + + + + + + + + Developmental Brain-Behaviour Lab + + + F8JW010100 + + + + + + Emotion & Motivation Lab + + + F8JW010200 + + + + + + Animal Behaviour + + + F8JW010300 + + + + + + Cognition + + + F8JW020000 + + + + + + + + + + + + + + + Centre for Visual Cognition + + + F8JW020100 + + + + + + Memory & Associated Learning Lab + + + F8JW020200 + + + + + + CBT + + + F8JW020300 + + + + + + Human Wellbeing + + + F8JW030000 + + + + + + + + + + + + + + + Centre for Apps. of Health Psychology + + + F8JW030100 + + + + + + Centre for Research on Self & Identity + + + F8JW030200 + + + + + + Centre for Sexual Health Research + + + F8JW030300 + + + + + + Technical Staff + + + F8JW040000 + + + + + + Professional Training + + + F8JW050000 + + + + + + Applied Mathematics + + + F8PJ010000 + + + + + + Operational Research + + + F8PJ020000 + + + + + + Pure Mathematics + + + F8PJ030000 + + + + + + Statistics + + + F8PJ040000 + + + + + + Earth Surface Dynamics + + + F8WR010000 + + + + + + Economy, Society & Space + + + F8WR020000 + + + + + + GeoData Institute + + + F8WR030000 + + + + + + Global Env Change & Earth Observation + + + F8WR040000 + + + + + + Palaeoenvironment Laboratory (PLUS) + + + F8WR050000 + + + + + + Population, Health & Wellbeing (PHeW) + + + F8WR060000 + + + + + + Technical Staff + + + F8WR070000 + + + + + + Research Groups + + + F8WT010000 + + + + + + + + + DUMMY + + + F8WT010100 + + + + + + + + + + + + + + + Academic & Research + + + F8WT010101 + + + + + + Maths + + + F8WT010103 + + + + + + Social Sciences + + + F8WT010104 + + + + + + Infection, Inflammation & Immunity + + + FC + + + + + + + + + + + + + + + + + + Winchester School of Art + + + FH + + + + + + + + + + + + + + + + + + + + + + + + Philosophy + + + FJ + + + + + + + + + + + + Electronics & Computer Science + + + FP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Royal Naval Unit + + + FX + + + + + + + + + Modern Languages + + + GC + + + + + + + + + + + + Strategy, Planning and Governance + + + GR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Student & Academic Administration + + + GX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ocean and Earth Science + + + HN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + iSolutions + + + JF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Southampton Law School + + + JJ + + + + + + + + + + + + Institute for Life Sciences + + + JL + + + + + + + + + Psychology + + + JW + + + + + + + + + + + + + + + + + + + + + + + + + + + Professional Practice in Health Sciences + + + KE + + + + + + + + + + + + + + + + + + + + + Inst. Sound & Vibration Research + + + KR + + + + + + + + + + + + + + + + + + + + + + + + + + + Library + + + KX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Primary Care & Population Sciences + + + LG + + + + + + Enterprise + + + LH + + + + + + + + + + + + + + + + + + + + + Humanities: Central Faculty + + + LN + + + + + + Film + + + LT + + + + + + Archaeology + + + MH + + + + + + + + + + + + Education Hub + + + MM + + + + + + + + + + + + Music + + + NC + + + + + + + + + + + + International Office + + + NP + + + + + + + + + Professional Services - COO + + + P1 + + + + + + + + + + + + + + + + + + + + + + + + + + + Legal Services + + + P1BB010000 + + + + + + + + + General Office + + + P1BB010100 + + + + + + Research Governance Office + + + P1BB020000 + + + + + + B37 Office + + + P1BB030000 + + + + + + HR - Professional Services + + + P1GRDD0200 + + + + + + + + + + + + + + + + + + Employee Relations + + + P1GRDD0210 + + + + + + HR Systems + + + P1GRDD0220 + + + + + + Organisational Development & Design + + + P1GRDD0230 + + + + + + Recruitment, Reward & Talent + + + P1GRDD0240 + + + + + + + + + + + + + + + Reward + + + P1GRDD0241 + + + + + + Temp Bank + + + P1GRDD0242 + + + + + + Recruitment + + + P1GRDD0243 + + + + + + Development + + + P1GRDD0300 + + + + + + + + + Professional Development Unit + + + P1GRDD0310 + + + + + + Equality & Diversity + + + P1GRDD0400 + + + + + + Director's Office + + + P1GRDD0500 + + + + + + Professional Services - Registrar + + + P2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Secretariat + + + P2GR010000 + + + + + + Turner Sims Concert Hall + + + P2GR020000 + + + + + + John Hansard Gallery + + + P2GR030000 + + + + + + Planning & Performance + + + P2GR040000 + + + + + + Transition Project Team + + + P2GR050000 + + + + + + Malaysia Campus Project Team + + + P2GR060000 + + + + + + Vice Chancellor Administration + + + P2GR080000 + + + + + + FOO - Faculty of Business & Law + + + P2TX010000 + + + + + + + + + + + + + + + + + + Faculty Secretariat + + + P2TX010100 + + + + + + Faculty Administration Team + + + P2TX010200 + + + + + + Faculty Resource Team + + + P2TX010300 + + + + + + Faculty Environment Team + + + P2TX010400 + + + + + + FOO - Faculty of Engineering & The Env. + + + P2TX020000 + + + + + + + + + + + + + + + + + + Faculty Secretariat + + + P2TX020100 + + + + + + Faculty Admin for Grants & Projects + + + P2TX020200 + + + + + + Faculty Resource Team + + + P2TX020300 + + + + + + Academic Environment Team + + + P2TX020400 + + + + + + FOO - Faculty of Health Sciences + + + P2TX030000 + + + + + + + + + + + + + + + + + + + + + Faculty Seretariat + + + P2TX030100 + + + + + + Faculty Administration Team + + + P2TX030200 + + + + + + Faculty Resource Team + + + P2TX030300 + + + + + + Faculty Envionment Team + + + P2TX030400 + + + + + + Regional Centre Admin / Reception + + + P2TX030500 + + + + + + FOO - Faculty of Humanities + + + P2TX040000 + + + + + + + + + + + + Faculty Secretariat + + + P2TX040100 + + + + + + Subject Centre - LLAS + + + P2TX040500 + + + + + + FOO - Faculty of Medicine + + + P2TX050000 + + + + + + FOO - Faculty of Natural & Env. Science + + + P2TX060000 + + + + + + + + + + + + + + + + + + Faculty Administration Team + + + P2TX060200 + + + + + + Academic Environment Team + + + P2TX060300 + + + + + + Faculty Resource Team + + + P2TX060400 + + + + + + Externally Funded Projects + + + P2TX060500 + + + + + + FOO - Faculty of Physical & Applied Sci. + + + P2TX070000 + + + + + + + + + + + + + + + Research Administration + + + P2TX070400 + + + + + + Externally Funded Projects + + + P2TX070500 + + + + + + Trading / Enterprise + + + P2TX070600 + + + + + + FOO - Faculty of Social & Human Sciences + + + P2TX080000 + + + + + + + + + + + + + + + Faculty Secretariat + + + P2TX080100 + + + + + + Academic Environment Team + + + P2TX080300 + + + + + + Externally Funded Sci Leaning Cntr SWAP + + + P2TX080400 + + + + + + Mathematics + + + PJ + + + + + + + + + + + + + + + + + + + + + Vice Chancellors Office + + + PK + + + + + + + + + Administration + + + PKBZ010000 + + + + + + Quality Enhancement + + + PKBZ020000 + + + + + + Donor Relations + + + PKCD030000 + + + + + + Annual Giving + + + PKCD050000 + + + + + + Alumni Relations + + + PKCD080000 + + + + + + Major Gift Fundraising + + + PKCD090000 + + + + + + Research, Analytics & Data + + + PKCD100000 + + + + + + Marketing + + + PKGRDK0300 + + + + + + Digital Media + + + PKGRDK0400 + + + + + + Corporate Communications + + + PKGRDK0500 + + + + + + Public Affairs + + + PKGRDK0600 + + + + + + Recruitment, Outreach & Admissions + + + PKGX050000 + + + + + + + + + + + + Outreach + + + PKGX050100 + + + + + + Admissions + + + PKGX050300 + + + + + + Student Administration + + + PKGX060000 + + + + + + + + + + + + Curriculum & Timetabling + + + PKGX060100 + + + + + + Exams, Award & Graduation + + + PKGX060200 + + + + + + Student Information & Records + + + PKGX070000 + + + + + + + + + + + + + + + Business Change + + + PKGX070100 + + + + + + Student Data & Management + + + PKGX070200 + + + + + + Student Records + + + PKGX070300 + + + + + + SAA - Faculty of Business & Law + + + PKGX080000 + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX080100 + + + + + + Student Administration Team + + + PKGX080200 + + + + + + Assessment & Quality Team + + + PKGX080300 + + + + + + Satellite Student & Admin Office + + + PKGX080400 + + + + + + SAA Fac of Engineering & the Environment + + + PKGX090000 + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX090100 + + + + + + Student Admin & Assessment Team + + + PKGX090200 + + + + + + Graduate School Team + + + PKGX090300 + + + + + + Curriculum & Quality Team + + + PKGX090400 + + + + + + SAA - Faculty of Health Sciences + + + PKGX100000 + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX100100 + + + + + + Student Admin & Assessment Team + + + PKGX100200 + + + + + + Curriculum, Quality & Placements Team + + + PKGX100300 + + + + + + SAA - Faculty of Social & Human Sciences + + + PKGX110000 + + + + + + + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX110100 + + + + + + Student Administration Team + + + PKGX110200 + + + + + + Assessment Team + + + PKGX110300 + + + + + + Curriculum & Quality Team + + + PKGX110400 + + + + + + Professional Development + + + PKGX110500 + + + + + + Graduate School + + + PKGX110600 + + + + + + SAA - Faculty of Humanities + + + PKGX120000 + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX120100 + + + + + + Student Administration & Assessment Team + + + PKGX120200 + + + + + + Curriculum & Quality Team + + + PKGX120300 + + + + + + SAA - Fac of Natural & Environmental Sci + + + PKGX130000 + + + + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX130100 + + + + + + Student Administration & Assessment Team + + + PKGX130200 + + + + + + Curriculum & Quality Team + + + PKGX130400 + + + + + + Doctoral Training Centre + + + PKGX130500 + + + + + + NOC - Campus Administration + + + PKGX130600 + + + + + + SAA - Fac of Physical & Applied Sciences + + + PKGX140000 + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX140100 + + + + + + Student Administration & Assessment Team + + + PKGX140200 + + + + + + Curriculum & Quality Team + + + PKGX140300 + + + + + + Doctoral Training Centre + + + PKGX140400 + + + + + + SAA - Faculty of Medicine + + + PKGX150000 + + + + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX150100 + + + + + + Student Administration + + + PKGX150200 + + + + + + Placements Timetabling Curriculum & Qual + + + PKGX150300 + + + + + + Graduate School + + + PKGX150400 + + + + + + Student Assessment + + + PKGX150500 + + + + + + Director's Office + + + PKGX160000 + + + + + + Service Delivery + + + PKJF110000 + + + + + + + + + + + + + + + + + + Service Desk + + + PKJF110100 + + + + + + Switchboard + + + PKJF110200 + + + + + + ServiceLine Response Team + + + PKJF110300 + + + + + + Coaching & Training + + + PKJF110400 + + + + + + Business Support + + + PKJF120000 + + + + + + + + + + + + + + + Logistics & Distribution / H&S + + + PKJF120100 + + + + + + Admin & Financial Management + + + PKJF120200 + + + + + + Print Centre + + + PKJF120300 + + + + + + E-Learning & Enablement + + + PKJF130000 + + + + + + + + + + + + + + + Managed Learning Environment + + + PKJF130100 + + + + + + E-Learning Enablement + + + PKJF130200 + + + + + + E-Learning Innovation & Production + + + PKJF130300 + + + + + + Research Support + + + PKJF140000 + + + + + + + + + + + + Technical Innovation + + + PKJF140100 + + + + + + HPC Support + + + PKJF140200 + + + + + + Account Management + + + PKJF150000 + + + + + + Service Management & Security + + + PKJF160000 + + + + + + Programme Management + + + PKJF170000 + + + + + + + + + + + + Business & System Analysis + + + PKJF170100 + + + + + + Project Management & Resourcing + + + PKJF170200 + + + + + + Development + + + PKJF180000 + + + + + + + + + + + + + + + Enterprise & Systems Development + + + PKJF180100 + + + + + + Web Systems Development + + + PKJF180200 + + + + + + COTS Systems Development + + + PKJF180300 + + + + + + Operations + + + PKJF190000 + + + + + + + + + + + + + + + Data Centre Operations + + + PKJF190100 + + + + + + Enterprise Systems & Desktop Operations + + + PKJF190200 + + + + + + Applications & Database Operations + + + PKJF190300 + + + + + + ICT Facilities + + + PKJF200000 + + + + + + Hartley Library + + + PKKX020000 + + + + + + Bibliographical Services + + + PKKX070000 + + + + + + Acquisitions + + + PKKX080000 + + + + + + Loans + + + PKKX090000 + + + + + + Digitisation Unit + + + PKKX200000 + + + + + + Librarian's Office + + + PKKX300000 + + + + + + Archives & Special Collections + + + PKKX400000 + + + + + + Faculty Liaison & Site Services + + + PKKX500000 + + + + + + Directorate + + + PKRR010000 + + + + + + Management Accounts + + + PKRR020000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Company & Tax + + + PKRR020600 + + + + + + FFM Team - Business & Law + + + PKRR020700 + + + + + + FFM Team - Engineering + + + PKRR020800 + + + + + + FFM Team - Health Sciences + + + PKRR020900 + + + + + + FFM Team - Humanities + + + PKRR021000 + + + + + + FFM Team - Medicine + + + PKRR021100 + + + + + + FFM Team - Natural & Env Sciences + + + PKRR021200 + + + + + + FFM Team - Physical & App Science + + + PKRR021300 + + + + + + FFM Team - Social & Human Sciences + + + PKRR021400 + + + + + + PSFM Team - CFO + + + PKRR021500 + + + + + + PSFM Team - R & COO + + + PKRR021600 + + + + + + Procurement + + + PKRR030000 + + + + + + + + + + + + + + + Central Procurement + + + PKRR030100 + + + + + + Purchase to Pay + + + PKRR030200 + + + + + + Accounts Payable + + + PKRR030300 + + + + + + Financial Accounts + + + PKRR040000 + + + + + + + + + + + + + + + + + + + + + + + + Student Fees + + + PKRR040300 + + + + + + Payroll & Pensions + + + PKRR040500 + + + + + + Income & Credit Control + + + PKRR040700 + + + + + + Systems Team + + + PKRR040900 + + + + + + Insurance Services + + + PKRR041000 + + + + + + Financial Accounts & Treasury + + + PKRR041100 + + + + + + Planning & Systems + + + PKTD010000 + + + + + + + + + + + + + + + Office Management + + + PKTD010100 + + + + + + Planning + + + PKTD010200 + + + + + + IT & Systems + + + PKTD010300 + + + + + + Facilities + + + PKTD020000 + + + + + + + + + + + + + + + + + + Building Maintenance + + + PKTD020100 + + + + + + + + + + + + + + + + + + Hall & Satellite Campuses + + + PKTD020101 + + + + + + Repairs Service + + + PKTD020102 + + + + + + Locksmiths + + + PKTD020103 + + + + + + Winchester School of Art BM + + + PKTD020104 + + + + + + Helpdesk + + + PKTD020200 + + + + + + Campus Services + + + PKTD020300 + + + + + + + + + + + + + + + Post & Portering + + + PKTD020301 + + + + + + External Services + + + PKTD020302 + + + + + + Domestic Services + + + PKTD020303 + + + + + + Security + + + PKTD020400 + + + + + + Faculty Projects Team + + + PKTD030000 + + + + + + Engineering + + + PKTD040000 + + + + + + + + + + + + + + + + + + + + + M/E Design Team + + + PKTD040100 + + + + + + Electrical Engineering + + + PKTD040200 + + + + + + Utilities + + + PKTD040300 + + + + + + Controls Engineering + + + PKTD040400 + + + + + + Mechanical Engineering + + + PKTD040500 + + + + + + Directorate + + + PKTD050000 + + + + + + + + + Transport + + + PKTD050100 + + + + + + PMU Programme Management Unit + + + PKTD060000 + + + + + + Catering + + + PKTD070000 + + + + + + + + + + + + + + + Halls Catering + + + PKTD070100 + + + + + + Central Catering + + + PKTD070200 + + + + + + Conference & Hospitality + + + PKTD070300 + + + + + + RIS HUB + + + PKTW040000 + + + + + + + + + + + + + + + Legal / IP + + + PKTW040200 + + + + + + Specialist Support Hub + + + PKTW040300 + + + + + + Incubation + + + PKTW040400 + + + + + + RIS Faculty + + + PKTW050000 + + + + + + + + + + + + Research & Enterprise Development + + + PKTW050100 + + + + + + Research Support Team + + + PKTW050200 + + + + + + Projects + + + PKTW060000 + + + + + + + + + SETSquared + + + PKTW060100 + + + + + + English + + + PL + + + + + + Medical Education + + + RA + + + + + + + + + + + + + + + + + + History + + + RG + + + + + + + + + + + + Finance + + + RR + + + + + + + + + + + + + + + + + + + + + Engineering Development Trust + + + SF + + + + + + University Health Service + + + SH + + + + + + + + + Students Union + + + SU + + + + + + + + + + + + + + + Estates & Facilities + + + TD + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Southampton Management School + + + TR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Research & Innovation Services + + + TW + + + + + + + + + + + + + + + + + + Faculty Operating Offices + + + TX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Wessex Institute + + + VB + + + + + + + + + Foundation Year + + + VL + + + + + + Physics & Astronomy + + + WF + + + + + + + + + + + + + + + + + + + + + Biomedical Research Facility (BRF) + + + WN + + + + + + Geography & Environment + + + WR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Statistical Sciences Research Institute + + + WT + + + + + + + + + + + + Central Unit + + + XX + + + + + + + + + + + + + + + + + + + + + + + + School Mathematics Project + + + ZA + + diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index e0609f6..f4cdd9f 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -14,7 +14,7 @@ android:orderingFromXml="true" android:title="@string/preferences_catagory_live_bus_times" > @@ -28,7 +28,7 @@ android:orderingFromXml="true" android:title="@string/preferences_catagory_data" > diff --git a/src/net/cbaines/suma/BuildingActivity.java b/src/net/cbaines/suma/BuildingActivity.java new file mode 100644 index 0000000..7637439 --- /dev/null +++ b/src/net/cbaines/suma/BuildingActivity.java @@ -0,0 +1,88 @@ +/* + * Southampton University Map App + * Copyright (C) 2011 Christopher Baines + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package net.cbaines.suma; + +import java.io.InputStream; +import java.util.HashSet; + +import android.content.Context; +import android.os.Bundle; + +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; +import com.hp.hpl.jena.util.FileManager; +import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; + +public class BuildingActivity extends OrmLiteBaseActivity { + + final static String TAG = "BusTimeActivity"; + + private boolean dataChanged; + + private Context instance; + + private HashSet routes = new HashSet(); + + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.bustimes); + + final DatabaseHelper helper = getHelper(); + + // create an empty model + Model model = ModelFactory.createDefaultModel(); + + // use the FileManager to find the input file + InputStream in = getResources().openRawResource(R.raw.u9); + if (in == null) { + throw new IllegalArgumentException("File not found"); + } + + // read the RDF/XML file + model.read(in, null); + + + + instance = this; + + } + + public void onResume() { + super.onResume(); + + } + + public void onPause() { + + super.onPause(); + } + + public void finish() { + setResult(RESULT_OK, getIntent()); + + super.finish(); + } + + @Override + public Object onRetainNonConfigurationInstance() { + return null; + } + +} diff --git a/src/net/cbaines/suma/BusStop.java b/src/net/cbaines/suma/BusStop.java index c19e682..1e9faaa 100644 --- a/src/net/cbaines/suma/BusStop.java +++ b/src/net/cbaines/suma/BusStop.java @@ -35,6 +35,7 @@ public class BusStop extends POI { public static final String DESCRIPTION_FIELD_NAME = "description"; public static final String BAY_FIELD_NAME = "bay"; public static final String ROUTES_FIELD_NAME = "bay"; + public static final String UNI_LINK_FIELD_NAME = "uniLink"; /** * Description e.g. "Bournemouth Rd os Asda S" @@ -52,7 +53,10 @@ public class BusStop extends POI { * Used to speed up accessing the relevent uni link routes for a bus stop, this is not a uni link stop */ @DatabaseField(canBeNull = false) - public byte routes; + byte routes; + + @DatabaseField(canBeNull = false) + boolean uniLink; public BusStop(String location, String description, String bay, GeoPoint point) { this.id = location; diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index 93f4ae6..d84bbdd 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -53,7 +53,7 @@ import com.j256.ormlite.dao.Dao; import com.j256.ormlite.stmt.PreparedQuery; import com.j256.ormlite.stmt.QueryBuilder; -public class BusStopActivity extends OrmLiteBaseActivity implements OnCheckedChangeListener { +public class BusStopActivity extends OrmLiteBaseActivity implements OnCheckedChangeListener, Preferences { final static String TAG = "BusTimeActivity"; @@ -199,7 +199,7 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme super.onResume(); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); - if (sharedPrefs.getBoolean("liveBusTimesEnabled", false)) { + if (sharedPrefs.getBoolean(UNI_LINK_BUS_TIMES, false) || sharedPrefs.getBoolean(NON_UNI_LINK_BUS_TIMES, false)) { Log.i(TAG, "Live Times enabled"); timetable = (Timetable) getLastNonConfigurationInstance(); @@ -287,7 +287,11 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme protected Timetable doInBackground(String... activity) { Timetable newTimetable = null; try { - newTimetable = DataManager.getTimetable(instance, busStopID, true); + final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(instance); + + newTimetable = DataManager.getTimetable(instance, busStopID, sharedPrefs.getBoolean(SouthamptonUniversityMapActivity.UNI_LINK_BUS_TIMES, + SouthamptonUniversityMapActivity.UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT), sharedPrefs.getBoolean( + SouthamptonUniversityMapActivity.NON_UNI_LINK_BUS_TIMES, SouthamptonUniversityMapActivity.NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT)); } catch (SQLException e) { errorMessage = "Error message regarding SQL?"; e.printStackTrace(); diff --git a/src/net/cbaines/suma/BusStopOverlay.java b/src/net/cbaines/suma/BusStopOverlay.java index 639f851..834b6dc 100644 --- a/src/net/cbaines/suma/BusStopOverlay.java +++ b/src/net/cbaines/suma/BusStopOverlay.java @@ -45,7 +45,7 @@ import com.j256.ormlite.dao.Dao; public class BusStopOverlay extends Overlay implements RouteColorConstants { - private List busStops; + List busStops; private final Point mCurScreenCoords = new Point(); private final Point mTouchScreenPoint = new Point(); @@ -68,9 +68,8 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { private boolean[] routes = new boolean[5]; - public BusStopOverlay(Context context) throws SQLException { + public BusStopOverlay(Context context, List busStops) throws SQLException { super(context); - final long startTime = System.currentTimeMillis(); this.context = context; @@ -84,9 +83,7 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { paint.setStyle(Style.FILL); paint.setStrokeWidth(6); - Log.i(TAG, "Begining to load bus stops in to overlay " + (System.currentTimeMillis() - startTime)); - busStops = busStopDao.queryForAll(); - Log.i(TAG, "Finished loading bus stops in to overlay " + (System.currentTimeMillis() - startTime)); + this.busStops = busStops; } void setRoutes(int route, boolean visible) { diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 9fd08c1..d4d0968 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -331,42 +331,42 @@ public class DataManager { e.printStackTrace(); } - // TODO: Seperate non unilink stuff in to a different table - if (onlyUniLink) { - - long sizeBeforeRemoval = busStopDao.countOf(); - - // Removing busstops not used by unilink busses - for (Iterator busStopIter = busStopDao.iterator(); busStopIter.hasNext();) { - BusStop stop = busStopIter.next(); - // Log.i(TAG, "Looking at stop " + stop.id); - - /* - * QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); routeStopsQueryBuilder.where().eq(columnName, value) - * - * DeleteBuilder deleteBuilder = busStopDao.deleteBuilder(); // only delete the rows where password is null - * deleteBuilder.where().in(RouteStops.STOP_ID_FIELD_NAME, objects) accountDao.delete(deleteBuilder.prepare()); - */ - - QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); - routeStopsQueryBuilder.setCountOf(true); - routeStopsQueryBuilder.where().eq(RouteStops.STOP_ID_FIELD_NAME, stop); - - PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); - long num = routeStopsDao.countOf(routeStopsPreparedQuery); - // long num = routeStopsDao.query(routeStopsPreparedQuery).size(); - // Log.i(TAG, "Number is " + num); - if (num == 0) { - // Log.i(TAG, "Removing " + stop.id); + long sizeBeforeRemoval = busStopDao.countOf(); + + // Removing busstops not used by unilink busses + for (Iterator busStopIter = busStopDao.iterator(); busStopIter.hasNext();) { + BusStop stop = busStopIter.next(); + // Log.i(TAG, "Looking at stop " + stop.id); + + /* + * QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); routeStopsQueryBuilder.where().eq(columnName, value) + * + * DeleteBuilder deleteBuilder = busStopDao.deleteBuilder(); // only delete the rows where password is null + * deleteBuilder.where().in(RouteStops.STOP_ID_FIELD_NAME, objects) accountDao.delete(deleteBuilder.prepare()); + */ + + QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); + routeStopsQueryBuilder.setCountOf(true); + routeStopsQueryBuilder.where().eq(RouteStops.STOP_ID_FIELD_NAME, stop); + + PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); + long num = routeStopsDao.countOf(routeStopsPreparedQuery); + // long num = routeStopsDao.query(routeStopsPreparedQuery).size(); + // Log.i(TAG, "Number is " + num); + if (num == 0) { + // Log.i(TAG, "Removing " + stop.id); + stop.uniLink = false; + if (onlyUniLink) { busStopIter.remove(); } + } else { + stop.uniLink = true; } + } - long sizeAfterRemoval = busStopDao.countOf(); - - Log.i(TAG, "Removed " + (sizeBeforeRemoval - sizeAfterRemoval) + " stops (from " + sizeBeforeRemoval + ") now have " + sizeAfterRemoval); + long sizeAfterRemoval = busStopDao.countOf(); - } + Log.i(TAG, "Removed " + (sizeBeforeRemoval - sizeAfterRemoval) + " stops (from " + sizeBeforeRemoval + ") now have " + sizeAfterRemoval); Log.i(TAG, "Finished loading bus data"); } @@ -546,8 +546,8 @@ public class DataManager { } - public static Timetable getTimetable(Context context, String busStop, boolean onlyUniLink) throws SQLException, ClientProtocolException, IOException, - JSONException { + public static Timetable getTimetable(Context context, String busStop, boolean keepUniLink, boolean keepNonUniLink) throws SQLException, + ClientProtocolException, IOException, JSONException { if (helper == null) helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); @@ -571,7 +571,11 @@ public class DataManager { for (int stopNum = 0; stopNum < stopsArray.length(); stopNum++) { JSONObject stopObj = stopsArray.getJSONObject(stopNum); - if (onlyUniLink && !stopObj.getString("name").startsWith("U")) { + if (!keepNonUniLink && !stopObj.getString("name").startsWith("U")) { + continue; + } + + if (!keepUniLink && stopObj.getString("name").startsWith("U")) { continue; } diff --git a/src/net/cbaines/suma/Preferences.java b/src/net/cbaines/suma/Preferences.java new file mode 100644 index 0000000..e2c79a0 --- /dev/null +++ b/src/net/cbaines/suma/Preferences.java @@ -0,0 +1,12 @@ +package net.cbaines.suma; + +public interface Preferences { + static final String GPS_ENABLED = "GPSEnabled"; + static final boolean GPS_ENABLED_BY_DEFAULT = true; + static final String UNI_LINK_BUS_TIMES = "uniLinkLiveBusTimesEnabled"; + static final boolean UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = true; + static final String NON_UNI_LINK_BUS_TIMES = "nonUniLinkLiveBusTimesEnabled"; + static final boolean NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = false; + static final String NON_UNI_LINK_BUS_STOPS = "nonUniLinkBusStop"; + static final boolean NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT = false; +} diff --git a/src/net/cbaines/suma/PreferencesActivity.java b/src/net/cbaines/suma/PreferencesActivity.java index d5df6a1..0d61c6d 100644 --- a/src/net/cbaines/suma/PreferencesActivity.java +++ b/src/net/cbaines/suma/PreferencesActivity.java @@ -19,15 +19,34 @@ package net.cbaines.suma; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; import android.os.Bundle; import android.preference.PreferenceActivity; +import android.preference.PreferenceManager; -public class PreferencesActivity extends PreferenceActivity { +public class PreferencesActivity extends PreferenceActivity implements Preferences { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); + final Editor editor = sharedPrefs.edit(); + if (!sharedPrefs.contains(GPS_ENABLED)) { + editor.putBoolean(GPS_ENABLED, GPS_ENABLED_BY_DEFAULT); + } + if (!sharedPrefs.contains(UNI_LINK_BUS_TIMES)) { + editor.putBoolean(UNI_LINK_BUS_TIMES, UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT); + } + if (!sharedPrefs.contains(NON_UNI_LINK_BUS_TIMES)) { + editor.putBoolean(NON_UNI_LINK_BUS_TIMES, NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT); + } + if (!sharedPrefs.contains(NON_UNI_LINK_BUS_STOPS)) { + editor.putBoolean(NON_UNI_LINK_BUS_STOPS, NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT); + } + editor.commit(); + addPreferencesFromResource(R.xml.preferences); } - } \ No newline at end of file diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index 52b3e1f..a5a255e 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -26,6 +26,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.List; import org.osmdroid.DefaultResourceProxyImpl; import org.osmdroid.ResourceProxy; @@ -73,7 +74,7 @@ import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; import com.j256.ormlite.dao.Dao; public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity implements MapViewConstants, Runnable, RouteColorConstants, - OnChildClickListener, OnItemClickListener, OnItemLongClickListener, OnSharedPreferenceChangeListener { + OnChildClickListener, OnItemClickListener, OnItemLongClickListener, OnSharedPreferenceChangeListener, Preferences { private boolean useBundledDatabase = true; @@ -90,18 +91,18 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity pastOverlays; private ScaleBarOverlay scaleBarOverlay; - private final boolean SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final boolean SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT = true; private MyLocationOverlay myLocationOverlay; private BuildingNumOverlay residentialBuildingOverlay; - private final boolean NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final boolean NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; private BuildingNumOverlay nonResidentialBuildingOverlay; - private final boolean RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final boolean RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; private BusStopOverlay busStopOverlay; - private final boolean BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final boolean BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; private HashMap siteOverlays = new HashMap(21); - private final boolean SITE_OVERLAY_ENABLED_BY_DEFAULT = false; + private static final boolean SITE_OVERLAY_ENABLED_BY_DEFAULT = false; private HashMap routeOverlays = new HashMap(5); - private final boolean ROUTE_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final boolean ROUTE_OVERLAY_ENABLED_BY_DEFAULT = true; private String[] busRoutes; private String[] buildingTypes; @@ -686,7 +687,16 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity busStops; + Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); + if (activityPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS, NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT)) { + busStops = getHelper().getBusStopDao().queryForAll(); + } else { + busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, true); + } + Log.v(TAG, "Finished fetching BusStops at " + (System.currentTimeMillis() - startTime)); + + busStopOverlay = new BusStopOverlay(instance, busStops); } catch (SQLException e) { e.printStackTrace(); } @@ -1085,6 +1095,22 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Sat, 18 Feb 2012 21:14:17 +0000 Subject: More bug fixes, working non uni link bus times, just need to get the non uni link bus stops working :) --- res/xml/preferences.xml | 2 +- src/net/cbaines/suma/BuildingActivity.java | 84 ---------------------------- src/net/cbaines/suma/BuildingNumOverlay.java | 34 ++++++----- src/net/cbaines/suma/DataManager.java | 30 +++++----- src/net/cbaines/suma/MapActivity.java | 33 +++++------ src/net/cbaines/suma/Stop.java | 7 ++- src/net/cbaines/suma/StopView.java | 16 ++++-- src/net/cbaines/suma/TimetableAdapter.java | 1 - 8 files changed, 70 insertions(+), 137 deletions(-) delete mode 100644 src/net/cbaines/suma/BuildingActivity.java (limited to 'res/xml') diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index f4cdd9f..4a12e1c 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -28,7 +28,7 @@ android:orderingFromXml="true" android:title="@string/preferences_catagory_data" > diff --git a/src/net/cbaines/suma/BuildingActivity.java b/src/net/cbaines/suma/BuildingActivity.java deleted file mode 100644 index ca605c8..0000000 --- a/src/net/cbaines/suma/BuildingActivity.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - - * Southampton University Map App - * Copyright (C) 2011 Christopher Baines - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package net.cbaines.suma; - -import java.io.InputStream; -import java.util.HashSet; - -import android.content.Context; -import android.os.Bundle; - -import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; - -public class BuildingActivity extends OrmLiteBaseActivity { - - final static String TAG = "BusTimeActivity"; - - private boolean dataChanged; - - private Context instance; - - private HashSet routes = new HashSet(); - - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.bustimes); - - final DatabaseHelper helper = getHelper(); - - // create an empty model - // Model model = ModelFactory.createDefaultModel(); - - // use the FileManager to find the input file - InputStream in = getResources().openRawResource(R.raw.u9); - if (in == null) { - throw new IllegalArgumentException("File not found"); - } - - // read the RDF/XML file - // model.read(in, null); - - instance = this; - - } - - public void onResume() { - super.onResume(); - - } - - public void onPause() { - - super.onPause(); - } - - public void finish() { - setResult(RESULT_OK, getIntent()); - - super.finish(); - } - - @Override - public Object onRetainNonConfigurationInstance() { - return null; - } - -} diff --git a/src/net/cbaines/suma/BuildingNumOverlay.java b/src/net/cbaines/suma/BuildingNumOverlay.java index 9825616..33b5efc 100644 --- a/src/net/cbaines/suma/BuildingNumOverlay.java +++ b/src/net/cbaines/suma/BuildingNumOverlay.java @@ -29,7 +29,6 @@ import org.osmdroid.views.MapView; import org.osmdroid.views.MapView.Projection; import org.osmdroid.views.overlay.Overlay; -import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; @@ -92,25 +91,29 @@ public class BuildingNumOverlay extends Overlay { /** * Draw a marker on each of our items. populate() must have been called first.
*
- * The marker will be drawn twice for each Item in the Overlay--once in the shadow phase, skewed and darkened, then again in the non-shadow phase. The - * bottom-center of the marker will be aligned with the geographical coordinates of the Item.
+ * The marker will be drawn twice for each Item in the Overlay--once in the shadow phase, skewed and darkened, then + * again in the non-shadow phase. The bottom-center of the marker will be aligned with the geographical coordinates + * of the Item.
*
- * The order of drawing may be changed by overriding the getIndexToDraw(int) method. An item may provide an alternate marker via its - * OverlayItem.getMarker(int) method. If that method returns null, the default marker is used.
+ * The order of drawing may be changed by overriding the getIndexToDraw(int) method. An item may provide an + * alternate marker via its OverlayItem.getMarker(int) method. If that method returns null, the default marker is + * used.
*
* The focused item is always drawn last, which puts it visually on top of the other items.
* * @param canvas - * the Canvas upon which to draw. Note that this may already have a transformation applied, so be sure to leave it the way you found it + * the Canvas upon which to draw. Note that this may already have a transformation applied, so be sure to + * leave it the way you found it * @param mapView - * the MapView that requested the draw. Use MapView.getProjection() to convert between on-screen pixels and latitude/longitude pairs + * the MapView that requested the draw. Use MapView.getProjection() to convert between on-screen pixels + * and latitude/longitude pairs * @param shadow * if true, draw the shadow layer. If false, draw the overlay contents. */ @Override public void draw(final Canvas canvas, final MapView mapView, final boolean shadow) { - if (shadow) { + if (shadow || !isEnabled()) { return; } @@ -181,7 +184,8 @@ public class BuildingNumOverlay extends Overlay { @Override public boolean onSingleTapUp(final MotionEvent event, final MapView mapView) { - Log.v(TAG, "Pointer count for onSingleTapUp is " + event.getPointerCount() + " " + event.getAction() + " " + event.describeContents()); + Log.v(TAG, "Pointer count for onSingleTapUp is " + event.getPointerCount() + " " + event.getAction() + " " + + event.describeContents()); if (event.getPointerCount() != 1) { Log.v(TAG, "Pointer count for onSingleTapUp not 1, ignoring"); return false; @@ -199,7 +203,8 @@ public class BuildingNumOverlay extends Overlay { Log.i(TAG, "building Pressed " + building.id); if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, building.name + " (" + building.id + ")", Toast.LENGTH_SHORT); + context.activityToast = Toast.makeText(context, building.name + " (" + building.id + ")", + Toast.LENGTH_SHORT); } else { context.activityToast.setDuration(Toast.LENGTH_SHORT); context.activityToast.setText(building.name + " (" + building.id + ")"); @@ -218,7 +223,8 @@ public class BuildingNumOverlay extends Overlay { @Override public boolean onLongPress(final MotionEvent event, final MapView mapView) { - Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction() + " " + event.describeContents()); + Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction() + " " + + event.describeContents()); if (event.getPointerCount() != 1) { Log.v(TAG, "Pointer count for onLongPress not 1, ignoring"); return false; @@ -239,7 +245,8 @@ public class BuildingNumOverlay extends Overlay { building.favourite = false; if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, building.id + " removed from favourites", Toast.LENGTH_SHORT); + context.activityToast = Toast.makeText(context, building.id + " removed from favourites", + Toast.LENGTH_SHORT); } else { context.activityToast.setDuration(Toast.LENGTH_SHORT); context.activityToast.setText(building.id + " removed from favourites"); @@ -248,7 +255,8 @@ public class BuildingNumOverlay extends Overlay { } else { if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, building.id + " made a favourite", Toast.LENGTH_SHORT); + context.activityToast = Toast.makeText(context, building.id + " made a favourite", + Toast.LENGTH_SHORT); } else { context.activityToast.setDuration(Toast.LENGTH_SHORT); context.activityToast.setText(building.id + " made a favourite"); diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 196a7e2..140ddfa 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -561,19 +561,21 @@ public class DataManager { Log.e(TAG, "Unknown end dest " + destString + " for route " + route.code); } - QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); - routeStopsQueryBuilder.where().eq(RouteStops.ROUTE_ID_FIELD_NAME, route.id).and() - .eq(RouteStops.STOP_ID_FIELD_NAME, destStop.id); - PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); - - List routeStops = routeStopsDao.query(routeStopsPreparedQuery); - if (routeStops.size() > 0) { - Log.i(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " - + route.code); - } else { - Log.e(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " - + route.code); - return null; + if (destStop != null) { + + QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); + routeStopsQueryBuilder.where().eq(RouteStops.ROUTE_ID_FIELD_NAME, route.id).and() + .eq(RouteStops.STOP_ID_FIELD_NAME, destStop.id); + PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); + + List routeStops = routeStopsDao.query(routeStopsPreparedQuery); + if (routeStops.size() > 0) { + Log.i(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + + route.code); + } else { + Log.w(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + + route.code); + } } Date now = new Date(System.currentTimeMillis()); @@ -653,10 +655,12 @@ public class DataManager { JSONObject stopObj = stopsArray.getJSONObject(stopNum); if (!keepNonUniLink && !stopObj.getString("name").startsWith("U")) { + Log.v(TAG, "Skipping non uni-link stop " + stopObj.getString("name")); continue; } if (!keepUniLink && stopObj.getString("name").startsWith("U")) { + Log.v(TAG, "Skipping uni-link stop " + stopObj.getString("name")); continue; } diff --git a/src/net/cbaines/suma/MapActivity.java b/src/net/cbaines/suma/MapActivity.java index 4d9eddc..c0a2aba 100644 --- a/src/net/cbaines/suma/MapActivity.java +++ b/src/net/cbaines/suma/MapActivity.java @@ -78,7 +78,7 @@ public class MapActivity extends OrmLiteBaseActivity implements * Enable to use the database in the assets folder, if its not enabled, the database is built from the csv files in * the assets folder */ - private boolean useBundledDatabase = false; + private boolean useBundledDatabase = true; private MapView mapView; private MapController mapController; @@ -444,15 +444,15 @@ public class MapActivity extends OrmLiteBaseActivity implements showUtilityOverlays(); - showUniLinkBusStopOverlays(); + showUniLinkBusStopOverlay(); - showNonUniLinkBusStopOverlays(); + showNonUniLinkBusStopOverlay(); if (activityPrefs.getBoolean(BUILDING_OVERLAYS + RESIDENTIAL_BUILDING_OVERLAY, RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT) || activityPrefs.getBoolean(BUILDING_OVERLAYS + NON_RESIDENTIAL_BUILDING_OVERLAY, NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)) { - showBuildingOverlay(); + showBuildingOverlays(); } Log.i(TAG, "Begining to show the route overlays at " + (System.currentTimeMillis() - startTime)); @@ -662,7 +662,7 @@ public class MapActivity extends OrmLiteBaseActivity implements }).start(); } - private void showBuildingOverlay() { + private void showBuildingOverlays() { new Thread(new Runnable() { public void run() { Log.i(TAG, "Begining showing building overlays at " + (System.currentTimeMillis() - startTime)); @@ -728,10 +728,10 @@ public class MapActivity extends OrmLiteBaseActivity implements } } - residentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(RESIDENTIAL_BUILDING_OVERLAY, - RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); - nonResidentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(RESIDENTIAL_BUILDING_OVERLAY, - NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); + residentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(BUILDING_OVERLAYS + + RESIDENTIAL_BUILDING_OVERLAY, RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); + nonResidentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(BUILDING_OVERLAYS + + NON_RESIDENTIAL_BUILDING_OVERLAY, NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); mapView.postInvalidate(); @@ -740,7 +740,7 @@ public class MapActivity extends OrmLiteBaseActivity implements }).start(); } - private void showUniLinkBusStopOverlays() { + private void showUniLinkBusStopOverlay() { new Thread(new Runnable() { public void run() { Log.i(TAG, "Begining showing bus stop overlays at " + (System.currentTimeMillis() - startTime)); @@ -800,10 +800,11 @@ public class MapActivity extends OrmLiteBaseActivity implements }).start(); } - private void showNonUniLinkBusStopOverlays() { + private void showNonUniLinkBusStopOverlay() { new Thread(new Runnable() { public void run() { - Log.i(TAG, "Begining showing bus stop overlays at " + (System.currentTimeMillis() - startTime)); + Log.i(TAG, "Begining showing non uni link bus stop overlays at " + + (System.currentTimeMillis() - startTime)); final SharedPreferences activityPrefs = getPreferences(0); final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); @@ -1198,9 +1199,9 @@ public class MapActivity extends OrmLiteBaseActivity implements } else if (key.equals(UNI_LINK_BUS_TIMES)) { // Noting to do here atm } else if (key.startsWith(BUS_STOP_OVERLAYS)) { - showUniLinkBusStopOverlays(); - } else if (key.startsWith(NON_UNI_LINK_BUS_STOPS)) { - showNonUniLinkBusStopOverlays(); + showUniLinkBusStopOverlay(); + } else if (key.equals(NON_UNI_LINK_BUS_STOPS)) { + showNonUniLinkBusStopOverlay(); } else if (key.startsWith(BUS_ROUTE_OVERLAYS)) { try { String routeName = key.substring(BUS_ROUTE_OVERLAYS.length(), key.length()); @@ -1214,7 +1215,7 @@ public class MapActivity extends OrmLiteBaseActivity implements e.printStackTrace(); } } else if (key.startsWith(BUILDING_OVERLAYS)) { - showBuildingOverlay(); + showBuildingOverlays(); } else if (key.startsWith(SITE_OVERLAYS)) { String siteName = key.substring(SITE_OVERLAYS.length(), key.length()); try { diff --git a/src/net/cbaines/suma/Stop.java b/src/net/cbaines/suma/Stop.java index c6bedf0..94fc908 100644 --- a/src/net/cbaines/suma/Stop.java +++ b/src/net/cbaines/suma/Stop.java @@ -22,7 +22,6 @@ package net.cbaines.suma; import java.util.Date; import android.text.format.DateUtils; -import android.util.Log; /** * Stop represents a Bus stopping at a time at a BusStop. @@ -90,7 +89,8 @@ public class Stop { if (arivalTime.getTime() - System.currentTimeMillis() <= 60000) { return "Due"; } else { - return (String) DateUtils.getRelativeTimeSpanString(arivalTime.getTime(), System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS); + return (String) DateUtils.getRelativeTimeSpanString(arivalTime.getTime(), System.currentTimeMillis(), + DateUtils.MINUTE_IN_MILLIS); } } @@ -98,7 +98,8 @@ public class Stop { if (arivalTime.getTime() - System.currentTimeMillis() <= 60000) { return "Due"; } else { - String time = (String) DateUtils.getRelativeTimeSpanString(arivalTime.getTime(), System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS); + String time = (String) DateUtils.getRelativeTimeSpanString(arivalTime.getTime(), + System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS); time = time.replace("in ", ""); time = time.replace(" minutes", "m"); time = time.replace(" minute", "m"); diff --git a/src/net/cbaines/suma/StopView.java b/src/net/cbaines/suma/StopView.java index 011964d..08e5843 100644 --- a/src/net/cbaines/suma/StopView.java +++ b/src/net/cbaines/suma/StopView.java @@ -23,7 +23,6 @@ import java.sql.SQLException; import java.text.DateFormat; import android.app.Activity; -import android.content.Context; import android.content.Intent; import android.view.Gravity; import android.view.View; @@ -87,15 +86,19 @@ public class StopView extends LinearLayout implements OnClickListener, OnLongCli if (stop.bus.id != null) { if (stop.live) { - onClickMessage = "Bus " + stop.bus.toString() + " at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + onClickMessage = "Bus " + stop.bus.toString() + " at " + + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } else { - onClickMessage = "Timetabled bus " + stop.bus.toString() + " at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + onClickMessage = "Timetabled bus " + stop.bus.toString() + " at " + + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } } else { if (stop.live) { - onClickMessage = "Unidentified bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + onClickMessage = "Unidentified bus (" + stop.bus.getName() + ") at " + + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } else { - onClickMessage = "Timetabled bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + onClickMessage = "Timetabled bus (" + stop.bus.getName() + ") at " + + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } } } catch (SQLException e) { @@ -133,7 +136,8 @@ public class StopView extends LinearLayout implements OnClickListener, OnLongCli ((Activity) context).startActivityForResult(i, 0); } else { if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT); + context.activityToast = Toast.makeText(context, + "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT); } else { context.activityToast.setText("Arival prediction not avalible for timetabled buses"); context.activityToast.setDuration(Toast.LENGTH_SHORT); diff --git a/src/net/cbaines/suma/TimetableAdapter.java b/src/net/cbaines/suma/TimetableAdapter.java index ae4407f..9ec7a72 100644 --- a/src/net/cbaines/suma/TimetableAdapter.java +++ b/src/net/cbaines/suma/TimetableAdapter.java @@ -19,7 +19,6 @@ package net.cbaines.suma; -import android.content.Context; import android.util.Log; import android.view.View; import android.view.ViewGroup; -- cgit v1.2.3