从Android的外部JAR调用服务 [英] Calling a service from an External JAR in Android

查看:118
本文介绍了从Android的外部JAR调用服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图调用存储在外部JAR文件到我的Andr​​oid应用程序在Android的服务。当我在导入JAR,一切工作正常,除了服务。如果我手动复制服务文件放入包中,并给它一个新的名字,它的工作原理,而是由对骂同样的服务而不是当它存储在JAR。我已经包括包路径,以及调用服务时。任何帮助是极大的AP preciated。

I am trying to call an Android service which is stored in an external JAR file into my android application. When I import the JAR in, everything works fine except the service. If I manually copy the service file into the package and give it a new name, it works, but not when calling the same service by the name it's stored as in the JAR. I have included the package path as well when calling the service. Any help is greatly appreciated.

推荐答案

您将需要添加的服务宣言到您的清单,即使它被包含在一个外部罐子。

You will need to add the service declaration into your manifest even if it is contained in an external jar.

例如:

<service android:name="com.whatever.something.SomeService"/>

这篇关于从Android的外部JAR调用服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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