• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java YambaClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.marakana.android.yamba.clientlib.YambaClient的典型用法代码示例。如果您正苦于以下问题:Java YambaClient类的具体用法?Java YambaClient怎么用?Java YambaClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



YambaClient类属于com.marakana.android.yamba.clientlib包,在下文中一共展示了YambaClient类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doInBackground

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
@Override
protected String doInBackground(String... params) {
	try {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(getActivity());
		String username = prefs.getString("username", "");
		String password = prefs.getString("password", "");

		YambaClient cloud = new YambaClient(username, password);
		cloud.postStatus(params[0]);

		Log.d(TAG, "Successfully posted to the cloud: " + params[0]);
		return "Successfully posted";
	} catch (Exception e) {
		Log.e(TAG, "Failed to post to the cloud", e);
		e.printStackTrace();
		return "Failed to post";
	}
}
 
开发者ID:fredyreyes,项目名称:Yamba1.2,代码行数:20,代码来源:StatusFragment.java


示例2: doInBackground

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
@Override
protected String doInBackground(String... params) {
	try {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(StatusActivity.this);
		String username = prefs.getString("username", "");
		String password = prefs.getString("password", "");

		YambaClient cloud = new YambaClient(username, password);
		cloud.postStatus(params[0]);

		Log.d(TAG, "Successfully posted to the cloud: " + params[0]);
		return "Successfully posted";
	} catch (Exception e) {
		Log.e(TAG, "Failed to post to the cloud", e);
		e.printStackTrace();
		return "Failed to post";
	}
}
 
开发者ID:learning-android,项目名称:Yamba-1,代码行数:20,代码来源:StatusActivity.java


示例3: getContent

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
private boolean getContent() {
	List<YambaClient.Status> timeline = null;
	
	try {
		timeline = yambaclient.getTimeline(20);
		
		int i = -1;
		content = new String[20];
		if(timeline != null) {
			for(YambaClient.Status status: timeline) {
				i++;
				content[i] = status.getMessage();
			}
		}
	} catch (Exception e) {}
	return timeline != null && !timeline.isEmpty();
}
 
开发者ID:thenewcircle,项目名称:learning-android-yamba,代码行数:18,代码来源:YambaWallpaper.java


示例4: doInBackground

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
@Override
protected String doInBackground(String... params) {
	try {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(getActivity());
		String username = prefs.getString("username", "");
		String password = prefs.getString("password", "");

		// Check that username and password are not empty
		// If empty, Toast a message to set login info and bounce to
		// SettingActivity
		// Hint: TextUtils.
		if (TextUtils.isEmpty(username) || TextUtils.isEmpty(password)) {
			getActivity().startActivity(
					new Intent(getActivity(), SettingsActivity.class));
			return "Please update your username and password";
		}

		YambaClient cloud = new YambaClient(username, password);
		cloud.postStatus(params[0]);

		Log.d(TAG, "Successfully posted to the cloud: " + params[0]);
		return "Successfully posted";
	} catch (Exception e) {
		Log.e(TAG, "Failed to post to the cloud", e);
		e.printStackTrace();
		return "Failed to post";
	}
}
 
开发者ID:fredyreyes,项目名称:Yamba1.3,代码行数:30,代码来源:StatusFragment.java


示例5: doInBackground

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
@Override
protected String doInBackground(String... params) {
	try {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(getActivity());
		String username = prefs.getString("username", "");
		String password = prefs.getString("password", "");

		// Check that username and password are not empty
		// If empty, Toast a message to set login info and bounce to
		// SettingActivity
		// Hint: TextUtils.
		if (TextUtils.isEmpty(username) || TextUtils.isEmpty(password)) {
			getActivity().startActivity(
					new Intent(getActivity(), SettingsActivity.class));
			return "Please update your username and password";
		}

		YambaClient cloud = new YambaClient(username, password);
		if (location != null) {
			cloud.postStatus(params[0], location.getLatitude(),
					location.getLongitude());
		} else {
			cloud.postStatus(params[0]);
		}

		Log.d(TAG, "Successfully posted to the cloud: " + params[0]);
		return "Successfully posted";
	} catch (Exception e) {
		Log.e(TAG, "Failed to post to the cloud", e);
		e.printStackTrace();
		return "Failed to post";
	}
}
 
开发者ID:learning-android,项目名称:Yamba,代码行数:35,代码来源:StatusFragment.java


示例6: onClick

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
@Override
public void onClick(View view) {
	String status = editStatus.getText().toString();
	Log.d(TAG, "onClicked with status: " + status);
	
	YambaClient yambaCloud = null; // ((StatusActivity) getActivity()).getYambaClient();
	
	YambaApplication yamba = ((YambaApplication) getActivity().getApplication());
	yambaCloud = yamba.getYambaClient();
	
	new PostTask(yambaCloud).execute(status);
}
 
