public static boolean isAccessTokenValid ( String accessToken ) { return ! TextUtils . isEmpty ( accessToken ) && ! ( ! accessToken . startsWith ( "pk." ) && ! accessToken . startsWith ( "sk." ) && ! accessToken . startsWith ( "tk." ) ) ; }
Checks that the provided access token is not empty or null and that it starts with the right prefixes . Note that this method does not check Mapbox servers to verify that it actually belongs to an account .