com.supermap.mdatacollector

Class MDataCollector

  • java.lang.Object
    • com.supermap.mdatacollector.MDataCollector


  • public class MDataCollector
    extends java.lang.Object
    Multimedia data collection class

    Support the collection of photos, audio and video, while recording the location of the latitude and longitude coordinates, and can be uploaded to the specified iportal service, also supports downloading data from iportal

    • Constructor Detail

      • MDataCollector

        public MDataCollector(android.content.Context context)
        Constructor
        Parameters:
        context - Activity context
    • Method Detail

      • addNetworkAccessMediaFileListener

        public void addNetworkAccessMediaFileListener(NetworkAccessMediaFileListener listener)
        Adds network transmission listener.
        Parameters:
        listener - Network transfer listener
      • removeNetworkAccessMediaFileListener

        public void removeNetworkAccessMediaFileListener(NetworkAccessMediaFileListener listener)
        Removes network transmission listener.
        Parameters:
        listener - Network transfer listener
      • login

        public boolean login(java.lang.String url,
                             java.lang.String username,
                             java.lang.String password)
        Log in iPortal. Throw IllegalStateException if the user name or password is wrong.
        Parameters:
        url - iPortal Service login address,eg:"http://" + IPiPortal + ":8090/iportal"
        username - username
        password - user password
        Returns:
        The login is successful and returns true; otherwise, it returns false
      • logout

        public void logout()
        Logout information.
      • downloadMediaFiles

        public void downloadMediaFiles(Rectangle2D bounds)
        Downloads media files with specified scope.
        Parameters:
        bounds - Given map range
      • uploadMediaFiles

        public void uploadMediaFiles(Rectangle2D bounds)
        Uploads media files with specified scope.
        Parameters:
        bounds - Given map range
      • setMediaDataset

        public boolean setMediaDataset(Datasource datasource,
                                       java.lang.String datasetName)
        Sets the dataset for media collection.
        Parameters:
        datasource - data source
        datasetName - Data set name
        Returns:
        The setting is successful and returns true; otherwise, it returns false

        Notes:

        1. The data set for multimedia acquisition is the point data set, and the MediaFileName and MediaFileType fields are set to store the multimedia file name and file type respectively,

        Where MediaFileName field type is text type, MediaFileType type is 16-bit integer.

        2. If the specified dataset does not exist, one such data set will be created in the given data source.

        3. If the specified data does not exist MediaFileName or MediaFileType field, it will throw an IllegalStateException exception, then re-set the data set,

        Or add a field for the dataset based on point 1.

      • getMediaDataset

        public Dataset getMediaDataset()
        Gets the dataset for media collection.
        Returns:
        Returns the dataset
      • setLocalFilePath

        public void setLocalFilePath(java.lang.String path)
        Sets the path for storing local media files.
        Parameters:
        path - Store the path of the multimedia file
      • getLocalFilePath

        public java.lang.String getLocalFilePath()
        Gets the path for storing local media files.
        Returns:
        Store the path of the multimedia file
      • captureImage

        public boolean captureImage()
        Enables the camera to capture photoes.
        Returns:
        Returns true if the application is successful, false otherwise
      • captureVideo

        public boolean captureVideo()
        Open the camera to capture photos.
        Returns:
        Returns true if the application is successful, false otherwise
      • onActivityResult

        public void onActivityResult(int requestCode,
                                     int resultCode,
                                     android.content.Intent data)
        The result process after photo, audio, or video is finished. You need to override onActivityResult in Activity, and call this method in the override function, and provide parameters by override onActivityResult
        Parameters:
        requestCode - Request code
        resultCode - Result code
        data - Returned data
      • startCaptureAudio

        public void startCaptureAudio()
        Starts recording.
      • stopCaptureAudio

        public boolean stopCaptureAudio()
        Stop recording, and save the audio file.
        Returns:
        Get successful, return true, otherwise false
      • setGPSData

        public void setGPSData(LocationManagePlugin.GPSData gpsdata)
        Sets GPS data. The data is from custom function.
        Parameters:
        gpsdata - GPS data.
      • openGPS

        public boolean openGPS()
        Starts GPS function for positioning.
        Returns:
        Successful on, returns true; otherwise, returns false
      • closeGPS

        public void closeGPS()
        Close GPS.
      • removeMediaFilesWithBounds

        public boolean removeMediaFilesWithBounds(Rectangle2D bounds)
        Deletes the collected media data according to the given map bounds.
        Parameters:
        bounds - Map range
        Returns:
        Returns whether the deletion was successful
      • removeMediaFilesWithID

        public boolean removeMediaFilesWithID(int mediaFileID)
        Deletes the collected media data according to SMID
        Parameters:
        mediaFileID - SMID value
        Returns:
        Returns whether the deletion was successful