Android 通过代码安装应用程序......并使用一些参数启动应用程序
我真的很害怕,因为我不知道如何找到我的问题的示例或文档。我开发了一种 Ndroid Market,可以让您下载 .zip 文件并将其保存在 sd 中(例如 root\download)。每个 zip 包含一个图标和一个 html Web 应用程序(例如 Icon1.ico
和 Application1.html
)。下载完成后,MyMarket 会解压缩 application1.zip 文件并将其放入文件夹中。
我想做的是找出如何使用 icon1.ico
作为图标将 application1.html
添加到我的应用程序列表中,基本上我想要这样如果有人单击了我的应用程序列表中手机的菜单按钮,则会显示带有 icon1.ico
图像的图像,但该怎么做呢?我找不到任何代码示例。
然后是第二步。我必须开发这两种替代方案,然后其他人会在它们之间进行选择
- 当我单击列表应用程序上的 icon1 时,将打开默认浏览器并在其中运行 html 应用程序......
最困难的是,当我单击 icon1 时,MyMarket 应用程序会打开,但带有一个参数,就像当在java中你运行program1但有一个参数您可以在 argv 数组中检索。因此,对于 esample,如果我单击 MyMarket 图标或 Icon1 图标,则会启动相同的应用程序,但随后 MyMarket 检查“argv”是否为空,如果不是,例如,有一个字符串“application1”,它会打开另一个活动一个 webview 并运行其中的 html 文件。
i'm really freaking out cause i don't know how to find example or documentation for my issue. I developed a kind of Ndroid Market that let you download .zip file and save the in the sd (ex root\download). Each zip contains an icon and an html web application (ex. Icon1.ico
and Application1.html
). When the download is finished MyMarket unzips the application1.zip file and puts it in a folder.
What I would like to do is to find out how to add the application1.html
to the list of my application using icon1.ico
as icon, basically I'd like that if someone clicked on the menu button of the phone in the list of my application is shown one with the icon1.ico
image, but how to to that? I can't find any code example.
And then the second step. I have to develop both this alternatives and then someone else will choose beetween them
When i click on the icon1 on the list application the default browser is opened and the html application is run inside it....
The most difficul, when i click on the icon1 MyMarket Application is opened but with a parameter, like when in java you run program1 but with one argument that you can retrieve in the argv array. So for esample if i click on the MyMarket icon or on the Icon1 icon the same application is started but then MyMarket check if the "argv" is empty and if it's not and for exmaple there is a string "application1" it open another activity with a webview and run the html file inside it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于大多数主屏幕实现来说这是不可能的。标准启动器中显示的唯一内容是来自 APK 文件的活动,标记为属于启动器。您无法即时创建这些。
欢迎您制作自己的主屏幕,将您想要的行为作为一项功能。
That is not possible for most home screen implementations. The only things shown in a standard launcher are activities, from APK files, flagged as belonging in the launcher. You cannot create these on the fly.
You are welcome to make your own home screen that offers your desired behavior as a feature.