FORUMS

OnePlus Addresses Reservation List Cheating

Jake Cooper figured out how to bump his place up on OnePlus’ reservation list and … more

OnePlus 2 Benchmark Scores Show Its Muscle

This video by FoneArena contains all the popular benchmarks being tested on the OnePlus 2, … more

Sony’s Emergence in The Middle: Is The Price Right?

Sony’s Electronics Division is not in its best days, and its smartphone … more

HTC Delivering Ads Straight to Sense Home

HTC’s 2015 has been a year marked by a desperate search for revenue.The HTC One M9 … more

[Q] In-App-Billing

3 posts
Thanks Meter: 0
 
By ueen, Junior Member on 8th February 2014, 02:29 PM
Post Reply Subscribe to Thread Email Thread
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
 
 
8th February 2014, 06:33 PM |#2  
boggartfly's Avatar
Member
Flag Mumbai
Thanks Meter: 11
 
Donate to Me
More
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: [ View ]
9th February 2014, 08:58 AM |#3  
OP Junior Member
Thanks Meter: 0
 
More
Question
Quote:
Originally Posted by boggartfly

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!
9th February 2014, 10:28 AM |#4  
boggartfly's Avatar
Member
Flag Mumbai
Thanks Meter: 11
 
Donate to Me
More
Cool
Quote:
Originally Posted by ueen

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.
9th February 2014, 01:13 PM |#5  
OP Junior Member
Thanks Meter: 0
 
More
Thumbs up
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.
9th February 2014, 01:35 PM |#6  
boggartfly's Avatar
Member
Flag Mumbai
Thanks Meter: 11
 
Donate to Me
More
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: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes