How to use foursquare intents to checkin?

649 views
Skip to first unread message

mcvetyty

unread,
Apr 20, 2010, 7:35:45 PM4/20/10
to foursquare API
Hello -

I am hoping someone might be willing to assist me. I have been
scrounging the internet looking for Android Foursquare implementation
examples and they do not seem to be anywhere..

I am trying to familiarize myself with the API and am simply looking
for an example checkin call ideally using a pre-existing checkin
intent.

What I have done so far is imported the foursquarelib_2009111500.jar
library and am hoping that there are intents that allow me to easily
login into foursquare and log a checkin.

Can someone explain what I should be importing to do this, and whether
these itents exist? Any sample code would be much appreciated!

Thank you

--
To post to this group, send email to foursqu...@googlegroups.com

http://groups.google.com/group/foursquare-api

Mark

unread,
Apr 21, 2010, 2:37:17 PM4/21/10
to foursquare API
Hi,

If the user already has the foursquare app installed, you can use an
intent like this:

Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://m.foursquare.com/checkin?vid=venueid"));

If the user does not have the app installed, it will resolve to a
mobile web browser experience.

If you'd like to just do a checkin yourself without using an intent
from the foursquare app, you can do that too. The code is all public
for the project:

http://code.google.com/p/foursquared/

you can see that all we're doing is using the public checkin api call:

http://api.foursquare.com/v1/checkin

see that method here for details:

http://groups.google.com/group/foursquare-api/web/api-documentation

the parameters should be straightforward, the only thing to note is
that you have to authenticate to make that call (ie. you'd have to get
the user to give you their foursquare credentials at some point).

Let me know if you have any questions with this,

Thanks,
Mark

Joe LaPenna

unread,
Apr 21, 2010, 11:22:55 PM4/21/10
to foursqu...@googlegroups.com

The jar he's referrig to is an alternte build target for our project, mark. (Not sure if I ever mentioned it). Its android agnostic.

mcvetyty,

If you want java access (not intent based) to the api, look at the createFoursquare method in Foursquared.java for an example of how to instantiate an instance of a Foursquare object, the rest should be straight forward.

Mark Wyszomierski

unread,
Apr 22, 2010, 12:43:36 AM4/22/10
to foursqu...@googlegroups.com
Oh cool yeah I missed that, that is probably your best bet then mcvetyty,

Mark
Reply all
Reply to author
Forward
0 new messages