Thursday, June 12, 2014

Android: Open Facebook official app from your own app with different intents

Opening Facebook's official android app from your own app is really easy. You just need to create an intent with correct uri and start and activity with that intent. The app will open with the right page, group, picture, video or etc.

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(intent);

where uri could be any of the following:

fb://root
fb://feed
fb://feed/{userID}
fb://profile
fb://profile/{userID}
fb://page/{id}
fb://group/{id}
fb://place/fw?pid={id}
fb://profile/{#user_id}/wall
fb://profile/{#user_id}/info
fb://profile/{#user_id}/photos
fb://profile/{#user_id}/mutualfriends
fb://profile/{#user_id}/friends
fb://profile/{#user_id}/fans
fb://search
fb://friends
fb://pages
fb://messaging
fb://messaging/{#user_id}
fb://online
fb://requests
fb://events
fb://places
fb://birthdays
fb://notes
fb://places
fb://groups
fb://notifications
fb://albums
fb://album/{%s}?owner={#%s}
fb://video/?href={href}

Thursday, June 5, 2014

Android game engines

I want to try my hand at game development for smart phones. I am familiar with Android and own 4-5 Android devices so the platform choice is straight forward. But I cant seem to decide which game engine to start with. I have tried googling a lot and there is no clear winner. The most popular game engines seem to be Unity, Corona and Cocos2D. Cocos2D is the only one of these which is totally free. So I think I will start with Cocos2D. If someone has other suggestions please let me know.