Migrating Android Native OData Applications

Migrate your Android OData application from version 2.x to SAP Mobile Platform version 3.0.

Overview

This section covers migration of a REST based application from SAP Mobile Platform 2.3.x to version 3.x. The following aspects of a REST based application are covered:
  • Registration
  • Request-Response (data fetch)
  • Parsing

Registration

There is no change in code and no refactoring is required to migrate an application from 2.3.x to 3.x. Existing applications based on 2.x will continue to work against the SAP Mobile Platform 3.0 OData SDK post migration, without any code changes, with just a rebuild. The deprecated class details in this section is applicable for new application development, where it is requested or mandatorily required to use the new APIs. To use OData offline and other features such as batch processing, the new classes are mandatory.

Request-Response

With 3.x, the old SDM API has been deprecated and a new Request API is introduced for uniformity in API nomenclature. With this change, all SDM* classes and methods have been replaced with class names removing the SDM tag. The following table lists the old and new class names. The method names mostly remain the same, unless specified otherwise in this section.
List of Refactored Classes
Class name in 2.3.x version (old - deprecated) Class name in 3.0 version (new - refactored)
SDMRequestManager RequestManager
SDMConnectivityParameters ConnectivityParameters
SDMPreferences Preferences
SDMLogger Logger
SDMBaseRequest BaseRequest
SDMBundleRequest BundleRequest
SDMResponseImpl ResponseImpl
SDMHttpChannelListeners HttpChannelListeners
SDMConnectivityException ConnectivityException
SDMRequestStateElement RequestStateElement
SDMPreferencesException PreferencesException
ISDMNetListener INetListener

Parser

The following table lists the refactored classes and protocols.

List of Refactored APIs
API in Version 2.x API in Version 3.x
buildSDMODataEntryXML buildODataEntryRequestBody
parseSDMODataServiceDocumentXML parseODataServiceDocument
parseSDMODataSchemaXML parseODataSchema
parseSDMODataEntriesXML parseODataEntries
parseSDMODataOpenSearchDescriptionXML parseODataOpenSearchDescription
parseSDMODataErrorXML parseODataError
parseFunctionImportResultXML parseFunctionImportResult
Note: SAP recommends you to update the APIs to the newly refactored APIs listed. The deprecated SDM APIs are supported for backward compatibility.
Related concepts
Developing Android Applications