I m new to google cloud endpoint.I m using android studio-0.8.14. I made a new GCM End Point module with the default template.Then I added annotations for find method (which is by default NOT annotated)
我是google cloud endpoint的新手。我使用的是android studio-0.8.14。我使用默认模板创建了一个新的GCM End Point模块。然后我为find方法添加了注释(默认情况下没有注释)
@ApiMethod(name = "findDevice")
private RegistrationRecord findRecord(@Named("regId") String regId)
{
return ofy().load().type(RegistrationRecord.class).filter("regId", regId).first().now();
}
After rerunning this module,I dont get the new api for find in my api explorer.I tried rebuilding the project but no luck.I think I need to regenerate the end point library for client. Eclipse had such option but android studio doesnt have that.What if I make a entity model class and then add end point class for that all by myself, without using studio template code, will it show up in explorer?
重新运行这个模块后,我没有在我的api explorer中找到新的api for find。我尝试重建项目但没有运气。我想我需要为客户端重新生成终点库。 Eclipse有这样的选择但android工作室没有那个。如果我创建一个实体模型类然后自己添加端点类,而不使用工作室模板代码,它会出现在资源管理器中吗?
1 个解决方案
#1
0
At last I got it to work BUT after updating the android studio and using their NEW TEMPLATE for endpoint module. The module I created was created before the android studio update beta-0.8.14.That means there must be a bug. Normally a public endpoint method should be exposed to api explorer even if u dont annotate.But in my case it didnt with or without annotation. I did everything ,rebuilding the project, restarting the module backend etc but still no luck. Then I created another project and build anther module with A NEW module-building wizard, I found that the whole project structure changed A LOT...A LOT. Then I added a module (with and without annotation) which just showed up in the API explorer after restarting the backend module. Hence I think the problem must have been in the earlier module template code or somewhere else.
最后我让它工作但是在更新android studio并使用他们的NEW TEMPLATE用于端点模块之后。我创建的模块是在android studio更新beta-0.8.14之前创建的。这意味着必定存在错误。通常,公共端点方法应该暴露给api资源管理器,即使你没有注释。但在我的情况下它没有或没有注释。我做了一切,重建项目,重新启动模块后端等但仍然没有运气。然后我用一个新的模块构建向导创建了另一个项目并构建了另一个模块,我发现整个项目结构改变了很多......很多。然后我添加了一个模块(有和没有注释),它在重新启动后端模块后刚刚出现在API资源管理器中。因此,我认为问题必须出现在早期的模块模板代码中或其他地方。
#1
0
At last I got it to work BUT after updating the android studio and using their NEW TEMPLATE for endpoint module. The module I created was created before the android studio update beta-0.8.14.That means there must be a bug. Normally a public endpoint method should be exposed to api explorer even if u dont annotate.But in my case it didnt with or without annotation. I did everything ,rebuilding the project, restarting the module backend etc but still no luck. Then I created another project and build anther module with A NEW module-building wizard, I found that the whole project structure changed A LOT...A LOT. Then I added a module (with and without annotation) which just showed up in the API explorer after restarting the backend module. Hence I think the problem must have been in the earlier module template code or somewhere else.
最后我让它工作但是在更新android studio并使用他们的NEW TEMPLATE用于端点模块之后。我创建的模块是在android studio更新beta-0.8.14之前创建的。这意味着必定存在错误。通常,公共端点方法应该暴露给api资源管理器,即使你没有注释。但在我的情况下它没有或没有注释。我做了一切,重建项目,重新启动模块后端等但仍然没有运气。然后我用一个新的模块构建向导创建了另一个项目并构建了另一个模块,我发现整个项目结构改变了很多......很多。然后我添加了一个模块(有和没有注释),它在重新启动后端模块后刚刚出现在API资源管理器中。因此,我认为问题必须出现在早期的模块模板代码中或其他地方。