Need Intagram ActivityClass/ActivityPackage/etc. for Activity Starter

560 views
Skip to first unread message

Shahrooz Farahmand

unread,
Feb 19, 2016, 2:18:17 PM2/19/16
to MIT App Inventor Forum
Hi,

I need the information to make the button to open the Instagram app on the phone. I've read all of topics, sources and hints regarding this issue such as finding the info by log file, from the app documentation, other android app dev forums, etc. but no success. Also, I've used MAIN instead of VIEW and any possible varieties but not working.

I really appreciate your help.


Capture.JPG

Taifun

unread,
Feb 19, 2016, 2:58:04 PM2/19/16
to mitappinv...@googlegroups.com
please provide the relevant part of your logcat output and we can try to help you to find the correct parameter
Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

Shahrooz Farahmand

unread,
Feb 19, 2016, 3:43:06 PM2/19/16
to MIT App Inventor Forum
Taifun,

Thanks for reply. Actually this is one of the problem... I gave up to logcat as it didnt work for me. When I connect the phone to the PC it doesn't recognize it. I've tried to do it with simulator app on the phone and I got something but as my phone is not rooted it just returned the activity of the app itself. I've attached them though. 

BTW, I am not expert in working with logcat and maybe I need the correct command!

Thanks,
logcat2.log
logcat.log

Taifun

unread,
Feb 20, 2016, 9:54:55 AM2/20/16
to MIT App Inventor Forum
unfortunately your logcat output does not help 

Discovering how to set the ActivityStarter properties

If you want to start an app and you you don't have the source code or documentation, you might still be able figure out the package name and class name (and sometimes the intent) by launching the app and inspecting the Android system log.

For example, if you use the YouTube application to play a video, you'll see in the log:

I/ActivityManager(   86): Starting activity: Intent { act=android.intent.action.VIEW dat=vnd.youtube:nAPk9ycCbfc cmp=com.google.android.youtube/.PlayerActivity }

If you can find the "cmp=" string, then the ActivityPackage is the part before the slash, e.g.,  com.google.android.youtube.  The ActivityClass is is the entire "cmp=" part, without the slash character, e.g., com.google.android.youtube.PlayerActivity.   There may also in general be "dat=" information that should be specify as the DataUri property.


Taifun

Shahrooz

unread,
Feb 20, 2016, 7:51:37 PM2/20/16
to MIT App Inventor Forum
Hi Taifun,

Thanks for the resource but I've read it many times. No success... I couldn't find this ActivityClass/ActivityPackage for instagram any where.. Still looking for it.. BTW, I have another problem here: It would be great if you take a look at it.


Thanks,

Taifun

unread,
Feb 20, 2016, 8:48:29 PM2/20/16
to MIT App Inventor Forum
1. start logcat
2. then start the Instagram app
3. then look at the logcat output and you should find it
Taifun

Shahrooz

unread,
Feb 20, 2016, 8:49:55 PM2/20/16
to MIT App Inventor Forum
Taifun,

I did it more than 30 times.. the only log is the one I've attached. :(

Shahrooz

unread,
Feb 21, 2016, 7:38:17 AM2/21/16
to MIT App Inventor Forum
Ok... found the solution...

Use these parameter to open a profile page or an image directly with Instagram app.

Instagram button:
Action: android.intent.action.VIEW
ActivityPackage: com.instagram.android
ActivityClass: com.instagram.android.activity.UrlHandlerActivity
DataUri: http://instagram.com/_u/USERNAME/ (Open a profile)
or
DataUri: http://instagram.com/p/IMAGE_ID/ (Open an image)

How to find Image ID:
Open the image in browser and get the code from the URL (screenshot attached)



instagram-image-id.JPG
instagram-button.JPG

Taifun

unread,
Feb 21, 2016, 9:51:31 AM2/21/16
to MIT App Inventor Forum
thank you for sharing the solution
Taifun

Shahrooz

unread,
Feb 21, 2016, 10:30:16 AM2/21/16
to MIT App Inventor Forum
Taifun,

That's the spirit of community.. Hope everyone believe in it..

Abraham Getzler

unread,
Feb 21, 2016, 6:14:08 PM2/21/16
to MIT App Inventor Forum
Added to my FAQ.
ABG

Reply all
Reply to author
Forward
0 new messages