How to Disable Data Encryption on Nexus 6

In late September, Google decided to step on NSA’s toes and turn on encryption by default in … more

DJI Phantom 2 Vision+ Review – XDA TV

The holidays will be here in no time, so why not start thinking about gifts now? Youll be ahead … more

Mozilla Ditches Google, Makes Yahoo Default Search Engine

Mozilla and Google have had a long-standing relationship of about 10 years. Google … more

Learn More About Linux with Linux Man Pages

Linux is quite a powerful and very configurable operating system. Thanks to some user-friendly … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] In-App-Billing

OP ueen

8th February 2014, 03:29 PM   |  #1  
OP Junior Member
Thanks Meter: 0
 
3 posts
Join Date:Joined: Feb 2014
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, 07:33 PM   |  #2  
boggartfly's Avatar
Member
Flag Mumbai
Thanks Meter: 11
 
59 posts
Join Date:Joined: Dec 2011
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, 09:58 AM   |  #3  
OP Junior Member
Thanks Meter: 0
 
3 posts
Join Date:Joined: Feb 2014
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, 11:28 AM   |  #4  
boggartfly's Avatar
Member
Flag Mumbai
Thanks Meter: 11
 
59 posts
Join Date:Joined: Dec 2011
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, 02:13 PM   |  #5  
OP Junior Member
Thanks Meter: 0
 
3 posts
Join Date:Joined: Feb 2014
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, 02:35 PM   |  #6  
boggartfly's Avatar
Member
Flag Mumbai
Thanks Meter: 11
 
59 posts
Join Date:Joined: Dec 2011
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