Can we generate and download MMPK file on the fly for any extent selected by the user using Android SDK 100.1?
Not for MMPKs. This is an all in one package that can be stored online and downloaded all at once to the device.
I believe what you are looking for is ad-hoc offline which allows you to take a webmap that you have hosted on ArcGIS Online offline based upon an extent. This should be possible via the com.esri.arcgisruntime.tasks.offlinemap| arcgis-android package.
Thanks for replying Alexander.
Yes are looking for offline based on extent but we are not using webmaps. We have native apps developed on Android, iOS and Windows Phone platform and map consists of basemaps and operational layers from ArcGIS server 10.5. Is there a way to dynamically download the data on the fly based on extent selected by user?
So two options...
1) Build a webmap in portal or agol and supply that to the aforementioned class to download. (You stated that this would not suite your workflow)
2) Use this class for each layer you would like to take offline and store those layers in storage somewhere: GeodatabaseSyncTask| arcgis-android You can use createDefaultGenerateGeodatabaseParametersAsync(Geometry extent) to specify the extent you would like to take offline for each layer you construct with the synctask.
Retrieving data ...