Using REST API for android apps integration with backend - android

I am working on an android app which needs to talk to the backend, securely. I plan to use the REST API. Is there a website which offers a good example code.

Related

Native Android Application for website without WebView

I need to build a Native Android Application for a Website that I have successfully developed. How do I go about this without using the webView. Someone talked about REST API But I don't just know how to go about it.
Although I have the Application in webView Version already but it is just still as the normal website mobile view. No Interactivity.
Your solution is REST API. Here is a good example.
How to create REST API for Android app using PHP, Slim and MySQL
Basically schema should looks like backend(all your data) - Rest Api (you must provide interface to your backend data with CRUD operation like PUT-DELETE-UPDATE-RETREIVE) - users for your Rest Api (mobile apps that would call this api to use data from backend)
For backend look at this tutorial to start https://www.youtube.com/watch?v=xkKcdK1u95s&list=PLqq-6Pq4lTTZh5U8RbdXq0WaYvZBz2rbn
For android app you should use Retrofit2 to facilitate RestApi calls.

Confused about Google App Engine and Google Cloud Endpoints

I am building my mobile apps (Android and iOS). I am not sure if I understand this correctly, but it seems Cloud Endpoints allow you to develop and deploy your own APIs, while App Engine assists you in building a server application? It seems App Engine also allows you to build a web application backend that exposes REST service APIs? So it can do whatever Cloud Endpoints can do? If I use Cloud Endpoints, can my APIs interact with some kind of DB? Is there anything I can do in App Engine but cannot do in Cloud Endpoints in the context of building a REST backend for mobile apps?
I understand this question is messy.. but Google does seems to have confusing documentations there. Thanks!
App Engine is just a compute platform on which Cloud Endpoints enabled apps can run. Cloud Endpoints provides frameworks which make writing a RESTful API easier (Java, Python), while also providing features to help you manage your APIs and access them from generated client libraries. You can use Cloud Endpoints in conjunction with a database of your choosing. The Cloud Endpoints frameworks previously linked essentially make it easy to map HTTP paths to methods, which do whatever you want.
Cloud Endpoints is basically just a framework to make REST APIs on GAE. This is the part you are looking for, "...developers can use services and features available in App Engine standard environment, such as Datastore, Google Cloud Storage, Mail, Url Fetch, Task Queues, and so forth."
So to answer your question, just use Cloud Endpoints if you making an API for your Android app, it's much easier.

Google Cloud Platform for Mobile App Confusion

I am new to android. I am confused about google cloud platform.My focus is on using android app for RESTful service.
Why do I need google cloud platform when I can use native android library to access RESTful web service like this.( I mean using JSON parsing with HTTPClient/Volley etc)
As far as I have understood that to implement google cloud service, I need an android client, a backend and others....( I m not sure). Why do I need this EXTRA stuff/coding when, as I said before, I can get RESTFul response with conventional way with sdk library.The implementation of Mobile Solutions on Google Cloud Platform is difficult and strenuous task.
What are the cases, when I HAVE to use google cloud platform, cant I do it other easy way?
As per zapl's comment, there really is no reason why you need to use Google Cloud Platform with Android. Nowhere in any of Google's docs does it mention that GCP is a requirement for an Android app. Cloud Platform is a service Google offers if you want to develop your own web applications or backends for mobile applications, but you are by no means locked into using this service.

Is it possible to use Amazon EC2 for Android syncing to cloud backend

I would like to provide syncing to cloud feature to an Android app.
I had read the tutorial at http://developer.android.com/training/cloudsync/index.html & http://android-developers.blogspot.com/2013/06/adding-backend-to-your-app-in-android.html
The examples being shown is using Google App Engine as backend storage.
I was wondering, is it possible not to tie to Google App Engine platform? For instance, using Amazon EC2?
Yes it is possible but you have to do more work on hosting a web service in EC2. Then your Android app will connect to it like this Android example. To write data instead of reading, use HTTP POST or PUT instead of GET. You would also have to implement your own user authentication.
Sure you can. Here's the Amazon AWS SDK for Android:
http://aws.amazon.com/sdkforandroid/
Yes, you will lose a little of the ease and integration of GAE, but you will gain something in flexibility. The GAE features (e.g. user authentication) tie you into Google's Android, making it harder to support Amazon or BB Android. And GAE limits you to their transactional HTTP model of communication.

Google Cloud Datastore access from Android

I'm trying to use Google Cloud datastore as remote data collector of a bunch of sensors, connected via an android Smartphone.
Firstly I'm trying to make it working in standard java.
The question is if it is possible to access Datastore directly from an android App of I need to build a GAE app that interact with the datastore.
I read for a while the documentation about the google api, but it is not really clear, how to use the Oauth 2.0 protocol.
Thank You all
You can use the oath2 support built into android as long as every user of the app is an admin of your google cloud project/app engine app. If you want to allow untrusted users to upload data, you would have to use your own endpoint and authentication strategy.

Categories

Resources