當前位置: 首頁>>代碼示例>>Java>>正文


Java BmobPay類代碼示例

本文整理匯總了Java中com.bmob.pay.tool.BmobPay的典型用法代碼示例。如果您正苦於以下問題:Java BmobPay類的具體用法?Java BmobPay怎麽用?Java BmobPay使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BmobPay類屬於com.bmob.pay.tool包,在下文中一共展示了BmobPay類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import com.bmob.pay.tool.BmobPay; //導入依賴的package包/類
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.about_us);
	submit = (Button) findViewById(R.id.submit);//six
	updatebtn = (Button) findViewById(R.id.update);
	pay = (Button) findViewById(R.id.buttononemonth);//one
	pay.setOnClickListener(this);
	submit.setOnClickListener(this);
	updatebtn.setOnClickListener(this);
	username = getIntent().getStringExtra("username");
	mContext=this;
	BmobPay.init(this, APPID);
	sharedPre = getSharedPreferences("config",MODE_PRIVATE);
	editor = sharedPre.edit();
	price_onemonth=8.0;
	price_sixmonth=30.0;
	text_one = "撥號授權-一月(8元)";
	text_six = "撥號授權-半年(30元)";
	
	//get product name and price
	init();
}
 
開發者ID:turingttc,項目名稱:newshanxun,代碼行數:23,代碼來源:AboutUs.java

示例2: onCreate

import com.bmob.pay.tool.BmobPay; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (savedInstanceState == null) {
        initData();
    }

    // 接受消息推送 廣播 數據 處理相應邏輯
    if (BROAD_RECEIVER_ACTION.equals(getIntent().getAction())) {
        Bundle bundle = getIntent().getBundleExtra(PushBroadcastReceiver.BROAD_DATA_KEY);
        String title = bundle.getString("title");
        Log.i(BROAD_RECEIVER_ACTION, title);
    }

    // 第三方SDK初始化
    AVInstallation.getCurrentInstallation().saveInBackground();
    PushService.setDefaultPushCallback(this, MainActivity_.class);
    FeedbackAgent agent = new FeedbackAgent(this);
    agent.sync();
    UmengUpdateAgent.update(this);
    BmobPay.init(this, Constants.BMOB_APPLICATION_ID);
}
 
開發者ID:AndroidCreativeDesign,項目名稱:AndroidSharingPlatform,代碼行數:23,代碼來源:MainActivity.java

示例3: onCreate

import com.bmob.pay.tool.BmobPay; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);
	L.e("width:" + ScreenUtils.getScreenHeight(this));
	requestWindowFeature(Window.FEATURE_NO_TITLE);
	setContentView(R.layout.activity_main);
	String currentUserId = UserServiceImpl.getCurrentUserId(this);
	if (currentUserId == null || "".equals(currentUserId))//是第一次啟動應用
	{
		gotoGuideActivity();
	}
	else
	{
		gotoLoginUI();
	}
	MyApplication.getInstance().addActivity(this);
	BmobPay.init(this, "d846b201d115d30761c967d88ebd773b");//bmob支付組件
}
 
開發者ID:ChenAt,項目名稱:Translation,代碼行數:20,代碼來源:MainActivity.java

示例4: succeed

import com.bmob.pay.tool.BmobPay; //導入依賴的package包/類
@Override
public void succeed()
{
	L.e("success");
	new BmobPay(TradeActivity.this).query(orderId, new OrderQueryListener()
	{
		@Override
		public void succeed(String status)
		{
			Toast.makeText(TradeActivity.this, "支付成功,獲得積分 " + RATE_POINT_RMB * price, Toast
					.LENGTH_SHORT).show();
			//更新本地存儲的積分
			String stringPoint = UserServiceImpl.getCurrentUserStringInfo
					(TradeActivity.this, "point");
			if (stringPoint != null && !"".equals(stringPoint))
			{
				int point = Integer.parseInt(stringPoint);
				int resultPoint = (int) (point + RATE_POINT_RMB * price);
				UserServiceImpl.setCurrentUserStringInfo(TradeActivity.this, "point",
						resultPoint + "");
				//更新textview
				tvBalance.setText(Html.fromHtml("用戶當前餘額:" + "<font color='blue'>" +
						resultPoint + "</font>"));
			}
			L.e("result point:" + UserServiceImpl.getCurrentUserStringInfo(TradeActivity
					.this, "point"));
			//將訂單號提交到服務器
			orderService.saveOrder(orderId, UserServiceImpl.getCurrentUserId(TradeActivity
					.this), price);
		}

		@Override
		public void fail(int i, String s)
		{
			Toast.makeText(TradeActivity.this, "異常," + i + ":" + s, Toast.LENGTH_SHORT)
					.show();
		}
	});
}
 
開發者ID:ChenAt,項目名稱:Translation,代碼行數:40,代碼來源:TradeActivity.java


注:本文中的com.bmob.pay.tool.BmobPay類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。