19 May 2014 Android has often more than one way of doing something but it is not because of a poor design, rather because of the many possibilities that are available to Android developer and it is important to understand the nuances between various options to achieve something and choose the right tool for the job.
Let's look at services:
IntentService vs. Service
When to use?
- The Service can be used in tasks with no UI, but shouldn't be too long. If you need to perform long tasks, you must use threads within Service.
- The IntentService can be used in long tasks usually with no communication to Main Thread. If communication is required, can use Main Thread handler or broadcast intents. Another case of use is when callbacks are needed (Intent triggered tasks).
How to trigger?
- The Service is triggered calling to method onStartService().
- The IntentService is triggered using an Intent, it spawns a new worker thread and the method onHandleIntent() is called on this thread.
Triggered From
- The Service may be triggered from any thread.
- The IntentService must be triggered from Main Thread.
Runs On
- The Service runs in background but it runs on the Main Thread of the application.
- The IntentService runs on a separate worker thread.
Limitations / Drawbacks
- The Service may block the Main Thread of the application.
- The IntentService cannot run tasks in parallel. Hence all the consecutive intents will go into the message queue for the worker thread and will execute sequentially.
07 May 2014 You can follow the official directions here
Or you can just use AppCleaner and drag the Plex Media Server app from the Applications folder and the AppCleaner will remove all the same files and folders for you in an instant!
05 May 2014 This is how to load custom font and set it as a typeface for a TextView
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "CUSTOM_FONT.ttf");
txt.setTypeface(font);
04 Apr 2014
You'll always be able to make more money but you can not make more time. We'll all die but only a small select few are truly living
A truly inspirational video. It really made me want to sail around the world.
27 Mar 2014 Frustrated with flaky settings on Mavericks for energy savings? Puts your stuff to sleep when you don't want to and doesn't put it to sleep when you do?
pmset
comes to the rescue
I used the following command:
sudo pmset displaysleep 10 sleep 0
since I want my displays to go to sleep after 10 minutes and the computer never go to sleep.
To specify behavior for when on battery power use the -b
switch e.g.
sudo pmset -b displaysleep 5 sleep 15
to put your display to sleep after 5 minutes of idling and your computer after 15 minutes of idling.
10 Mar 2014 Evernote seems to be great tool for note taking and keeping pretty much everything you want organized. I used to use a wiki but recently I decided to give Evernote a second or third or fourth try. I am not sure what the number here is but this is the first time it actually clicked with me and I think I am actually going to use it instead of my wiki and switch to it completely. They just didn't have the the ecosystem in place when I tried it the first X times. Now they cover almost every platform and the support on the desktop is just great!
There are some limitations for every account be it a free account or premium or even business account. When I first thought about the limitations I thought - that sucks... But then I thought - hey, let's put this in perspective and see how "real" these limitations are.
So the limits are:
Number of notes | 100,000 | If you crete X notes daily and never delete single note then:</p> - If you create 30 notes a day (every day)– it will take you a little over 9 years to hit the quota.
- If you create just 5 notes a day (every day)– it will take you roughly 55 years to hit the quota.
- If you create 30 motes a day (every day except w-ends) - it will take you a little less than 13 years to hit the quota
- If you create 5 motes a day (every day except w-ends) - it will take you roughly 80 years to hit the quota
So, after putting it into a bit of perspective – it doesn't look that bad, right :) Besides, even in 10 years I bet the computational power would jump to such a level that the limit would be raised to 1 million notes and then it would be impractical to hit the limit in a lifetime (of course we need to take into the account the fact</td> </tr> |
| | |
Tags | 100,000 | There are many speculations but many linguistic experts agree that an average adult has a vocabulary size of 20,000 to 35,000 words. Including the most obscure ones that you can think of. So I would say you are pretty much safe here as you are going to run of any meaningful means of managing the tags before you run out of quota |
| | |
Tags per note | 100 | That's a lot for every give post. And this limit is not even interesting that much. |
| | |
</tbody> </table>
26 Feb 2014 A recently popular new startup that is making waves, namely Secret.ly was quite soon hacked after it was first released, giving the attacker access to the identity of the poster, effectively defeating the purpose of the secrecy. So they said "We take security seriously" and threw a public challenge to the hackers around the world... Or so it seems becase there are no real incentives besides curiosity and pride and maybe some swag from secretly.
On the other hand, the not so known messaging app created by the brothers Nikolay and Pavel Durov. While the latter is well known being the founder of the most popular russian social networking site VK.com, his brother Nikolay is less know and he was the one to device the new communication and open source protocol MTProto for the Telegram. Telegram is non profit, partially open source (the Protocol and API code is open so every one who is skeptical can make sure that it is truly secure) and is absolutely free. It is available for Android and iOS. And if all the above doesn't blow you away yet, there's more. To make sure their implementation is secure, they are running a crypto challenge and the winner will get $200,000 in Bitcoin currency. Now that's serious.