Class TripContentProvider

  • All Implemented Interfaces:
    android.content.ComponentCallbacks, android.content.ComponentCallbacks2

    public class TripContentProvider
    extends android.content.ContentProvider
    The TmdTripContentProvider should enable access to - Trip data
    • Nested Class Summary

      • Nested classes/interfaces inherited from class android.content.ContentProvider

        android.content.ContentProvider.CallingIdentity, android.content.ContentProvider.PipeDataWriter<T extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String TMD_TRIP_ITEM_MIME_TYPE
      MIME type for tmd stats item
      static java.lang.String TMD_TRIP_LIST_MIME_TYPE
      MIME type for tmd stats list
      • Fields inherited from interface android.content.ComponentCallbacks2

        TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void attachInfo​(android.content.Context context, android.content.pm.ProviderInfo info)
      This function is used to initialise the URI matcher
      int delete​(android.net.Uri uri, java.lang.String selection, java.lang.String[] selectionArgs)  
      static java.lang.String getAuthority​(android.content.Context context)
      Returns the authority string for this content provider
      static android.net.Uri getTripUri​(android.content.Context context)
      Returns the URI to retrieve TMD Trip data from the provider
      static android.net.Uri getTripUri​(android.content.Context context, long id)
      Returns the URI to retrieve TMD Trip data from the provider
      java.lang.String getType​(android.net.Uri uri)
      Returns the MIME type for a specific URI TODO add the other URIs
      android.net.Uri insert​(android.net.Uri uri, android.content.ContentValues values)  
      boolean onCreate()  
      android.database.Cursor query​(android.net.Uri uri, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder)  
      void shutdown()  
      int update​(android.net.Uri uri, android.content.ContentValues values, java.lang.String selection, java.lang.String[] selectionArgs)  
      • Methods inherited from class android.content.ContentProvider

        applyBatch, applyBatch, bulkInsert, call, call, canonicalize, clearCallingIdentity, delete, dump, getCallingAttributionSource, getCallingAttributionTag, getCallingPackage, getCallingPackageUnchecked, getContext, getPathPermissions, getReadPermission, getStreamTypes, getWritePermission, insert, isTemporary, onCallingPackageChanged, onConfigurationChanged, onLowMemory, onTrimMemory, openAssetFile, openAssetFile, openFile, openFile, openFileHelper, openPipeHelper, openTypedAssetFile, openTypedAssetFile, query, query, refresh, requireContext, restoreCallingIdentity, setPathPermissions, setReadPermission, setWritePermission, uncanonicalize, update
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TMD_TRIP_LIST_MIME_TYPE

        public static final java.lang.String TMD_TRIP_LIST_MIME_TYPE
        MIME type for tmd stats list
        See Also:
        Constant Field Values
      • TMD_TRIP_ITEM_MIME_TYPE

        public static final java.lang.String TMD_TRIP_ITEM_MIME_TYPE
        MIME type for tmd stats item
        See Also:
        Constant Field Values
    • Constructor Detail

      • TripContentProvider

        public TripContentProvider()
    • Method Detail

      • getAuthority

        public static java.lang.String getAuthority​(@NonNull
                                                    android.content.Context context)
        Returns the authority string for this content provider
        Parameters:
        context - the context where the provider are being used
        Returns:
        the authority string for this content provider
      • getTripUri

        public static android.net.Uri getTripUri​(@NonNull
                                                 android.content.Context context)
        Returns the URI to retrieve TMD Trip data from the provider
        Parameters:
        context - the context where the provider are being used
        Returns:
        the URI to retrieve TMD Trip data from the provider
      • getTripUri

        public static android.net.Uri getTripUri​(@NonNull
                                                 android.content.Context context,
                                                 long id)
        Returns the URI to retrieve TMD Trip data from the provider
        Parameters:
        context - the context where the provider are being used
        Returns:
        the URI to retrieve TMD Trip data from the provider
      • attachInfo

        public void attachInfo​(android.content.Context context,
                               android.content.pm.ProviderInfo info)
        This function is used to initialise the URI matcher
        Overrides:
        attachInfo in class android.content.ContentProvider
        Parameters:
        context - the context
        info - the provider info
      • getType

        public java.lang.String getType​(@NonNull
                                        android.net.Uri uri)
        Returns the MIME type for a specific URI TODO add the other URIs
        Specified by:
        getType in class android.content.ContentProvider
        Parameters:
        uri - the URI
        Returns:
        the MIME type for the URI
      • onCreate

        public boolean onCreate()
        Specified by:
        onCreate in class android.content.ContentProvider
      • shutdown

        public void shutdown()
        Overrides:
        shutdown in class android.content.ContentProvider
      • query

        @Nullable
        public android.database.Cursor query​(@NonNull
                                             android.net.Uri uri,
                                             @Nullable
                                             java.lang.String[] projection,
                                             @Nullable
                                             java.lang.String selection,
                                             @Nullable
                                             java.lang.String[] selectionArgs,
                                             @Nullable
                                             java.lang.String sortOrder)
        Specified by:
        query in class android.content.ContentProvider
      • insert

        @Nullable
        public android.net.Uri insert​(@NonNull
                                      android.net.Uri uri,
                                      @Nullable
                                      android.content.ContentValues values)
        Specified by:
        insert in class android.content.ContentProvider
      • delete

        public int delete​(@NonNull
                          android.net.Uri uri,
                          @Nullable
                          java.lang.String selection,
                          @Nullable
                          java.lang.String[] selectionArgs)
        Specified by:
        delete in class android.content.ContentProvider
      • update

        public int update​(@NonNull
                          android.net.Uri uri,
                          @Nullable
                          android.content.ContentValues values,
                          @Nullable
                          java.lang.String selection,
                          @Nullable
                          java.lang.String[] selectionArgs)
        Specified by:
        update in class android.content.ContentProvider