Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by HazeTI · Mar 07, 2012 at 09:54 AM · androidin-app-purchase

Difficulty with Android IMarketBillingService

Hello,

I've been trying to get in app purchasing on Android up and running and I'm running into a wall with the IMarketBillingService.aidl file supplied by Google. I can't get this file to auto generate a .java using Ant. (note: this part is solved, see Update & Update 2).

I tried using the .java file from the sample project supplied but I'm having difficulty importing it into my project to use. I got it working by changing the package name but that won't work as it must have the package name com.android.vending.billing otherwise you get a security exception when trying to use it.

Can anyone who has implemented Android in app purchasing with Unity offer some advice?

Thanks.

UPDATE:

The problem is almost certainly in the build.xml. I've implemented the Openfeint plugin so my build.xml is the same as the one that came with that. I can see how the original bild.xml in the sdk mentions .aidl files so I just need to modify my own to work.

I've added:

 <property name="android.platform.tools.dir" location="${sdk.dir}/platform-tools" />
 <property name="aidl" location="${android.platform.tools.dir}/aidl.exe" />

 <target name="-code-gen">
         <echo>----------</echo>
         <echo>Handling aidl files...</echo>
         <aidl executable="${aidl}" framework="${android.aidl}"
                 genFolder="${gen.absolute.dir}">
             <source path="${source.absolute.dir}"/>
         </aidl>
 </target>

But I'm not getting the error aidl: Cant' open preprocessed file: [...]Assets/Plugins/Android/${android.aidl}

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HazeTI · Mar 07, 2012 at 01:57 PM 0
Share

Update 2:

(side note: why can't I edit comments? I have to delete then add a new one?)

So I've managed to get the file auto-generating by manually pointing to the correct framework:

 <property name="android.aidl" location="${sdk.dir}/platforms/android-8/framework.aidl" />

Note nice but working, however I still can't import it as I get the error package com.android.vending.billing does not exist, even though the generated .java file has that package name and is located in /Assets/Plugins/Android/gen/com/android/vending/billing.

Any ideas?

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by HazeTI · Mar 08, 2012 at 12:16 AM

So I got in a state where everything compiles and I can now progress, although I'm not very happy with the solution.

I couldn't import any .java files from /Assets/Plugins/Android/gen/. (for some reason, I'm not sure why as I can perfectly fine in other non-unity projects) so I've had to change the build.xml to place the generated .java file in my source folder instead.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
3

Answer by maxgreen · Sep 22, 2012 at 04:31 PM

You should take a look at an open source project - http://project.soom.la. It's an in-app billing library for Android. You can either use the code as reference or you can just take the whole thing and use as a billing SDK. It makes Android billing, simple and more secure and it also has a sample app for reference.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HazeTI · Sep 24, 2012 at 08:36 AM 0
Share

Thanks for the link, looks very interesting.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is it possible to check the subscription status for Android? 0 Answers

Android IAP Cannot confirm purchase due to missing transaction id 3 Answers

Unity IAP Android No Pop up 1 Answer

my in-app purchase is not showing the files 3 Answers

The IAP service currently disabled - Unity Bug 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges