mobile CCTV,mobile surveillance,police body worn cameras

 forgetPW
 registerNow
search
view: 8552|reply: 79
打印 prevThread nextThread

如何通过其他apk直接打开咱们的apk

[copyURL]

3

主题

115

帖子

295

积分

midMem

Rank: 3Rank: 3

积分
295
jumpTo
owner
poston 2020-1-21 09:37 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
1.。Intent startIntent = new Intent();ComponentName componentName = new ComponentName(
        "com.smarteye.mcu",
        "com.smarteye.mcu.BroadcastStartActivity");
startIntent.setComponent(componentName);
startIntent.addFlags(FLAG_ACTIVITY_NEW_TASK);
startIntent.putExtra("package", getPackageName());// 调用者App包名
startActivity(startIntent);
2.Intent intent = new Intent();intent.setAction("mcp.intent.action.MCP_LOGIN");
intent.setPackage("com.smarteye.mcu");
BroadcastLoginInfoEntity loginInfo = new BroadcastLoginInfoEntity();
loginInfo.iProtoType = 0;
loginInfo.szServerAddr = "192.168.0.128";
loginInfo.iServerPort = 9701;
loginInfo.szUserType = "UA";
loginInfo.szEncodeType = "none";
loginInfo.szUserName = "wang";
loginInfo.szPassword = "aaa111";
String value = (new Gson()).toJson(loginInfo);
Log.i("ttt",value);
intent.putExtra("msg", value);
intent.putExtra("package", "com.hao.talkim");
sendBroadcast(intent);
reply

使用道具 report

3

主题

115

帖子

295

积分

midMem

Rank: 3Rank: 3

积分
295
sofa
 Owner| poston 2020-1-21 10:02 | 显示全部楼层
提示:登录失败:连接失败  
reply agree Against

使用道具 report

3

主题

115

帖子

295

积分

midMem

Rank: 3Rank: 3

积分
295
bench
 Owner| poston 2020-1-21 10:03 | 显示全部楼层
我现在就想调用起咱们的apk   所以我这块需要搭建一个后台服务吗? 还是只要有咱们的apk就行
reply agree Against

使用道具 report

3

主题

115

帖子

295

积分

midMem

Rank: 3Rank: 3

积分
295
ground
 Owner| poston 2020-1-21 10:09 | 显示全部楼层
直接只点登录按钮的话 没有任何提示 log日志是这样的:other app action:mcp.intent.action.MCP_APP_START    other app sendBroadcast login!
reply agree Against

使用道具 report

3

主题

115

帖子

295

积分

midMem

Rank: 3Rank: 3

积分
295
5#
 Owner| poston 2020-2-10 17:51 | 显示全部楼层
现在群里说 需要我们打开咱们的程序以后,启动一下VideoPreviewActivity   这块咱们是通过这样的方式启动吗?
Intent intent=new Intent();
intent.setClassName("外部应用的包名", "外部Activity类名");
startActivity(intent);   那么咱们这个类得包名是什么?  是和BroadcastStartActivity一样吗?
reply agree Against

使用道具 report

3

主题

115

帖子

295

积分

midMem

Rank: 3Rank: 3

积分
295
6#
 Owner| poston 2020-2-11 15:10 | 显示全部楼层
你们提供的 MCP_NA20200120_182_broadcast_login_A版本 的VideoPreviewActivity 具有export = "true" 权限吗?
reply agree Against

使用道具 report

3

主题

115

帖子

295

积分

midMem

Rank: 3Rank: 3

积分
295
7#
 Owner| poston 2020-2-11 15:11 | 显示全部楼层
或者 确定是VideoPreviewActivity这个类吗?
try{
            Intent intent1=new Intent();
            intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent1.setClassName("com.smarteye.mcu", "com.smarteye.mcu.VideoPreviewActivity");
            startActivity(intent1);
        }catch (Exception e){
            Toast.makeText(Main2Activity.this,"VideoPreviewActivity有问题",Toast.LENGTH_SHORT).show();
        }
reply agree Against

使用道具 report

3

主题

115

帖子

295

积分

midMem

Rank: 3Rank: 3

积分
295
8#
 Owner| poston 2020-2-11 15:11 | 显示全部楼层
返回了 "VideoPreviewActivity有问题“
reply agree Against

使用道具 report

3

主题

115

帖子

295

积分

midMem

Rank: 3Rank: 3

积分
295
9#
 Owner| poston 2020-2-11 15:22 | 显示全部楼层
因为我现在手头没设备 自己写了个简单的例子 让别人操作的。 引用咱们的这个VideoPreviewActivity这个类,要打开咱们的视频界面。你可以看到我之前发的代码,按照道理,这个代码打开第三方APK的某页面是没有问题的对吧?
但目前调用不起来这个视频界面,目前初步考虑三个原因:
1.VideoPreviewActivity 这个类在不在com.smarteye.mcu包下
2.这个类 在这个版本的apk中 是否具有export = "true"权限
3.这个类 类名是对的吧?
reply agree Against

使用道具 report

3

主题

115

帖子

295

积分

midMem

Rank: 3Rank: 3

积分
295
10#
 Owner| poston 2020-2-11 15:23 | 显示全部楼层
这个问题是接着我昨天问的问题的
reply agree Against

使用道具 report

creditRule

QQ|wireless surveillance

GMT+8, 2024-5-18 07:16 , Processed in 0.059573 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

QuickReply backToTop BackToList