cmd scheme 启动application
来源:互联网 发布:mac os rm rf 恢复 编辑:程序博客网 时间:2024/06/06 16:28
To just start the default Launcher Activity:
Intent intent = new Intent("android.intent.category.LAUNCHER");intent.setClassName("com.facebook.katana", "com.facebook.katana.LoginActivity");startActivity(intent);
I did some research, because I wanted to find this out :). I found some ways how to start different activities easily. But I can not guarantee that this will work after upgrades of facebook. I tested it with my current facebook app and it works. At least I tested it with "adb shell" using "am start .....".
Basic is:
String uri = "facebook://facebook.com/inbox";Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));startActivity(intent);
the facebook.com part is not checked. you can even type: "facebook://gugus.com/inbox" having the same effect.
How to do this in adb.
1. Start adb shell through console: "adb shell"2. run: "am start -a android.intent.action.VIEW -d facebook://facebook.com/inbox"
this will start the inbox activity.Here some Uris with examples. I think they speak for themselves what they do.
facebook://facebook.com/inboxfacebook://facebook.com/info?user=544410940 (id of the user. "patrick.boos" won't work)facebook://facebook.com/wallfacebook://facebook.com/wall?user=544410940 (will only show the info if you have added it as friend. otherwise redirects to another activity)facebook://facebook.com/notificationsfacebook://facebook.com/photosfacebook://facebook.com/albumfacebook://facebook.com/photofacebook://facebook.com/newsfeed
there might be additianl parameters you can give to certain of those uris, but I have no time to go through all the code of those activities.
How did I do this? check out apktool.
Looking at the latest Facebook apk (1.6), it looks like both "facebook://" and "fb://" are registered protocols.
facebook://
facebook:/chatfacebook:/eventsfacebook:/friendsfacebook:/inboxfacebook:/infofacebook:/newsfeedfacebook:/placesfacebook:/requestsfacebook:/wall
fb://
fb://rootfb://feedfb://feed/{userID}fb://profilefb://profile/{userID}fb://page/{id}fb://group/{id}fb://place/fw?pid={id}fb://profile/{#user_id}/wallfb://profile/{#user_id}/infofb://profile/{#user_id}/photosfb://profile/{#user_id}/mutualfriendsfb://profile/{#user_id}/friendsfb://profile/{#user_id}/fansfb://searchfb://friendsfb://pagesfb://messagingfb://messaging/{#user_id}fb://onlinefb://requestsfb://eventsfb://placesfb://birthdaysfb://notesfb://placesfb://groupsfb://notificationsfb://albumsfb://album/{%s}?owner={#%s}fb://video/?href={href}fb://post/{postid}?owner={uid}¹
Sorry if I missed some... only played with a handful of them in the emulator to see if they actually work - a bunch of them will cause the Facebook application to crash.
¹ where postid is in the uid_postid
format, e.g 11204705797_10100412949637
- cmd scheme 启动application
- maven cmd build application
- 使用URL Scheme启动app
- CMD启动目录更改
- cmd启动tomcat
- cmd 启动停止服务
- 从cmd启动mysql
- mysql cmd启动
- CMD启动selenium
- CMD启动Oracle服务
- DocFetcher CMD 启动脚本
- cmd启动jetty
- cmd命令启动tomcat
- cmd 启动Mysql 服务
- CMD命令启动服务
- 调试由URL scheme启动的进程
- 通过URL Scheme启动Android应用
- 配置scheme隐式启动Activity
- window相关属性
- 转:linux目录结构及主要内容
- linux 内核调试--KDB 入门指南
- android window相关属性(二)
- 小孩睡觉模拟(Observer设计模式)
- cmd scheme 启动application
- 单链表的排序(一)
- 无限级分类原理
- php截取固定大小图片
- 纪念过去的一年 之 VII
- 对于“深入tomcat”系列的说明
- ExtJS 动态改变 Ext.data.store 的url 地址
- Unix/Linux C静态库的使用
- FSSC 22000 食品安全管理系统