我正在开发一款新闻阅读类的Android应用程序。从这个应用程序中,用户可以在Facebook或Twitter上共享他喜欢的新闻链接。链接共享功能是通过addThis Android库提供的。现在,我想在发布链接时添加一个签名(例如:“分享自MyNewsReaderApp”)。但是没有添加签名字符串的选项。我不想将签名字符串附加到新闻描述中。请帮忙。
String fileName;
静态的位图变量bitmap; 私有的静态常量CAPTURE_REQUEST_CODE = 0;
/**
*
*/
Intent intent;
private void startCaptureActivity() {
intent = new Intent("biz.binarysolutions.signature.CAPTURE");
String keyFileName = "biz.binarysolutions.signature.FileName";
String keyTitle = "biz.binarysolutions.signature.Title";
String keyStrokeWidth = "biz.binarysolutions.signature.StrokeWidth";
String keyCrop = "biz.binarysolutions.signature.Crop";
String keyWidth = "biz.binarysolutions.signature.Width";
String keyHeight = "biz.binarysolutions.signature.Height";
fileName = Environment.getExternalStorageDirectory()+ "/imdad.png"; // set the file name (global write permissions)
//String title = "Imdad app"; // optional, default is set in AndroidManifest.xml
int strokeWidth = 10; // optional, default is 12
boolean crop = false; // optional, default is true
// allowed units: px, dp, dip, sp, pt, mm, in
String width = "600dip"; // optional, default is max
String height = "300dip"; // same as above
intent.putExtra(keyFileName, fileName);
//intent.putExtra(keyTitle, title);
intent.putExtra(keyStrokeWidth, strokeWidth);
intent.putExtra(keyCrop, crop);
intent.putExtra(keyWidth, width);
intent.putExtra(keyHeight, height);
//Log.v("FILE SAVE ",fileName);
Button done=new Button(this);
done.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
startActivityForResult(intent, CAPTURE_REQUEST_CODE);
}
});
// startActivityForResult(intent, CAPTURE_REQUEST_CODE);
}
这是添加签名应用和jar文件的代码,您可以从biz.binarysolutions购买。