扩展android.app.Service并在c中实现android.content.ServiceConnection

时间:2012-12-06 00:31:48

标签: android c++

我正在开发一个多平台移动项目。我们使用c ++与Objective c混合或直接调用java函数(NDK)来实现这一点。我想保留这个成语,而不是编写任何java代码。

我想实施Google应用内结算,但结算服务需要从Android SDK扩展Service and Implements ServiceConnection。以下代码是否有效?

BillingService.h

#include "android/app/Service.hpp"
#include "android/content/ServiceConnect.hpp"

Class BillingService : public Service, public ServiceInterface
{
    virtual void android::content::ServiceConnection::onServiceDisconnected(local_ref<   android::content::ComponentName > const &a0) = 0;

    virtual void android::content::ServiceConnection::onServiceConnected(local_ref< android::content::ComponentName > const &a0, local_ref< android::os::IBinder > const &a1) = 0;

    virtual void void onCreate() = 0;

    // all other method in Service that need to be extends .... 
 }

0 个答案:

没有答案
相关问题