运行android应用程序内的计费示例应用程序

时间:2011-07-04 16:32:08

标签: android in-app-billing

这可能听起来很傻但我不知道如何使应用程序工作。

tutorial for in-app billing

就像教程说我下载了包,我找到了文件。问题是没有项目文件,我无法让它在eclipse中工作。

有人使用过示例应用吗?

2 个答案:

答案 0 :(得分:2)

我已成功使用它......似乎是什么问题?下载文件后,通过选择“Newn Android Project”,“Create project form existing sources”和“Finish”将项目导入Eclipse。从那里,按照有关更改包名称等的说明进行操作......

答案 1 :(得分:0)

据我所知,我通过Android SDK Manager下载的示例Dungeons应用内结算项目甚至没有编译(这似乎已修复,请参阅此消息后面的评论..)。< / p>

作为检查,我运行了一个find命令来搜索其中一个缺少的资源:

 /cygdrive/k/android-sdk-windows/extras/google/play_billing $ find . -name '*.xml' -exec grep edit_payload_title {} \; -print

        android:text="@string/edit_payload_title" />
   ./res/layout/edit_payload.xml

 /cygdrive/k/android-sdk-windows/extras/google/play_billing $

如您所见,资源@string_edit_payload_title被引用一次,但从未在任何xml文件中定义过。

    Description Resource    Path    Location    Type
    error: Error: No resource found that matches the given name (at 'background' with value '@color/screen_background').    item_row.xml    /Dungeons/res/layout    line 20 Android AAPT Problem
    error: Error: No resource found that matches the given name (at 'background' with value '@color/screen_background').    main.xml    /Dungeons/res/layout    line 20 Android AAPT Problem
    error: Error: No resource found that matches the given name (at 'prompt' with value                 '@string/select_item'). main.xml    /Dungeons/res/layout    line 52 Android AAPT Problem
    error: Error: No resource found that matches the given name (at 'text' with value '@string/buy').   main.xml    /Dungeons/res/layout    line 47 Android AAPT Problem
    error: Error: No resource found that matches the given name (at 'text' with value '@string/edit_payload_title').    edit_payload.xml    /Dungeons/res/layout    line 25 Android AAPT Problem
    error: Error: No resource found that matches the given name (at 'text' with value '@string/edit_payload').  main.xml    /Dungeons/res/layout    line 58 Android AAPT Problem
    error: Error: No resource found that matches the given name (at 'text' with value '@string/items_for_sale').    main.xml    /Dungeons/res/layout    line 34 Android AAPT Problem
    error: Error: No resource found that matches the given name (at 'text' with value '@string/items_you_own'). main.xml    /Dungeons/res/layout    line 64 Android AAPT Problem
    error: Error: No resource found that matches the given name (at 'text' with value '@string/recent_transactions').   main.xml    /Dungeons/res/layout    line 80 Android AAPT Problem
    error: Error: No resource found that matches the given name (at 'textColor' with value '@color/error_message'). main.xml    /Dungeons/res/layout    line 28 Android AAPT Problem

**更新**我刚刚再次下载它,似乎已经解决了。至少,它现在构建和部署..字符串定义现在似乎已经到位..

/cygdrive/k/android-sdk-windows/extras/google/play_billing $ find . -name '*.xml' -exec     grep edit_payload_title {} \; -print
        android:text="@string/edit_payload_title" />
./res/layout/edit_payload.xml
    <string name="edit_payload_title">Edit the developer payload associated with this purchase</string>
./res/values/strings.xml