本文整理汇总了Java中org.bitcoinj.core.VersionMessage类的典型用法代码示例。如果您正苦于以下问题:Java VersionMessage类的具体用法?Java VersionMessage怎么用?Java VersionMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VersionMessage类属于org.bitcoinj.core包,在下文中一共展示了VersionMessage类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onBindViewHolder
import org.bitcoinj.core.VersionMessage; //导入依赖的package包/类
@Override
public void onBindViewHolder(final PeerViewHolder holder, final int position) {
final Peer peer = getItem(position);
final VersionMessage versionMessage = peer.getPeerVersionMessage();
final boolean isDownloading = peer.isDownloadData();
final InetAddress address = peer.getAddress().getAddr();
final String hostname = hostnames.get(address);
holder.ipView.setText(hostname != null ? hostname : address.getHostAddress());
final long bestHeight = peer.getBestHeight();
holder.heightView.setText(bestHeight > 0 ? bestHeight + " blocks" : null);
holder.heightView.setTypeface(isDownloading ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
holder.versionView.setText(versionMessage.subVer);
holder.versionView.setTypeface(isDownloading ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
holder.protocolView.setText("protocol: " + versionMessage.clientVersion);
holder.protocolView.setTypeface(isDownloading ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
final long pingTime = peer.getPingTime();
holder.pingView
.setText(pingTime < Long.MAX_VALUE ? getString(R.string.peer_list_row_ping_time, pingTime) : null);
holder.pingView.setTypeface(isDownloading ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
}
开发者ID:guodroid,项目名称:okwallet,代码行数:26,代码来源:PeerListFragment.java
示例2: onBindViewHolder
import org.bitcoinj.core.VersionMessage; //导入依赖的package包/类
@Override
public void onBindViewHolder(final PeerViewHolder holder, final int position)
{
final Peer peer = getItem(position);
final VersionMessage versionMessage = peer.getPeerVersionMessage();
final boolean isDownloading = peer.getDownloadData();
final InetAddress address = peer.getAddress().getAddr();
final String hostname = hostnames.get(address);
holder.ipView.setText(hostname != null ? hostname : address.getHostAddress());
final long bestHeight = peer.getBestHeight();
holder.heightView.setText(bestHeight > 0 ? bestHeight + " blocks" : null);
holder.heightView.setTypeface(isDownloading ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
holder.versionView.setText(versionMessage.subVer);
holder.versionView.setTypeface(isDownloading ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
holder.protocolView.setText("protocol: " + versionMessage.clientVersion);
holder.protocolView.setTypeface(isDownloading ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
final long pingTime = peer.getPingTime();
holder.pingView.setText(pingTime < Long.MAX_VALUE ? getString(R.string.peer_list_row_ping_time, pingTime) : null);
holder.pingView.setTypeface(isDownloading ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
}
开发者ID:soapboxsys,项目名称:ombuds-android,代码行数:26,代码来源:PeerListFragment.java
示例3: onCreate
import org.bitcoinj.core.VersionMessage; //导入依赖的package包/类
@Override
public void onCreate(final Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preference_about);
findPreference(KEY_ABOUT_VERSION).setSummary(application.packageInfo().versionName);
Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(Constants.MARKET_APP_URL, activity.getPackageName())));
if (packageManager.resolveActivity(marketIntent, 0) == null)
marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(Constants.WEBMARKET_APP_URL, activity.getPackageName())));
findPreference(KEY_ABOUT_MARKET_APP).setIntent(marketIntent);
findPreference(KEY_ABOUT_CREDITS_BITCOINJ).setTitle(getString(R.string.about_credits_bitcoinj_title, VersionMessage.BITCOINJ_VERSION));
}
开发者ID:soapboxsys,项目名称:ombuds-android,代码行数:15,代码来源:AboutFragment.java
示例4: httpUserAgent
import org.bitcoinj.core.VersionMessage; //导入依赖的package包/类
public static String httpUserAgent(final String versionName) {
final VersionMessage versionMessage = new VersionMessage(Constants.NETWORK_PARAMETERS, 0);
versionMessage.appendToSubVer(Constants.USER_AGENT, versionName, null);
return versionMessage.subVer;
}
开发者ID:guodroid,项目名称:okwallet,代码行数:6,代码来源:WalletApplication.java
示例5: httpUserAgent
import org.bitcoinj.core.VersionMessage; //导入依赖的package包/类
public static String httpUserAgent(final String versionName)
{
final VersionMessage versionMessage = new VersionMessage(Constants.NETWORK_PARAMETERS, 0);
versionMessage.appendToSubVer(Constants.USER_AGENT, versionName, null);
return versionMessage.subVer;
}
开发者ID:soapboxsys,项目名称:ombuds-android,代码行数:7,代码来源:WalletApplication.java
注:本文中的org.bitcoinj.core.VersionMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论