当前位置: 首页>>代码示例>>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;未经允许,请勿转载。