How do most android applications retrieve data from a database server? - android

I am currently working on an application which is a small applications for businesses to list their promotions on my website. I have created this in ASP.NET and I'm using a REST-like interface for my website in the back-end. I'd like to now also introduce an android application. I've noticed there are things like windows azure mobile services out there which let you easily create and integrate data services to mobile applications. My question is should I use the same interface as my website or is there a conversion people use in the commercial space.
Thanks for your help :)

I do not have any experience with windows azure mobile services but I have many experience in writing APIs for different front ends (mobile/win/web/widgets) and never heart about any conventions/conversions in commercial space.
My advice is. If you need to push data to mobile application use some service that can do it or write yours. If you are going to write push notifications service you will need server to run it.
If the application will only pull data from server or push to it than better use same REST-like interface you already have. It can to avoid code duplication and will create some data exchange standard between you front ends and back end.
Hope it will help you.

Related

How does a geolocator work?

I need to develop an Android app which is basically a geolocator, allowing people to reach each other via Google maps. All being said, I don't know how do I accomplish such thing since I don't know how it does work and if I need a server or database on the way. I'd be grateful if anyone could shed some light on this topic.
As you said you will need Android application and Server through which Android clients will communicate.
Android Application
will be getting data of other Android devices from server and then showing those data on the screen
will be periodically sending own location to the server
Server
is responsible for storing geolocation of Android clients, data can be stored in some database or memory of the server, depends on the use case, how long you need to have those data, how important they are, etc.
is responsible for sending stored geolocation data to Android clients
you have various options, you can write your own server in whatever technology you wish - it can be PHP server, NodeJS server, Java server... or you will use some serverless solution. Check for example
https://firebase.google.com
has to be hosted somewhere, you have many options:
there are "traditional" hosting providers, where you are usually limited by technologies you can use, for example you can just use PHP or you will use products from Heroku or Amazon AWS.. there is more, Microsoft has Microsoft Azure or Redhat has Openshift.. There are differences in prices, services, etc., it is up to you to look and decide what is the best for you.
I for sure missed lot of things. It is not in my power to describe every possible corner case because the question is too broad but rather provide you with higher overview of the problem and possibly point you where to go next. I suggest to you to read more about problematic and then get back with more specific issues to solve.

How to set up a server for android app?

I am trying to create an android application in which an user will pretty save some data in database-like user data, photos and also be able to retrieve.
But I am clueless how to set up a server, connect to some database etc.
Can somebody help me point to right resources for end-to-end installation of server, database, and its interaction with the android application
Just set up a basic server that works over HTTP, and use HTTP libraries for android to make requests and handle results in the device. There are plenty of technologies with which you could make the server, just google building REST API with PHP/.net/java (whichever language you are comfortable with).
If you are mobile app developer and want to create server-client app then better use any back-end service rather than implementing new by own. Some most advanced and simple to use services are Parse and Firebase , BaasBox also there are many more.
And the plus point is this services free of cost until you have very large users.

Send data from web browser to android app

I am working on an home automation system my android application can turn lights on and off using bluetooth, i want to add another feature of controlling the devices from webpage.
Can anyone tell me what is the easiest way to do this, i know GCM(Google Cloud Messaging) is the best solution but is there any other better or easy way of doing it.
And if anyone has some working piece of code, please share it with me; I want to finish this project as soon as possible
If you have a backend built using PHP, Rails etc you can have API's that the app can call and check for instructions. However, this has the side effect of draining he battery due to continous polling.
If you don't wanna go the "polling the server periodically" way, you can use GCM as you mentioned.
You can send data using the JSON data format. This is easily the lighest and most versatile data format used by many web and android apps and has tremendous support from third party libraries as well.
Here are some tutorials for this:
http://developer.android.com/guide/google/gcm/demo.html
http://android.amolgupta.in/2012/07/google-cloud-messaging-gcm-tutorial.html
http://www.londatiga.net/featured-articles/how-to-send-message-to-google-cloud-messaging-gcm-server-using-json-and-php/
http://fundroiding.wordpress.com/2012/06/29/google-cloud-messaging-for-android-gcm-simple-tutorial/
http://androidjayavelu.blogspot.in/2012/07/google-cloud-messaging-gcm-tutorial_27.html

Mobile Development and Cloud Database, Where Should I Start?

I am an Android Developer and a noob when it comes to web technologies.
I am planning to create an Android app that stores its data to a database.
I do not want to maintain my own server so I guess I would be resorting to Cloud Services.
The thing is I do not know where to start.
What do I need to be able to access and store data to a cloud database from my Android app?
Where can I get a cloud database preferably for free.
Do I need to use web services?
Any help
There are a few things in this that make me ask questions, as opposed to answer them.
Do you mean for your application to be always able to communicate with the database, or will it be more of a backup/sync with a database you have on your handheld.
If you do intended the app to be live all the time, then just write a web app and construct it with small screens in mind. It would be faster and sort of cross platform.
If you intend to have the app just sync with a back-end.. Well then a simple web service should do you for storage. Yep. Rails would be the way to go.
It really depends on your users.. How will they be using the app? Where will they be?
Personally I like the stand alone application that just sync's with the back-end. It is less prone to crashing because I walked into a tunnel. It also lets me control when and where I am when I sync. But it means the data I'm looking at could be out of date. And the data I'm adding isn't right there for others to consume.. they have to wait for me to sync'.
Check out Amazon's AWS and their SDK for Android. Highly recommended.
I assume that you know Java and my solution would be GWT/GAE ,since you asked for web application,GWT https://developers.google.com/web-toolkit/ would be perfect way and also you could use Google AppEngine Store as Cloud service and also you can integrate GWT with Phonegap to run it in Android.

Server for mobile and web applications

I'm planning on constructing a large application. It will have a browser based interface along with a mobile application interface (iOS, Android, blackberry).
I would like to be able to push data from the server onto these interfaces, and there will be a lot of data being sent from the mobile apps back to the server. So my question is what kind of server am I looking to build.
I'm a PHP developer mainly, though I can write in Java and have dabbled in others. I'm fine with learning a new language. My thoughts as a PHP developer is that I could just build a PHP application and use it's API to power the other interfaces.
However there will be a lot of data moving around and I don't feel like PHP would be the best base for this really. So I'm exploring alternatives. Any thoughts on where to start with this?
you can use a framework like Rhomobile's Rhodes that generates your browser based clients and they also offer a server component: http://rhomobile.com/products/rhosync/
Common practice would be to separate out the backend functionality between different servers.
Server 1: serve up your static content
Server 2: serve up your dynamically generated content (things based on queries that require IO such as DB interaction
Server 3: dedicated realtime infrastructure for the realtime push functionality
Server 1 & 2 could probably be the same server for now but I'd recommend having a dedicated realtime server. Communication between servers is normally done with some sort of message queue although web service calls are also an option.
My area of interest is realtime push so here's a bit more information on that. If you want to stick with PHP there's the phpwebsocket project. If you want to look at Java then there's [WaterSpout}(http://www.spoutserver.com/), jwebsocket and Jetty which has been around for a while and is (or was the last time I checked) used by the Twitter Streaming API.
There are more options for the realtime component of your solution on this Realtime technologies guide which I'm maintaining.

Categories

Resources