5,605,835 Members 48,058 Now Online
XDA Developers Android and Mobile Development Forum

[Q] In-App-Billing

Tip us?
 
ueen
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 3
Join Date: Feb 2014
Exclamation [Q] In-App-Billing

Hello,
i've some issues to implement the in-app-billing system; here'S the code:

Code:
		 case R.id.item2:
		    new Thread(new Runnable() {
		        public void run() {
		        	ArrayList<String> skuList = new ArrayList<String> ();
		        	skuList.add("developersupported");
		        	Bundle querySkus = new Bundle();
		        	querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
		        	
		        	try {
						Bundle skuDetails = mService.getSkuDetails(3, 
								   getPackageName(), "inapp", querySkus);
						
						int response = skuDetails.getInt("RESPONSE_CODE");
						if (response == 0) {
						   ArrayList<String> responseList
						      = skuDetails.getStringArrayList("DETAILS_LIST");
						   
						   for (String thisResponse : responseList) {
						      JSONObject object = new JSONObject(thisResponse);
						      String sku = object.getString("productId");
						      String price = object.getString("price");
						      //if (sku.equals("sup")) mPremiumUpgradePrice = price;
						   }
						}

						
					} catch (RemoteException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					} catch (JSONException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
		        	
		        	
		        	
		        }
		    }).start();	
		   
			try {
				 Bundle buyIntentBundle = mService.getBuyIntent(3, getPackageName(),
							"developersupported", "inapp", "payed");
					
					PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
					
				startIntentSenderForResult(pendingIntent.getIntentSender(),
						   1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0),
						   Integer.valueOf(0));
			} catch (SendIntentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (RemoteException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
The code is from the documentaion "Implementing In-app Billing (IAB Version 3)".
the app conmects to google but the after loaing, theres this error like "your product wasnt found".
If the code correct? i set up an item in the developer console with the name "developersupported".
If you wanna try, the app is called "Clapperboard" in the Play Store
Thanks in advance!
ueen
 
boggartfly
Old
#2  
boggartfly's Avatar
Member
Thanks Meter 9
Posts: 51
Join Date: Dec 2011
Location: Mumbai

 
DONATE TO ME
Sometimes it takes a while for Google's servers to understand that you actually launched a new IAP item. What you can do is:-
1)Sign and export your apk and then upload it as draft . Using the same apk test it locally.
2)Also I recommend using the updated Billing v3 API. The previous v3 had some bugs and it hence has been fixed.
3)Wait and watch. You'll find the item in some hours....

I've had this experience with this.
Pls Give a thanks if this post helped you!

Sent from my Nexus 4 using XDA Premium 4 mobile app
The Following User Says Thank You to boggartfly For This Useful Post: [ Click to Expand ]
 
ueen
Old
#3  
Junior Member - OP
Thanks Meter 0
Posts: 3
Join Date: Feb 2014
Quote:
Originally Posted by boggartfly View Post
Sometimes it takes a while for Google's servers to understand that you actually launched a new IAP item. What you can do is:-
1)Sign and export your apk and then upload it as draft . Using the same apk test it locally.
2)Also I recommend using the updated Billing v3 API. The previous v3 had some bugs and it hence has been fixed.
3)Wait and watch. You'll find the item in some hours....

I've had this experience with this.
Pls Give a thanks if this post helped you!

Sent from my Nexus 4 using XDA Premium 4 mobile app
Well i waited over 12h and it still doesnt work.
whats that with the updated v3? I cant post links but if xou go to the devloper android page heres the path /google/play/billing/billing_integrate.html theres the code from.
Is the code correct?
I published the non app with the nonfunctionable in-app-billing and i really like to fix this fast! Please help!
 
boggartfly
Old
#4  
boggartfly's Avatar
Member
Thanks Meter 9
Posts: 51
Join Date: Dec 2011
Location: Mumbai

 
DONATE TO ME
Quote:
Originally Posted by ueen View Post
Hello,
i've some issues to implement the in-app-billing system; here'S the code:

Code:
		 case R.id.item2:
		    new Thread(new Runnable() {
		        public void run() {
		        	ArrayList<String> skuList = new ArrayList<String> ();
		        	skuList.add("developersupported");
		        	Bundle querySkus = new Bundle();
		        	querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
		        	
		        	try {
						Bundle skuDetails = mService.getSkuDetails(3, 
								   getPackageName(), "inapp", querySkus);
						
						int response = skuDetails.getInt("RESPONSE_CODE");
						if (response == 0) {
						   ArrayList<String> responseList
						      = skuDetails.getStringArrayList("DETAILS_LIST");
						   
						   for (String thisResponse : responseList) {
						      JSONObject object = new JSONObject(thisResponse);
						      String sku = object.getString("productId");
						      String price = object.getString("price");
						      //if (sku.equals("sup")) mPremiumUpgradePrice = price;
						   }
						}

						
					} catch (RemoteException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					} catch (JSONException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
		        	
		        	
		        	
		        }
		    }).start();	
		   
			try {
				 Bundle buyIntentBundle = mService.getBuyIntent(3, getPackageName(),
							"developersupported", "inapp", "payed");
					
					PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
					
				startIntentSenderForResult(pendingIntent.getIntentSender(),
						   1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0),
						   Integer.valueOf(0));
			} catch (SendIntentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (RemoteException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
The code is from the documentaion "Implementing In-app Billing (IAB Version 3)".
the app conmects to google but the after loaing, theres this error like "your product wasnt found".
If the code correct? i set up an item in the developer console with the name "developersupported".
If you wanna try, the app is called "Clapperboard" in the Play Store
Thanks in advance!
ueen
Use the samples available for In app billing . What you can do is extract code which is suitable and port it to where you want. Also copy relevant class files. Please also give credit to the original developer who wrote the code as it is kanging someone else's code..

That's the easiest way to get up and running. Don't worry about anything else buddy. Keep coding.
 
ueen
Old
#5  
Junior Member - OP
Thanks Meter 0
Posts: 3
Join Date: Feb 2014
ok i solved the issue by de installing the debug vrsion and installing the appstore version of my app.
thanks for your support.
btw: i used the samples from the google android documentation.
 
boggartfly
Old
#6  
boggartfly's Avatar
Member
Thanks Meter 9
Posts: 51
Join Date: Dec 2011
Location: Mumbai

 
DONATE TO ME
Quote:
Sometimes it takes a while for Google's servers to understand that you actually launched a new IAP item. What you can do is:-
1)Sign and export your apk and then upload it as draft . Using the same apk test it locally.
2)Also I recommend using the updated Billing v3 API. The previous v3 had some bugs and it hence has been fixed.
3)Wait and watch. You'll find the item in some hours....

I've had this experience with this.
Pls Give a thanks if this post helped you! 

Sent from my Nexus 4 using XDA Premium 4 mobile app
I told you. See point number 1.
Also do read the other documentation if necessary.

Please give a thanks if you think this post helped you!

Sent from my Nexus 4 using XDA Premium 4 Mobile App .
The Following User Says Thank You to boggartfly For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

UnbelovedHosts Uses Xposed to Block Unwanted Connections

First popularized by mvps, hosts-based ad blocking has become the de facto standard … more

March of the Droids 2014 Just Two Weeks Away; It’s Not Too Late to Register

If you want to attend an Android developers’ … more

Android App Review: Auto Config Free – XDA Developer TV

In this weeks episode of XDA Xposed Tuesday, we talked about customization of … more

Cloupload is a Beautiful and Fully Functional CloudApp Client for Android

If you’re a Mac OS X user who frequently uploads screenshots, … more