[英]Windows Azure Mobile Services first connection in Android
我的应用程序基于Windows Azure Mobil服务。 应用程序连接时间正常,但是在首次登录应用程序时,连接速度正常后,天蓝色的移动服务连接非常慢,大约10秒。 我怎么解决这个问题?
我的密码;
private MobileServiceClient mClient;
private MobileServiceTable<products> mProductsTable;
mClient = new MobileServiceClient(
"https://example.azure-mobile.net/",
"aaaaaaaaaaaaaaaaaaaaaaaa",
this).withFilter(new ProgressFilter());;
mProductsTable = mClient.getTable(products.class);
mProductsTable.where()
.execute(new TableQueryCallback<products>() {
public void onCompleted(List<products> result,
int count,
Exception exception,
ServiceFilterResponse response) {
if (exception == null) {
} else{
Toast.makeText(Product.this, "Ops!!! Error.", 1000).show();
}}
});
如果您的移动服务位于免费层,则当不访问它时,它可能会从内存中卸载并存储在磁盘中。 在这一点上,当请求到达服务时,首先需要将其“重新水化”为正在运行的进程以服务该请求。 这通常需要10-15秒,这很可能是你看到的延迟。 此后,服务运行后,后续请求将更快地响应(因为移动服务进程已启动并正在运行)。
请注意,如果你扩展你的服务付费层的一个(基本或标准),这不会再发生了:该服务将启动和运行的整个时间,随着时代的异常,当你改变你的服务(调动,更新脚本,更改应用程序设置等),这时也可以回收服务实例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.