在Android上使用的ServiceLoader [英] Using serviceloader on android

查看:1523
本文介绍了在Android上使用的ServiceLoader的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很新的Java和Android的发展和学习,我试图启动一个应用程序收集的统计数据和信息,如穆宁做。我想能够加载插件,在我的应用程序。这些插件已经在应用程序,但我不希望有单独调用它们,而是能够在它们之间迭代。我试图用的ServiceLoader但永远无法得到的META-INF /服务进我的apk。所以,我想知道是否有可能使用的ServiceLoader在Android 谢谢
编辑:我问java.util.ServiceLoader,我认为它应该,但我想不出如何让我的服务文件夹到META-INF的APK

I am very new to java and android development and to learn I am trying to start with an application to gather statistics and information like munin does. I am trying to be able to load "plugins" in my application. These plugins are already in the application but I don't want to have to invoke them all separately, but be able to iterate over them. I was trying to use serviceloader but could never get the META-INF/services into my apk. So I am wondering if it is possible to use serviceloader on android Thanks
I am asking about java.util.ServiceLoader, I think it should, but I can't figure out how to get my services folder into META-INF on the apk

推荐答案

有针对此问题的公开bug报告。请参见的https://$c$c.google.com/ P /安卓/问题/详细信息?ID = 59658

There is an open bug report against this issue. See https://code.google.com/p/android/issues/detail?id=59658

这篇关于在Android上使用的ServiceLoader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