开发者ID:thenewcircle,项目名称:learning-android-yamba,代码行数:13,代码来源:StatusFragment.java


示例7: doInBackground

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
@Override
protected String doInBackground(String... params) {
	YambaClient yambaCloud = new YambaClient("student", "password");
	try {
		yambaCloud.postStatus(params[0]);
		lastmsg = params[0];
		return "Successfully posted";
	} catch (YambaClientException e) {
		e.printStackTrace();
		return "Failed to post to yamba service";
	}
}
 
开发者ID:thenewcircle,项目名称:learning-android-yamba,代码行数:13,代码来源:StatusFragmentWDetails.java


示例8: doInBackground

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
@Override
protected String doInBackground(String... params) {
	YambaClient yambaCloud = new YambaClient("student", "password");
	try {
		yambaCloud.postStatus(params[0]);
		return "Successfully posted";
	} catch (YambaClientException e) {
		e.printStackTrace();
		return "Failed to post to yamba service";
	}
}
 
开发者ID:thenewcircle,项目名称:learning-android-yamba,代码行数:12,代码来源:OldStatusActivity.java


示例9: YambaWallpaperEngine

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
public YambaWallpaperEngine(YambaClient client) { 
   	yambaclient = client;
    paint = new Paint();
    paint.setColor(0xffffffff);
       paint.setAntiAlias(true);
       paint.setStrokeWidth(1);
       paint.setStrokeCap(Paint.Cap.SQUARE);
       paint.setStyle(Paint.Style.FILL);
    paint.setTextSize(40);
}
 
开发者ID:thenewcircle,项目名称:learning-android-yamba,代码行数:11,代码来源:YambaWallpaper.java


示例10: getYambaClient

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
public synchronized YambaClient getYambaClient() {
  if (this.yamba == null) {
    String username = this.prefs.getString("username", "student");
    String password = this.prefs.getString("password", "password");
    if (!TextUtils.isEmpty(username) && !TextUtils.isEmpty(password)) {
      this.yamba = new YambaClient(username, password);
    }
  }
  return this.yamba;
}
 
开发者ID:thenewcircle,项目名称:learning-android-yamba,代码行数:11,代码来源:YambaApplication.java


示例11: doInBackground

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
@Override
protected String doInBackground(String... params) {
	YambaClient yamba = new YambaClient("student","password");
	try {
		yamba.postStatus(params[0]);
		
		return "Successfully posted!";
	} catch (YambaClientException e) {
		Log.e(TAG, "Failed to post", e);
		e.printStackTrace();
		return "Failed to post";
	}
}
 
开发者ID:twitter-university,项目名称:oscon,代码行数:14,代码来源:StatusActivity.java


示例12: onHandleIntent

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
@Override
protected void onHandleIntent(Intent intent) {
	SharedPreferences prefs = PreferenceManager
			.getDefaultSharedPreferences(this);
	final String username = prefs.getString("username", "");
	final String password = prefs.getString("password", "");

	// Check that username and password are not empty
	if (TextUtils.isEmpty(username) || TextUtils.isEmpty(password)) {
		Toast.makeText(this, "Please update your username and password",
				Toast.LENGTH_LONG).show();
		return;
	}
	Log.d(TAG, "onStarted");

	ContentValues values = new ContentValues();

	YambaClient cloud = new YambaClient(username, password);
	try {
		int count = 0;
		List<Status> timeline = cloud.getTimeline(20);
		for (Status status : timeline) {
			values.clear();
			values.put(StatusContract.Column.ID, status.getId());
			values.put(StatusContract.Column.USER, status.getUser());
			values.put(StatusContract.Column.MESSAGE, status.getMessage());
			values.put(StatusContract.Column.CREATED_AT, status
					.getCreatedAt().getTime());

			Uri uri = getContentResolver().insert(
					StatusContract.CONTENT_URI, values);
			if (uri != null) {
				count++;
				Log.d(TAG,
						String.format("%s: %s", status.getUser(),
								status.getMessage()));
			}
		}

		if (count > 0) {
			sendBroadcast(new Intent(
					"com.marakana.android.yamba.action.NEW_STATUSES").putExtra(
					"count", count));
		}

	} catch (YambaClientException e) {
		Log.e(TAG, "Failed to fetch the timeline", e);
		e.printStackTrace();
	}

	return;
}
 
开发者ID:learning-android,项目名称:Yamba,代码行数:53,代码来源:RefreshService.java


示例13: PostTask

import com.marakana.android.yamba.clientlib.YambaClient; //导入依赖的package包/类
public PostTask(YambaClient client) {
	yambaCloud = client;
}
 
开发者ID:thenewcircle,项目名称:learning-android-yamba,代码行数:4,代码来源:StatusFragment.java



注:本文中的com.marakana.android.yamba.clientlib.YambaClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RowInputTextLog类代码示例发布时间:2022-05-23
下一篇:
Java ProjectFilterTransposeRule类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap