Getting "503 Rate Limit Exceeded" from Xtify Push API - android

I'm sending push notifications through Xtify 1.3 API and at top loads receiving in response an HTML message instead of JSON:
<html><body><h1>503 Rate Limit Exceeded</h1></body></html>
Currently I'm sending the requests using 20-thread QUARTZ setup.
Could somebody help me figure out how to tune my API client to avoid looking as an attacker to the HTTP server or whatever part of the service is pushing me out?
Thanks, Alex

The limit is 5 simultaneous connections per IP as described at the bottom of this page:
http://developer.xtify.com/display/APIs/Push+API+2.0
You should either limit your concurrency to 5 or if you have access to multiple IP addresses you could just segment across them to stay within the limit.
However, it would probably just be easier just to reach out to Xtify and request that the limit be raised for your application.

Related

Software Design: Calculating distance to a location in Server or App?

I am new to mobile development and I undertook some freelance work. Now I am required to display a page with top N nearest places (businesses registered with us).
I am wondering what the best way of going about this is, from my experience it would seem that I would want to do this calculation in my back-end server.
I have a NodeJS server, however, it seems the server will be concurrently doing a lot of other work just verifying JWT tokens and what not, I have seen that android provides a method to easily do these calculations (Location). I have also read that there are some google API's one could use.
The idea I have is that I can pull my places with their lat, long from my database then the user sends lat,long and my server calculates top N results and sends to user.
What would you recommend and why?
Thanks!
The short answer is: Server.
But why?
The job of the server to make it so no one can use the app who is not authorized to do so. Thats one of many jobs anyway. However, you should send your location to the server, the server makes the API call, and returns the N closest locations.
You take that response, parse it, and fill in a view as you would like. With the server doing the heavy lifting, you can then also keeps track of something better, like how many calls, which calls, location of calls, etc etc.

Is it possible in GCM/FCM to get last activity or if the user is connected?

Am using GCM in my android project, the connection is XMPP, I wonder if there is a way to know if the user is currently connected from within the server service?
One way to do it is that I can send the user a ping and wait for a reply to see if he is connected but I was hoping for a better solution like to query GCM directly and it will tell you if the user is currently online or his last activity date.
I am trying to avoid using socket.io or signalr, because it will add load to the server specially if you have like half million users who are pinging the server regulary.
Thanks
The API you are looking for is not very well advertised, but it exist!
HEADERS: Authorization:key=SERVER-KEY
GET: https://iid.googleapis.com/iid/info/GCM-TOKEN?details=true
Full documentation here: https://developers.google.com/instance-id/reference/server

how to fix error "You have exceeded your daily request quota for this API" in xml file google maps?

i was try use this link to get direction "http://maps.googleapis.com/maps/api/directions/xml?origin=10.933952,106.863352&destination=10.9490721,106.8574901&sensor=false&units=metric&mode=wailing&metric=1" but today it not working
please help me!!
<DirectionsResponse>
<status>OVER_QUERY_LIMIT</status>
<error_message>
You have exceeded your daily request quota for this API.
</error_message>
</DirectionsResponse>
https://developers.google.com/maps/documentation/business/articles/usage_limits#limitexceeded
You can exceed the Google Maps API Web Services usage limits by:
Sending too many requests per day.
Sending requests too fast, i.e. too many requests per second.
Sending requests too fast for too long or otherwise abusing the web service.
Exceeding other usage limits, e.g. points per request in the Elevation API.
Upon receiving a response with status code OVER_QUERY_LIMIT, your application should determine which usage limit has been exceeded. This can be done by pausing for 2 seconds and resending the same request. If status code is still OVER_QUERY_LIMIT, your application is sending too many requests per day. Otherwise, your application is sending too many requests per second.

Check html for updates every 15 minutes

