adapt android codes to ios codes