Tag Info

Hot answers tagged

3

If you need to pass only the URL, then pass only the URL. No need to over think it. There are several disadvantages of passing the whole object: the performance cost of json serialization and deserialization weaker encapsulation and weaker information hiding: the source fragment reveals more information to the other than necessary If you only need to ...


2

As amon said, this is theoretically possible with the addition of orientation/rotation sensors. In practice, it really depends on the accurracy required. The calculations are all integrals, so they tend to accumulate errors very fast. This means, the calculated endpoint of the circle in your example will be away from your origin, even if you carefully move ...


1

I think any programmer who does mobile or web app development should do server side work. As Jason already said, it should make better at what you do. But to me, a big reason to do it is so you can debug and fix your own issues. If all you ever do is client side work, then you are at the mercy of others to do the server-side work. You won't have a choice in ...


1

Rather than providing this as career advice, I will say that knowing both the client and server side in development to at least some degree makes you a better programmer because you can learn best practices on what to do and not to do in terms of performance, maintainability, standard approaches etc. Without learning the server side, a programmer is missing ...


1

Web Sockets are the better choice The problem with constant polling is that, much like sending small bursts of data (which it pretty much amounts to), your device goes into an 'idle' state that it has to 'wake up' from in between polls. There is a high cost associated with making the initial connection and this cost is repeated for every poll you perform. ...


1

There is no need to leave as service running to perform regular polling, and doing so may annoy your users, as it will consume memory for no good reason. You should look at the AlarmManager API. This has three potential advantages: it can be configured to send an Intent that will start your app in the background even if it is not running, meaning you ...


1

Create a runnable and call it with handler using postDelayed() method in your service. private final Handler handler = new Handler(); private Runnable getResponceAfterInterval = new Runnable() { public void run() { try { new RequestTask().execute("URL of your GET request"); //RequestTask() is a AsynchTask ...



Only top voted, non community-wiki answers of a minimum length are eligible