Building an Android Application with Google App Engine

64 views
Skip to first unread message

Joe Seph

unread,
May 30, 2015, 10:57:20 AM5/30/15
to google-a...@googlegroups.com

Hello guys,

so currently, we are building a mobile  social network application where users will be able to upload and view Pictures and Musics files.
we have 2 scenarios in order to implement the GAE with our android application and backend control panel. 
- First scenario is to implement the GAE PHP with our application backend and let the backend handle all the APIS requests from the mobile side and handle them with the GAE but for in case i need to upload a certain image to the GAE I will need to encode the image to base64 and decode it on the server and then upload it into the GAE and then wait until the upload process finishes and return the Reference to the backend then update the status on the mobile side as you can notice this scenario will cost me a lot of time and the quality of the image will be dropped due to encoding and decoding .


- Second scenario is to implement the GAE Directly to the android side and let it upload files(Jpg,mp3) directly to the GAE (No need for Base64) and then send the references from GAE to the mobile side in order to be sent to Backend to be saved in the database .

I'm not sure if the GAE works with android to achieve the second scenario as it will be best solution which will decrease time and will bypass decoding and encoding Process. 

so what do you guys think about the above solutions and what is the best optimized and efficient solution in your opinion?

thanks ,

Karl MacMillan

unread,
May 30, 2015, 10:11:48 PM5/30/15
to google-a...@googlegroups.com, google-a...@googlegroups.com

On May 30, 2015, at 10:57 AM, Joe Seph <josep...@gmail.com> wrote:

Hello guys,

so currently, we are building a mobile  social network application where users will be able to upload and view Pictures and Musics files.
we have 2 scenarios in order to implement the GAE with our android application and backend control panel. 
- First scenario is to implement the GAE PHP with our application backend and let the backend handle all the APIS requests from the mobile side and handle them with the GAE but for in case i need to upload a certain image to the GAE I will need to encode the image to base64 and decode it on the server and then upload it into the GAE and then wait until the upload process finishes and return the Reference to the backend then update the status on the mobile side

I’m a little confused about what you mean by GAE and how that might be different from the PHP backend. I’m getting a sense that you mean something specific here but are using the terms in a different way than is usually used, which is making it hard to answer your question.

I also wonder if you are making this harder than it needs to be. A typical approach that people use for uploading data is to simply expose a HTTP endpoint that the mobile application can POST to with the image data (perhaps as multipart form data) and then if they need to return some sort of handle or metadata they simply do that in the response. It’s only one round-trip then.

If you are running PHP on Google App Engine, the handler for that HTTP endpoint can then put the data wherever. I would suggest storing it in Google Cloud Storage and, if helpful, storing some meta-data about the data in the Datastore.

as you can notice this scenario will cost me a lot of time and the quality of the image will be dropped due to encoding and decoding .


I’m a little confused about the concern over image quality. Base64 encoding does not impact image quality - it is simply an encoding of binary data and is lossless (http://en.wikipedia.org/wiki/Base64).

I hope this helps - again, it’s a little hard to understand your question or concerns. If I could suggest, it might help if you spend a little more time with the App Engine documentation. That might help you answer your own questions and it will likely help you ask questions using the terminology from the documentation, making it easier for others to help you.

Karl
Reply all
Reply to author
Forward
0 new messages