将依赖项发布到 android market
我正在为我的公司开发一个连接到蓝牙视频设备的 Android 应用程序。我们正在合作的一家第三方公司构建了蓝牙相机,并构建了我们的应用程序连接到的服务(Android 服务),我们用它来与相机交互。该公司不希望我们访问源代码,因此他们以服务的形式创建了一个 SDK,必须将其安装在手机上才能与相机进行交互。如果未安装该服务(只是一个 APK),我们的应用程序将无法运行。
但是,我们可以检测到该服务不存在,然后继续获取 apk,现在我们正在尝试找出最好的方法来做到这一点。我们是否可以让其他公司在 Android 市场上发布此服务,即使它没有 ui 并且安装后似乎什么也不做?你能否将某些东西放入 Android 市场而不让它在普通过滤器下显示(这意味着获取它的唯一方法是直接进入该页面?)。我认为他们不希望人们安装它,因为第三方公司确实在那里销售自己的相机(几乎与他们为我们制造的相机相同)并且他们在市场上有应用程序。
另一种可能性是我们自己托管文件并在用户首次安装应用程序时下载它。但问题是我们必须找出自己的升级方法。
有谁有这方面的经验或有任何想法可能是处理我们情况的最佳方法?
I am working on an android application for my company which connects to a bluetooth video device. A 3rd party company that we are working with built the bluetooth camera and have built a service (android service) that our app connects to which we use to interact with the camera. This company did not want us to have access to the source code so they created an SDK in the form of a service which must be installed on the phone for interaction with the camera to take place. If the service (which is just an APK) is not installed our app won't work.
However, we can detect that the service does not exist and then proceed to get the apk and now we are trying to figure out the best way to do that. Is it possible we could have the other company publish this service in the android market even though it has no ui and when installed would appear to do nothing? Can you put something in the android market and not have it show up under normal filters (meaning the only way to get to it would be by going directly to the page?). I don't think they want people installing it since the 3rd party company does sell there own camera (almost the same as the one they make for us) and they have applications in the market for it.
The other possibility is we host the file ourselves and download it when the user first installs the app.. The problem with that though is we have to figure out our own methodology for upgrades.
Does anyone have experience with this or have any ideas what might be the best way to handle our situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您处于这种情况,我建议您从公司服务器托管 apk。
If you are in that situation I would recommend hosting the apk from your company server.
我最终通过将服务 apk 捆绑在我的应用程序的 /assets 文件夹下解决了这个问题。
您可以从该数据作为输入流读取并将其写入 SD 卡,然后您可以在其中启动安装 apk 的意图。用户所要做的就是单击“安装”(只要他们允许使用第 3 方应用程序,他们就会这么做,因为我们的应用程序也不在市场上。
因此,当应用程序首次启动时,我会检查该服务是否需要安装(或升级).. 该代码有点复杂,超出了我在这里所做的范围,因此我没有发布它,但如果我确定需要安装该服务,我会通过对话框提示用户。如果他们单击“确定”,我就会调用所示的 installService 方法 多于。
I ended up solving the issue by bundling the service apk under the /assets folder of my application.
You can read from that data as an inputstream and write it to sdcard where you can then launch the intent to have the apk installed. All the user has to do is click Install (as long as they have 3rd party apps allowed, which they will since our app is not in the market either.
So what happens is when the app first launches I check if the service needs to be installed (or upgraded).. That code is a bit more complex and outside the scope of what I'm doing here so I didn't post it. But if I determine the service needs to be installed I prompt the user with a dialog and if they click ok I then call the installService method shown above.