我正在使用eclipse插件开发一个app-engine连接的android项目.该应用程序的一个方面是允许用户Alpha将图片发送给用户Bravo.为此,我有以下设置:
用户Alpha发布:
用户Bravo获得:
这个设置需要两(2)分钟,从我的Android应用程序发送图像到我可以在blob疼痛中看到它.不用说这是完全不可接受的.
我的服务器通过以下代码以编程方式处理图像:
public static BlobKey toBlobstore(Blob imageData) throws FileNotFoundException, FinalizationException, LockException, IOException {
if (null == imageData)
return null;
// Get a file service
FileService fileService = FileServiceFactory.getFileService();
// Create a new Blob file with mime-type "image/png"
AppEngineFile file = fileService.createNewBlobFile("image/jpeg");// png
// Open a channel to write to it
boolean lock = true;
FileWriteChannel writeChannel = fileService.openWriteChannel(file, lock);
// This time we write to the channel directly
writeChannel.write(ByteBuffer.wrap
(imageData.getBytes()));
// …Run Code Online (Sandbox Code Playgroud) google-app-engine android blobstore gae-eclipse-plugin google-cloud-endpoints
有人可以帮我澄清一下.我正在https://developers.google.com/appengine/docs/java/blobstore/overview上阅读有关blobstore的开发者页面.我似乎无法绕过保存和检索blob的过程?这听起来像
这是过程吗?也许是因为我度过了漫长的一天,但我却看不到它.如果某人有一个例子,他们不介意分享,请发布.我只需要在blobstore中保存android中的图像,然后能够使用blobkey或其他方式检索它们.
我已经看过了
对于我的生活,我不知道他们为什么不为我做这件事.
我想有些问题是:
Applications Overview,以我在数据存储区中的方式查看属于我的应用程序的所有blob吗?我想一个完整的,有效的代码可以帮助我看到这些答案.我的部分问题可能是我从未使用过servlet.我目前正在为我的api使用Google Cloud Endpoint.