2013-03-28 208 views
3

我正嘗試在Android上使用AIDL創建遠程IPC服務。我發現了一些文檔,解釋瞭如何在Eclipse中創建這樣的服務,但沒有一個解釋了InteliJ IDEA的創建過程。Android Intellij IDEA 12 AIDL

我注意到的IntelliJ具有文件>新建>的Android組件>遠程接口裏面這個功能,我用它來創建一個名爲IRemoteService.aidl文件,其內容如下:

package MyApp.Android.RemoteServices; 
/** 
* Created with IntelliJ IDEA. 
* Máxima Sistemas de Informática S.A. 
* User: regis.oliveira 
* Date: 27/03/13 
* Time: 23:26 
* To change this template use File | Settings | File Templates. 
*/ 
/** Example service interface */ 
interface IRemoteService { 
    /** Request the process ID of this service, to do evil things with it. */ 
    int getPid(); 

    /** Demonstrates some basic types that you can use as parameters 
    * and return values in AIDL. 
    */ 
    void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, 
      double aDouble, String aString); 
} 

但是,當我嘗試編譯項目時,出現以下錯誤:

android-idl-compiler: D:\Docs\Programming\MyApp.Android.RemoteServices\IRemoteService.aidl:10 interface IRemoteService should be declared in a file called MyApp\Android\RemoteServices\IRemoteService.aidl. 

是否有人已經在實施的IntelliJ這個?是否有任何文件顯示如何使用此功能?

感謝

+0

我這樣做。工作正常。請分享一個示例項目來重現問題。 – CrazyCoder 2013-03-28 06:16:46

+0

Hi @CrazyCoder。經過一番嘗試之後,我意識到問題是由Eclipse導致的,與IntelliJ同時打開。所以,在關閉Eclipse並重新啓動IntelliJ之後,一切都按預期工作。 – regisxp 2013-04-01 11:22:13

回答

3

一些嘗試後,我意識到,這個問題是通過Eclipse中造成的,這是在同一時間打開的IntelliJ。所以,在關閉Eclipse並重新啓動IntelliJ之後,一切都按預期工作。