How do I check a html file on the internet if it has changed ? But it may not check the first 3 lines for the updates because it displays the time. The website does not use mysql or sqlite database. And is has not got a RSS feed system
Normally, you add this header line in the request:
If-Modified-Since: Sun Nov 6 08:49:37 1994
and then the server determines if the web page has changed since then, and return a 304 response if not. If the web page is generated by a CGI script, then it will be up to that script to decide if the page has changed.
Since you say the first three lines of the web page display the time, I assume the web page is generated by a CGI script of some sort. You haven't said what language that script is written in, but in any event, you'll need to grab the If-Modified-Since header from the request, parse the date, and decide if the content of the page has been modified since that date.
Does it have to be every 15 minutes? If what you're really looking for is notification every time an HTML page changes, you should look at Google Cloud Messaging (GCM). This system generates a notification that's sent to your app by a server.
GCM has advantages that may not be obvious. The biggest one is battery life; constant polling drains the device battery. In comparison, GCM messages are received instantly while the device is connected to the network but not actively sending. In addition, GCM messages are queued and combined, so when the device is offline and then comes back online only one message is sent.
GCM also ensures that your app only uses the network when it has to get data. This allows other apps to use the network more readily.

Game server for an android/iOS turn-based board-game

i'm currently programming an iPhone game and I would like to create an online multiplayer mode. In the future, this app will be port to Android devices, so I was wondering how to create the game-server ?
First at all, which language should I choose ? How to make a server able to communicate both with programs written in objective-c and Java ?
Then, how to effectively do it ? Is it good if I open a socket by client (there'll be 2) ? What kind of information should I send to the server ? to the clients ?
Thanks for your time.
EDIT How massively multiplayer'ed will you game be?
Hi Cyril,
as you noticed, there are two main things two consider:
information sent to the server
information sent to the client
There's only one type of information to sent to the server: the user inputs. If you don't do that, you'll encounter headaches over headaches when rogue client will try to send fake data to your server (like saying "My tank now has 100 000 000 armor").
Then what you sent to the client is up to you but it's totally possible to only sent to the client the other player(s)'s input. This is the way to have the absolute minimum and tinies bandwith usage possible. That is how games like Blizzard's Warcraft 3 are doing it. As a bonus, this makes for tiny replay files (because all you need to do to be able to replay a game is the time (and the input) at which each player's input happened).
The one downsides with sending only the other player's input to the client is that it means all the game's logic is present on every client. For some games, this may be an issue because people may cheat by reverse engineering your game and finding flaws. This issue can be mitigated with careful, controlled, randomization (where in addition to the input+time you send input+time+randomness where randomness cannot be guessed by the client in advance.
Another way to do it is to do some logic computation on the server side. Then, obviously, you need to send the result of the server computation to the client. Done correctly, this has the benefit of both preventing cheats and maky piracy impossible (for example nobody managed to play World of Warcraft in the real economy --that is, on the real Blizzard servers-- using a fake licence key).
Regarding the phone-turn-based game server: just look at one top-selling turn-based game are doing it. Take Uniwar for example: works on iPhone and Android. Game server is written in Java "of course".
The one thing to realize is that a game like the one you plan to write is entirely deterministic: if you can't easily code a replayer or if you can't easily reproduce any kind of scenario leading to a logic bug, you're doing it wrong.
Note that being determistic doesn't mean you can't add what looks like randomness to your players: it's simply that the randomness shall also be deterministic (for example by simply using a different seed for each game + the time at which player inputs are made as a fake random source).
This is a bit lateral solution to the question asked. One of your options is to use Gamooga (http://www.gamooga.com/) so you donot need to worry about the server side, the sockets, the transport logic etc. You can just concentrate on your game logic and just develop that than the required systems stuff.
Gamooga provides you with a realtime communication platform to be used in your games. You can upload your server side message processing scripts to Gamooga's cluster and use its iOS API with in your app to send and receive messages from/to the server side. The server side is auto scaled and managed for you by Gamooga. You can download the SDK and start off with the demos with in the SDK.
Disclosure: I am founder of Gamooga, replying only since its relevant to the question.

Categories

Resources