How to detect Android or iOS

Mike Bonner bonnmike at gmail.com
Wed Apr 11 18:12:02 EDT 2012


Might look at the machine() function. Still have to check whats returned
and figure it out, but can skip the check for 'mobile' and go directly to
looking for ios devices.

On Wed, Apr 11, 2012 at 4:02 PM, Andre Garzia <andre at andregarzia.com> wrote:

> Hey Folks,
>
> As someone who is about to finish some cross-platform libraries to be
> released soon, I must ask. Is there any clear way to detect if I am running
> on iOS or Android? What I have right now is checking the environment to see
> if it is "mobile" and then I check for all the possible combinations of
> iPad, iPhone, iPad Simulator and iPhone Simulator, if it is not them then I
> assume it is Android.
>
> I think we need some clearer thing that returns "iOS" or "Android".
>
> Also, is there anyway for the library to get the bundle id for Android?
> There is a way on iOS but not on Android.
>
> Cheers
> andre
>
> --
> http://www.andregarzia.com -- All We Do Is Code.
> http://fon.nu -- minimalist url shortening service.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list