2015-09-02 21 views
0

我已經做了應用程式內購買我的app.Now我需要對其執行也有我我中有我的應用程序ID編譯我的項目時測試,我試圖執行應用程式內它這樣表示是否有可能在編譯應用程序時檢查應用程序內購買,或只有在創建簽名的apk後才能檢查它?

"This version of the application is not configured for billing through Google Play. Check the help center for more information". 
錯誤信息

現在我需要知道如何解決它?以及在購買應用程序時需要遵循哪些方法? 需要你的建議朋友 預先感謝您

這裏是我的片段?這是不是在低版本的Android

import android.content.Intent; 
import android.content.SharedPreferences; 
import android.content.res.Configuration; 
import android.net.Uri; 
import android.os.Bundle; 
import android.preference.PreferenceManager; 
import android.support.v4.app.Fragment; 
import android.view.LayoutInflater; 
import android.view.View; 
import android.view.View.OnClickListener; 
import android.view.ViewGroup; 
import android.widget.ImageView; 
import android.widget.RelativeLayout; 

import com.google.android.gms.ads.AdRequest; 
import com.google.android.gms.ads.AdView; 

public class Fragadmob extends Fragment { 
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container, 
      Bundle savedInstanceState) { 

     View rootView = inflater.inflate(R.layout.fragadmob, container, false); 

     //Admob   
     RelativeLayout gonad=(RelativeLayout)rootView.findViewById(R.id.adview153613); 
     ImageView addviewimage=(ImageView)rootView.findViewById(R.id.addviewimage); 
     ImageView inap=(ImageView)rootView.findViewById(R.id.addviewimage1); 

     // AdView adView = new AdView(getActivity()); 
      AdView adView = (AdView)rootView.findViewById(R.id.adView); 
      AdRequest adRequest = new AdRequest.Builder() 
       .build(); 
      adView.loadAd(adRequest); 
     addviewimage.setOnClickListener(new OnClickListener(){ 

      @Override 
      public void onClick(View v) { 
       // TODO Auto-generated method stub 
       Intent viewIntent = 
          new Intent("android.intent.action.VIEW", 
          Uri.parse("https://play.google.com/store/apps/developer?id=SentientIT+America,+LLC")); 
          startActivity(viewIntent);     

      } 

     }); 
     inap.setOnClickListener(new OnClickListener(){ 

       @Override 
       public void onClick(View v) { 
        // TODO Auto-generated method stub 
        Intent intent = new Intent(getActivity(),Inapp.class); 
        startActivity(intent);   

       } 

      }); 

      if(addviewimage.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) 
      {    
      addviewimage.getLayoutParams().height = 30;      
       // code to do for Portrait Mode 
      } 
      SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); 
      boolean isPurchase = preferences.getBoolean("isPurchase",false); 
    if(isPurchase){ 

     gonad.setVisibility(View.GONE); //work 
    } 
     return rootView; 
    } 


} 

回答

1

工作你需要發佈Alpha測試版使用簽名的APK到谷歌播放或者您也可以測試靜態響應(https://developer.android.com/google/play/billing/billing_testing.html#billing-testing-static

+0

謝謝您的建議晶圓廠。我有一個更多的問題看到下一個coment –

+0

在我的應用程序中,我已經包括添加mob的fragment.I所有其他XML文件中調用該片段。在運行應用程序時,我得到錯誤但在棒棒糖它運行良好它不顯示任何錯誤。如果我刪除它在所有Android版本運行的片段。這是我的應用程序中的問題 –

0

是的,只有在簽署APK並上傳到Google Play商店後,才能在應用中測試inApp購買商品。 因此根據需要添加項目到playstore。 然後找到他們在你的應用程序sku的細節,不要發佈apk測試在Google Play商店的測試模式,像alpha測試。

感謝

瞭解更多詳情: http://developer.android.com/google/play/billing/billing_reference.html http://developer.android.com/training/in-app-billing/list-iab-products.html

+0

謝謝androider後上傳它到商店我會檢查它。我有在我的應用程序中有一個問題。看下一個評論 –

+0

在我的應用程序中,我已經包括在片段中添加mob。我在所有其他xml文件中調用了該片段。在運行該應用程序時出現錯誤但是在棒棒糖中它運行良好,不顯示任何錯誤。如果我刪除它在所有Android版本中運行的片段。這是我的應用程序中的問題。告訴我可能的解決方法 –

+0

admob很容易編碼,併爲每個版本使用相同的代碼,結帳你的片段代碼 – Androider

0

最後我得到一個明確的solution.We只能在Play商店中上傳我們的應用程序的測試版本後,可以檢查在應用程序內購買我們的應用程序。在測試版中,我們不會針對應用內購買的測試收費。

相關問題