android - How do I programmatically launch the "Google Play Games Profile" Game Page -


i want directly launch google play game page game programmatically when player hits button game screen:

google play game controller icon

an example of page want launch is: google play game page

https://drive.google.com/file/d/0b8xfkv7sp0jzdzjiwwpfwg8znhoydnmzwkwzzvjwzdjuuxzr/view?usp=sharing

any thoughts/suggestions on doing this?

ps. i've taken random awesome game "badland" example :). hope that's okay!

it has been while don't know if found answer have been working on same thing today , figured share solution. found no sources on online , ended decompiling app @ expects intents launch it.

intent intent = new intent(); //clear activity button returns app intent.addflags(intent.flag_activity_clear_top); //manually specify package , activity name intent.setcomponent(new componentname("com.google.android.play.games", "com.google.android.gms.games.ui.destination.api.apiactivity")); //not needed default happens if don't specify it. intent.addcategory(intent.category_default); //you must specify current players user. ensures google play games logged in same person. intent.putextra("com.google.android.gms.games.account_key", games.players.getcurrentplayerid(googleapiclient)); intent.putextra("com.google.android.gms.games.screen", 1050); //"magic" number source code page intent.putextra("com.google.android.gms.games.game", games.gamesmetadata.getcurrentgame(googleapiclient)); startactivity(intent); 

note page uses hard coded number. tested on several versions of google play games , worked still haven't found value defined. may want add in error handling cases such google play games not being installed.

details on more pages such profile compare

github gist of pages


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -