The CLPlacemark
is an iOS class, so you can not use this class in Android.
Android has a Geocoder class, it can return a list of Address objects. But the Address
class does not have method to tell whatever a location is in a ocean or not.
One way is to use the Google Maps Geocoding API. If your address is in land, the result_type of the response will be something like "administrative_area". if you are in the sea, the response will be "natural_feature". You can see the return type from this its documentation.
However the Geocoding API is a Javascript API, if you want to use it in Android, you can do a HTTP URL request, sample request:
URL requestUrl = new URL("https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=API_KEY" );
HttpURLConnection connection = (HttpURLConnection)requestUrl.openConnection();
connection.setRequestMethod("GET");
connection.connect();
then you can parse the JSON response, and find out whether a location is in a ocean or not. Alternatively, you can use Google's Java client library for your request, sample usage: https://developers.google.com/maps/documentation/webservices/client-library#usage
You can find more information about to use Geocoding API to determine see or land from these SO answers:
https://stackoverflow.com/a/3645696/4195406
https://stackoverflow.com/a/9644812/4195406