Some advice comrades, am thinking of developing an android app that retrieves some updates from a website. In other words when content of the website is updated the app content is also updated. I have searched google and i can't get clear answers on how to do it. Anyone tell me what do i need to do to accomplish this task. I have read about json parsing and web services but everything is not clear since am new to network apps.
If your server is a standard http server, you'll need another server that can establish a connection with the android device.
You can implement it yourself (using TCP or UDP), or you can use the trusted Google GCM:
https://developer.android.com/google/gcm/index.html
I recommend using GCM, but in either way, you'll have to make your current server, to notify the other server when it needs to send a message to any device.
Related
I am building an android application that communicates to a remote server, this fetches data from the remote server database as well as transfer information from the android app to the server database. I actually establish the connection between the remote server and the android app using the httpClient with json, php and mysql functions.
This idea works very well, buh after testing the system for some time, I realised the app takes a bit longer in connecting to the server although I use the async task class to work on the background and also use a very fast internet access.
The main aim, is to make the application very fast in connecting to the remote servers.
MY QUESTION
Is there a better way I can make the application establish or faster in connecting to the remote servers. I would be very grateful for any idea or better still links to read more about it. Thanks in advance.
Use the Volley library. It is very fast for accessing the data from server developed by google team.
Their are some example you can see in below links.
visit:
Click here
I am building android app that connects to an API.
The problem I am running into is the following: the API doesn't let me do more than one request per second, and if I have more than one person doing the search at the same time they might shut down my account.
I am looking how to create a server that is supposed to: 1. control the traffic (whenever needed, wait the necessary time), and 2. simply forward the request.
Any ideas on how to proceed?
you can get a server from goddady.com and connect your application with the server using a page php and api parsing json like Volley
Is it possible for a device to send message to other devices using Google cloud messaging without an app server at all?
I have a centralized database using Google Cloud Datastore. The app will get required registration ids from the centralized database and the database is updated by all the devices. So, getting registration ids is not a problem.
Can this be done using upstream messaging? I am not sure because i have searched a lot but never saw an example where app server is not used for this purpose.
This question is not duplicate of another question, because here i have central database to store registration ids which is mentioned as a problem in another question.
In the most basic sense no, not at this time. You cannot send an upstream message from one device to another without an app server. You can create an app server on your device application but that is not recommended. The current recommendation would be to use an app server to facilitate your device to device messages.
To answer is it possible? Yes it is.
Sometime back I have created a POC to send GCM message to self, so I know its very much possible. I configured my GCM to work with any ip in developer console i.e. 0.0.0.0.
just use HTTP post to send your message from android as you would have done from Server.
Like (most) everything else, there is an API for that.
Google hosts its GCM service on GCM Connection Servers. The official document requires you to create an App Server to issue the API requests to the Connection Servers.
Alternatively you could setup the Connection Server to accept requests from any IP around the world, and then issue the requests via your client app. The API is here and it's quite simple.
Seurity issues
Bundling your API key with your app, and setting the Connection Server to unrestricted connections is an obvious major security issue.
Why bother?
Why bother doing all of this? Instead I would use a free service like Parse.com, which takes care of the users database and offers up to 1000000 messages a month free.
Has anyone actually done this. I would like to see example android project.
I'm thinking develop android application,Where is s/he?.
If client 'A' request location of client 'B',Server connect client 'B' and get gps location of client 'B' and server response to client 'A'
Application should work in background but should not force hard to mobile device.
There should be no trafic between client and server if there is no request. Traffic should be if there is request.
Like Skype or whatsup,you can connect client everytime you call or sending message If client is on internet so that my application should work if both users on internet. İf requested client is not on internet then application should send latest known position.
For these porpose,Which protocal should I use? Http(I think no),TCP ,XMPP or android bound service implement my methodlgy?
How do I implement my applcations methods?
thanks
I do not want to offend you, but I think you should start with the fundamentals of android development and distributed systems.
However, here is my answer:
You could use HTTP, but better use HTTPS to be sure, that data is encrypted between the server and the client.
If I were going to create such an app, I'd write a small application on the android device which transmits the position of the device, together with a unique id of the device (probably the IMEI) to a server, encoded in a HTTP(S) request.
Using HTTP would have the benefit, that you could use many different languages on server side, for example PHP (would be my choice, but you could use others).
On the server side you would need to put the recieved data into a database or some other storage.
From there it is your choice what you are going to do and how to present the data. Maybe making a small website?
Regards
Me
I have go through several posts in the internet but did not get a straight and clear answer for this.
I am doing one app on android which needs data to be sent/received from a database over internet. So how I can send/receive messages from my remote database on my android device?
Is there any messaging framework available currently in the android to do this type of task?
One method I thought of is to have PHP scripts at my web server and I will call those php scripts from my android httpClient. But its a bit tire some and error checking also a bit problem and retry mechanism also not there.
Please suggest a good way.
Google have a service for that.
Google Cloud Messaging for Android
Google Cloud Messaging may be suitable just for sending push notifications to android devices and things like that. And XMPP could be used to send messages from one android to another. So what you have taken, using a PHP script and calling it using a URLConnection or HTTPConnection is a better way to make transaction with a remote database