Groups keyboard shortcuts have been updated
Dismiss
See shortcuts
Skip to first unread message

Amshak M

unread,
Jul 27, 2015, 1:57:05 AM7/27/15
to MIT App Inventor Forum
Hello,
I wanted to know how to open another app using app inventor. I know it can be done using activity starter but don't know how to get the activity class and package of an app. For example Google Cardboard app.
There are many apps that has to be opened in app inventor and I wanted the best way to do it and find out activity class and package. 
I have searched in the forum and got to know about logcat. But I couldn't figure out how to work with it. So please suggest me solutions for this.
Thank you.

Peep Prants

unread,
Jul 27, 2015, 4:41:31 AM7/27/15
to MIT App Inventor Forum, amsh...@gmail.com
Hi,

I made logcat for you.

For open:
Action: android.intent.action.MAIN
ActivityClass: com.google.vr.cardboard.paperscope.carton.Home2D
ActivityPackage: com.google.samples.apps.cardboarddemo

For check if installed then resolve activity: 
ActivityPackage: com.google.samples.apps.cardboarddemo

Amshak M

unread,
Jul 27, 2015, 6:50:09 AM7/27/15
to MIT App Inventor Forum, amsh...@gmail.com
Thanks very much . I used it in my app . It works. 
Can you tell me how to get activity class of any app? Activity package is same as what you find in android->data right? How to use logcat in app inventor to check it?

Peep Prants

unread,
Jul 27, 2015, 7:32:35 AM7/27/15
to MIT App Inventor Forum
Package name is writed to google play shop aadressbar.
And how to make logcat?
http://developer.android.com/tools/help/adb.html
http://forum.xda-developers.com/showthread.php?t=1726238

Amshak M

unread,
Jul 27, 2015, 8:10:52 AM7/27/15
to MIT App Inventor Forum, amsh...@gmail.com
I have installed alogcat and system info app in my mobile. Can we get activity class of the app with this? I couldnt find anything while running alogcat. But in the system info app , there were long list of logs .I didnt know where to find the activity class. I do not know the procedure to do it. I had opened the app which I needed to find the activity class. Then i opened alogcat and system info app. Is this the right way? Can you help me with this ?
I also tried it in computer. I went to program files->app inventor->Commands for appinventor . Then opened command window and typed adb logcat. But it could not connect to my device. It says waiting for device. 

Taifun

unread,
Jul 27, 2015, 10:28:51 AM7/27/15
to MIT App Inventor Forum, amsh...@gmail.com
I wanted to know how to open another app using app inventor.
see the documentation Using the Activity Starter
 
the logcat apps only work on rooted devices!

I normally use Eclipse and Logcat there, but if you have installed the App Inventor Software (see also http://appinventor.mit.edu/explore/ai2/setup-emulator.html), you already have everything you need to use logcat...

How to use Logcat
  1. connect your device using USB with your computer
  2. in File Manger go to the App Inventor directory, which is  C:\Program Files\App Inventor or similar
  3. press Shift and right mouse click the subdirectory commands-for-Appinventor to get the context menu
  4. select "open command window here" and you will get a command window of that subdirectory
  5. enter adb logcat and the logcat will start running
To copy your log, right click, click "select all" and enter to copy the complete log into the clipboard, then open Notepad and paste it using ctrl-v.

Taifun


Amshak M

unread,
Jul 28, 2015, 2:27:15 AM7/28/15
to MIT App Inventor Forum, amsh...@gmail.com
Thanks Taifun and Peep Prants,
Yes , My phone is not rooted . So I didnt get the logs
And when I tried it in pc, It was saying Waiting for device. The reason is i hadnt set on USB Debugging . Developer option is hidden on my phone MI3 running on 4.4.4. Have to tap MIUI version several times to unhide it in my phone not the build number as in most of the phones. So now the problem is solved. 

I got the code for google cardboard app
I/ActivityManager( 1150): Start proc com.google.samples.apps.cardboarddemo for a
ctivity com.google.samples.apps.cardboarddemo/com.google.vr.cardboard.paperscope
.carton.Home2D: pid=21578 uid=10133 gids={50133, 1028, 1015, 3003}
Now I can do it for all the apps I want to. Feeling very happy about that. Thanks for the support.
Reply all
Reply to author
Forward
0 new messages