Context-detection API for Android developed as a university project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ContextApi.java 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * Copyright (c) 2009-2010 Chris Smith
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. * SOFTWARE.
  21. */
  22. package uk.co.md87.android.contextapi;
  23. import android.net.Uri;
  24. /**
  25. * Provides access to constants used to access the exported API of the Context
  26. * Analyser.
  27. *
  28. * @author chris
  29. */
  30. public class ContextApi {
  31. public static class Intents {
  32. public static final String ACTIVITY_CHANGED
  33. = "uk.co.md87.android.contextanalyser.ACTIVITY_CHANGED";
  34. public static final String CONTEXT_CHANGED
  35. = "uk.co.md87.android.contextanalyser.CONTEXT_CHANGED";
  36. public static final String PREDICTION_AVAILABLE
  37. = "uk.co.md87.android.contextanalyser.PREDICTION_AVAILABLE";
  38. public static class ContextTypes {
  39. public static final int PLACE = 1;
  40. }
  41. }
  42. public static class Places {
  43. public static final Uri CONTENT_URI = Uri.parse("content://uk.co.md87"
  44. + ".android.contextanalyser.placescontentprovider/places");
  45. public static final String CONTENT_TYPE = "vnd.contextanalyser.location";
  46. public static class ColumnNames {
  47. public static final String _ID = "_id";
  48. public static final String NAME = "name";
  49. public static final String LATITUDE = "lat";
  50. public static final String LONGITUDE = "lon";
  51. public static final String DURATION = "duration";
  52. public static final String VISIT_COUNT = "times";
  53. public static final String LAST_VISIT = "lastvisit";
  54. }
  55. }
  56. public static class Journeys {
  57. public static final Uri CONTENT_URI = Uri.parse("content://uk.co.md87"
  58. + ".android.contextanalyser.journeyscontentprovider/journeys");
  59. public static final String CONTENT_TYPE = "vnd.contextanalyser.journey";
  60. public static class ColumnNames {
  61. public static final String _ID = "_id";
  62. public static final String START = "start";
  63. public static final String END = "end";
  64. public static final String STEPS = "steps";
  65. public static final String NUMBER = "number";
  66. }
  67. }
  68. public static class JourneySteps {
  69. public static final Uri CONTENT_URI = Uri.parse("content://uk.co.md87"
  70. + ".android.contextanalyser.journeyscontentprovider/steps");
  71. public static final String CONTENT_TYPE = "vnd.contextanalyser.journeystep";
  72. public static class ColumnNames {
  73. public static final String _ID = "_id";
  74. public static final String ACTIVITY = "activity";
  75. public static final String REPETITIONS = "repetitions";
  76. public static final String JOURNEY = "journey";
  77. public static final String NEXT = "next";
  78. }
  79. }
  80. public static class Predictions {
  81. public static final Uri CONTENT_URI = Uri.parse("content://uk.co.md87"
  82. + ".android.contextanalyser.predictionscontentprovider/destination");
  83. public static final String CONTENT_TYPE = "vnd.contextanalyser.prediction";
  84. public static class ColumnNames {
  85. public static final String _ID = "_id";
  86. public static final String PLACE = "place";
  87. public static final String COUNT = "count";
  88. }
  89. }
  90. public static class Activities {
  91. public static final Uri CONTENT_URI = Uri.parse("content://uk.co.md87"
  92. + ".android.contextanalyser.activitiescontentprovider/current");
  93. public static final String CONTENT_TYPE = "vnd.contextanalyser.activity";
  94. public static class ColumnNames {
  95. public static final String ACTIVITY = "activity";
  96. }
  97. }
  98. }