If you request an Android content provider, you can achieve this by passing MAX(COLUMN_NAME)in to the selection parameter ContentResolver.query:
getContentResolver().query(uri, projection, "MAX(COLUMN_NAME)", null, sortOrder);
Where Uri is the address of the content provider. This should return the single row with the highest value in COLUMN_NAME.
source
share