简体   繁体   English

建立一个SDK

[英]Building an SDK

I have a really simple app that uploads files to a remote server. 我有一个非常简单的应用程序,可以将文件上传到远程服务器。

I would like to build a SDK, so that external apps can also use the app to upload files. 我想构建一个SDK,以便外部应用程序也可以使用该应用程序上传文件。 I'm wondering what's the best thing to do for this SDK. 我想知道此SDK最好的方法是什么。

For now, the only thing I've found is to expose a Receiver with a "dangerous" permission in the main app (signature is not conceivable, because "client" apps does not have the same signature). 目前,我发现的唯一一件事就是在主应用程序中公开具有“危险”权限的Receiver(签名是不可想象的,因为“客户端”应用程序没有相同的签名)。

But I don't really like this solution, because apps without the sdk can also send Intent to the main app. 但是我真的不喜欢这种解决方案,因为没有SDK的应用程序也可以将Intent发送到主应用程序。

Do you have another solution for this kind of problem? 您是否有针对此类问题的另一种解决方案?

Thanks :) 谢谢 :)

It can look a bit complicated, but it sounds like you want to create a Service that other applications can bind to and use via an AIDL. 它看起来可能有点复杂,但是听起来您想创建一个服务,其他应用程序可以将其绑定并通过AIDL使用。 See the Android docs for a full explanation/example. 有关完整的说明/示例,请参见Android文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM