如何在Android Air应用程序中通过as3打开Instagram页面?
问题描述:
我想通过点击我的应用程序中的一个按钮来打开一个Instagram页面,例如Instagram应用程序中的“instagram/mypage”。 最新的代码?如何在Android Air应用程序中通过as3打开Instagram页面?
mybuttun.addEventListener(MouseEvent.CLICK, open_instagram_page);
function open_instagram_page(event:MouseEvent)
{
//what should i write here?
}
,我发现这个代码是开放的Android设备的“设置”页面,如何改变对Instagram的应用程序打开特定网页:
var url:String = ("intent:#Intent;" +
"action=android.intent.action.MAIN;" +
"category=android.intent.category.LAUNCHER;" +
"component=com.android.settings/.Settings;" +
"end");
navigateToURL(new URLRequest(url));
答
可以使用Share ANE将Instagram应用打开到特定页面。 Android和iOS以下工作:
var app:Application = new Application("com.instagram.android", "instagram://");
var options:ApplicationOptions = new ApplicationOptions();
options.action = ApplicationOptions.ACTION_VIEW;
options.data = "http://instagram.com/_u/distriqt";
options.parameters = "user?username=distriqt";
if (Share.service.applications.isInstalled(app))
{
Share.service.applications.launch(app, options);
}
我的这个ANE的开发商之一。
答
你必须选择AIR本机扩展(ANE)
这很简单,首先验证Instagram是Installed,然后只是为此目的编写本机代码,让AIR在AS3和Android机器之间进行通信。
本地代码可能成为Java(Android版)和Objective-C(用于IOS)
为开端看看this official tutorial
也有另一种Documentation各地ANE
navigateToURL(new URLRequest(“http://*.com”)); – Organis
@Organis你的代码打开一个对话框“完成操作使用”,并显示一些应用程序,如铬 – Fanous
这是在移动设备上打开任何**链接的正常行为,我想。 – Organis