Category Archives: rants

Import QR vCard with multiple words name and surname in Android

First of all: YOU CAN’T.

Now for real, there’s a workaround, just buid your vCard text to be rendered as QR Code by removing the spaces between the first name words, and the last name words (surname that you may like).

Example:

N:Johns Phillips;John Philip;;; (Last Name;First Name;;;)

becomes:

N:JohnsPhillips;JohnPhilip;;;

and then, in the address book editing form that appears in Android you just tap in the middle of the joined words and press space.

It will be MUCH faster than moving around in the fields the misplaced name components.

 

There is NO WAY to actually have a vcard data correctly formatted to be correctly rendered by a QR Code scanner and correctly passed to the address book.
If you used a correctly formatted vCard file to directly import it in Android address book, it will work (for example, first export a vCard file for a contact, and then reverse engineer it… but to actually copy the VCF to the phone for each contact and manually importing it would be time consuming and bothersome); but if you use a generated QR code from the vCard code, each and every QR scanner out there will pass the full name data to the address book as a single unformatted string, IGNORING the name components of the N field, leaving the address book parser to decypher which is which.

So, depending on how you go about hacking your way into the vCard format, you might get

John (first name) Philip Johns (middle name) Phillips (last name)

or any other weird combination, BUT the one you were looking for.

Believe me, I tried, and chances are, if you ended up here, you did, too.

In my case I spend on it much more time than I care to admit. More than I needed to actually code from scratch the PHP to generate the relevant QR code into my management software.

So just embrace this workaround, but if you find a solution, please Please PLEASE share in the comments.

Revert, undo & go back from adoptable to portable storage in android marshmallow

I replaced my previous 32GB microsd in my note 3, with a transcend 64GB, and the system asked me if I wanted to use it as extended internal storage. Why not, I never use the sd as swappable storage anyway, and I liked the encrypted storage.

Go ahead an hour, I notice the system filled up 30GB more than the starting space, just stealing it from the sd card for no reason. Also, after rebooting I get a message saying “system has stopped responding”, and swiftkey cannot load languages anymore, disabling altogether the swype function.

Great!

I fiddle for good 15 minutes into the settings, finding nothing apparent, until I went into:

Settings > USB and Storage > Internal storage > Options > Migrate

which was supposed to migrate the data from the sd back into the builtin storage.

I started the process and went to sleep (it was late) hoping to find it solved in the morning… too bad! Couldn’t do that, the morning after the internal storage was 100% filled, an error message appeared, and the 60GB sd was still hald full.

The system went from the original 16GB used in the internal storage, to a total of 30GB filled internal storage+roughly 30GB inside the external, which is 60GB used storage… for what? God knows! In the USB&Storage panel of the settings, the details of the used space still amounted to the real space needed, and nothing was there to account for the additional space taken that was reported in the summarized stats…

Hence, I tried copying all the contents from the sd/internal storage to the PC, with the intention of resetting everything afterwards and restoring the data, but using the USB communication resulted in a severely slow transfer speed (we’re talking about a 100Kb file each few seconds, and there were 12GB of data to move).

I tried several times to check and see if I could speed things up, to no avail, so I used the remaining free space on the microsd (I had that, if you don’t you may want to use an OTG cable and a pendrive) to create a ZIP archive (with estrongs) of all the contents of the internal storage, and as a single file like that I could then copy it to my PC at a decent speed.

Once that was done, I wend in settings > USB and storage > SD card > options > format as portable, agreeing to lose all data (I had backed it up anyway), then into recovery I wiped the internal storage, then rebooted to have the changes take effect, and from this state (internal storage almost empty, microsd seen as normal portable storage) I copied over the backed up contents from the previous configuration via normal USB transfer (some files and folders couldn’t be copied, but it was nothing essential).

Up until now eveything looks to have gone back to normal.

MyPhoneExplorer via Bluetooth: phone could not be indentified and parameter incorrect

Chances are that you are trying to have your Android phone sync with Outlook via MyPhoneExplorer, but whatever you do won’t work, since as soon as you try to connect, the procedure stops at “identification” and MyPhoneExplorer pops up a “phone could not be identified” error.

Syncing via USB cables works though, but you are not going to settle for something as annoying and remembering to plug in your cable everytime.

Update: try this first:
Chris, in the comments below (thank you, Chris), suggests doing this, which is apparently working in Windows 7 (Windows 8 doesn’t have such possibility):

Easier if you just go to control panel > hardware and sound > devices and printers > bluetooth devices

Then right click on the device you’ve already paired. Go to Services tab, and under Bluetooth Services there should be a checkbox for Serial port(SPP) ‘MyPhoneExplorer’.

Check it, apply, done…

If that doesn’t work, continue reading!

Compared to the first version of this article, when I was on Windows 7 + Ice Cream Sandwich, now I’m on Windows 8 + Lollipop, and started having this problem a short while after upgrading from KitKat. The solution was to open MyPhoneExplorer settings, select bluetooth in the connection tab, and choose, from the dropdown menu, the other Bluetooth port that was not selected before, and try again to connect, in my case it went by as normal.

If this doesn’t work as well, then proceed with the very first guide.

So let’s start by saying this out front: this is black magic.

You may have tried to go into “change bluetooh settings” in your control panel, then open the “COM Ports” tab, and manually add incoming ports and trying them out one by one in MyPhoneExplorer… this should not work, no matter how many times you reboot your phone and/or unpair/pair again with your PC.

The procedure I am going to illustrate may work for you, or it may not. It may do nothing on a sunny day of April, but deal impressive results in a foggy evening of november.

I tried to replicate the same method previously, but it worked for me just a few minutes ago as a blessing (and this is why I rushed to write an article about it) while it didn’t at my previous attempts, so these are the steps (keep in mind I have ICS on my phone, and Windows 7 x64 on my laptop, the BT sync worked before, but had stopped working after I upgraded from Gingerbread to Ice Cream Sandwitch on my Galaxy Note)

  1. Find your phone entry in bluetooth devices in Windows, click it and remove it
  2. Unpair with your PC from your Android phone
  3. If there are any remaining, remove every reserved port in “COM Ports” tab of bluetooth settings (unless there are other ports being used by other BT devices you own, leave those alone)
  4. Reboot both your PC and your phone, preferably at the same time (black magic, remember?)
  5. Pair the device from Windows (go into bluetooth panel, “add device”, then proceed with the pairing)
  6. Your aim here is to have Windows itself add the COM ports, you should end up with two COM ports, one Incoming, and one Outgoing, they should both carry the BT name you have given to your phone, and the Outgoing port should also say “MyPhoneExplorer”
  7. You should set MyPhoneExplorer to use the Outgoing port among the two, but if it doesn’t work for you, also try the Incoming port (black magic)

Good luck!

Why Android sucks at managing battery drain and discharge

So here is my second rant about disliking Android.

I should mention now that I am a happy user of this OS on my HD2 since a while ago, after discovering that CalenGoo is a great substitute for Microsoft’s Pocket Outlook calendar, and that HanDBase in its Android version can be tricked into doing the same things of its Windows Mobile counterpart even if a key feature is missing.

So well, what I’m ranting about today is battery management, or should I say “Battery stats what the hell”?

Just a short anecdote: I went to sleep yesterday at 0:30am, battery percentage reading 58%, I woke up this morning at 8am (in the middle there was a scheduled Titanium Backup of modified data, followed by a reboot, and half an hour of scheduled WiFi with 15′ checks of 6 mailboxes, and obviously mobile network on). When I woke up, battery was at only 14%. Astonished, I deleted the battery stats and rebooted, after that it was reading 2% (!!!). To be noted, battery history, reported by Battery Monitor Widget, tells me that the battery voltage at the moment of getting in the bed was 3.85V, and when I woke up it was 3.79V. Also, the battery current output (which has an exact reading on this HD2, since HTC cares for stuff like this, unlike Samsung), is in a 4-7mA figure all night long, except only when Titanium Backup and mail checks kicked in.

All in all, considering the 2% charge reboot, my phone is telling me, or at least Android is, that it drained 56% of battery in a 7.5hrs period, without doing practically anything. Let’s shave off 10% due to the Titanium Backup and the WiFi checking (I’d say 3-4% is a more realistinc estimate, but oh well), it’s still almost 50% of the battery that disappeared for no reason.

Also to be noted that I put this battery in yesterday morning, it was 98%, and I used it all day long for some calls, a little web browsing in the morning, agenda activity, budget monitoring, and so on. It didn’t drain as much in a 16 hours span, than it did in 7.5hrs of inactivity during the night.
Now, obviously it DID drain more during the day, but Android tells me the other way around. My question is: WHY?

I have 4 batteries, I just swap them out when they are at 10% or so, and put in another charged one. This has led me to up to 4days uptime on Windows Mobile; sure these batteries have aged, but not so much to not even last a couple days with mild usage. Now I understand better what I wrote in this post, calibration does make sense, but only because of a HUGE Android shortcoming (and only if you, unlike me, ever use just one battery). Windows Mobile on this phone never failed reading proper battery, with no “stats” whatsoever.

Now, regarding mV: nominal voltage of a Li-Ion battery is 3.7V, but the charging voltage is 4.2V, so actually a 100% charged LiIon battery has a voltage of 4.2V (or rather 4199mV). That means, for the phone, that the battery was fully charged. As so, the discharged voltage is obviously not 3.7V, but lower than that. What the device (or software?) decides to be 0% is up to the manifacturer, a fact is that most LiIon batteries have a cutoff at 3.0V to prevent damage to the battery, some of them have a cut-off even lower, at 2.5V.

Let’s say it’s not safe to assume that 3000mV is our 0%, let’s say our “0% charge” voltage is 3400mV.

Now, please tell me, WHY is Android reporting 4% battery left (I just briefly attached it to the USB to sync calendar) when the voltage right now is greater than 3700mV? This would mean higher than 50% residual charge, which is just reasonable, since it was 58% before going to bed, and it did no more than 7% worth of stuff during the night, but Android will still insist for it to be 4%. This reminds me of something I read somewhere on XDA, about this user who had two batteries for his phone, a “vanilla” one with normal capacity, and an extended one with almost double capacity. Android would insist reporting 0% on that second extended battery based on the “statistics” of the first battery, thus forcedfully shutting down the device when the residual charge of the extended battery was at least 40%.
This is the stupidest thing I can conceive about a modern operating system.

And yes, I know the battery state of charge cannot be determined by voltage alone, because it is influenced also by temperature and kind of usage until that moment, but surely enough 3700mV is NOT 4% residual charge, it surely enough is more like 50%. We are not talking precise, 1% step-by-step measurement, but wide-range precision measurement. And there is a hell lot of difference between 50% and 4%, it’s called 46%.

The programmer at Google who coded these routines must be a guy affected by a severe form of OCD, and who throws away his gingerbread cookies 6 months before the expiration date, just to be on the safe side (pun intended). But you know, OCD guy, I like my batteries to last all they can instead of having your OS shut down my device a lot sooner than needed.

Which brings us back on track: “battery statistics”: what ARE they? Do they even make sense? How can a discharge cycle affect in any way the subsequent one? Maybe I was bored at work and read some manga keeping the screen on, maybe I was busy like hell and didn’t have time to play with the phone, maybe I was on a trip and out of boredome started watching an episode of Sex And The City after another. So what.
Again, Windows Mobile had no battery stats whatsoever, but never failed to read battery charge properly. Nor any 10-years-old Nokia phone had battery stats, but they still had LiIon batteries.

Yes, I also know what “battery lookup tables” are, and how they are useful in determining battery state of charge more precisely. But it’s clear they are not working at all on Android, and actually are anti-productive for those like me who swap out discharged batteries rather tan charge them inside the phone. I despise you, OCD google guy.

Why Android sucks for professional use

UPDATE at the end of this post.

I tried many, many times to switch from Windows Mobile to Android, and every and each time I went back to Windows Mobile. Honestly, I would like to upgrade, because my HD2 won’t be enough forever, and no new phone gets shipped with a shiny Windows Mobile 6.5 OS anymore. Funny enough though, Windows Mobile allows me to do a better job.

Lt’s start with the calendar:

  1. Builtin calendar app is pretty much useless, under certain aspects even more useless than the primitive calendar found in old-ass Nokia phones. You cannot either jump to an arbitrary date of your liking, but have to interminably scroll through months, and you cannot search through entries for a name, a number or a place (at this point I might as well get myself a paper agenda, at least that’s got a vintage sexy feel to itself);
  2. Half-hour time separation is out of the question, unless you’re using the paid Pocket Informant, each and every calendar defaults to whole hour appointments and starts appointments at o’clock’s;
  3. Search is, all round, an impossible function, I couldn’t even find it inside Pocket Informant (it relies on the OS builtin search function in Windows Mobile, too); a couple of free apps from the same developer should provide it, either Searchify that hooks onto the builtin search widget, but I couldn’t make it work, or Touch Calendar, which is a viewer only, and sports a -working- search function, that alas won’t get you any results before the few past months, even if you have records of appointments dating back to 2005;
  4. Calendar access is slow, no matter the application, when you load a month you could be counting up to 1 second for the “busy days” to get displayed depending on the application, and we’re talking about a 1GHz CPU with 576MB of RAM (my oh so old Casio Cassiopeia was instaneous on that aspect);
  5. Maybe I’m forgetting something, but the bottomline is that Pocket Oulook had a better calendar on PocketPC 2002 than any app for Android can offer, and that’s a heavy fact, so try and tell me I’m wrong.
  6. UPDATE: I discovered that Android *chooses* in your place to simply discard anything in the calendar which is more than 2 months old; no setting, no option, no nothing to let you choose to keep your frigging data on the phone even if it dates back 10 years. Do I need to say more?

Let’s go on to office suits, and more notably to Excel support:

  1. Google gives NO builtin spreadsheet support, unless you have a data plan, the area you’re in is covered by your carrier, and you’re totally fine with sharing your private data with google apps;
  2. There are several free alternatives to a commercial spreadsheet: some just don’t read XLS unless in the paid version, some will open it read-only, some have no XLS support altogether;
  3. NONE of the spreadsheet applications in the market (I tried them all, free and commercial) has the ability to immediately show the SUM of the values inside a selected column inside the statusbar, like we are used to with desktop applications, and like I’ve been used to since (again) PocketP C2002;
  4. Again, also in this aspect the bottomline is that no spreadsheet app whatsoever keeps up to the Pocket Excel bundled wih PocketPC 2002.

This may be for a small group of users, but no application can do half what can do HanDBase on Windows Mobile, not even HanDBase’s native version for Android, and that’s for certain it will stay forever like this.

But don’t falther readers: if you want to count the meters you travel in a workday, or manage your own virtual cafeteria, or just slingshoot birds with anger management problems against a castle full of mutated legless green pigs with moustaches and helmets, then Android just shines at that, and will do it gloriously while passing all your private information to Google for free.

Windows Phone 7 may be the alternative, too bad you just can’t synch offline, but need to again send your private data to Microsoft’s servers, while there’s a workaround on Android for this.

UPDATE (6 Oct 2011): so here I am, writing while finally using Android as my main platform. I had to go far until I managed to do all I needed, but overall I have a platform I don’t really loathe anymore:

  1. Calendar: CalenGoo manages to do all I need, notably has a good search function and a nifty time-separation default set; having DroidWall block everything except those things that absolutely need an internet connection, I prevented old calendar events to be deleted, and this way I can also avoid my data going to the cloud, while keeping it in synch with MyPhoneExplorer; it’s still a tad slower than PocketOutlook, but I can manage.
  2. DocumentsToGo is decent enough in handling XLS files, even without any “sum on column select” function, but I added a formula somewhere in the sheet.
  3. HanDBase finally returned as good as new when I implemented some additional calculated field in the rows, enabling me to see stats that I couldn’t calculate otherwise.
  4. Stock phonebook is ugly enough, but GO Contacts EX is promising, even if hella slow to start.

Power efficiency of ATX PSU, power adapters and UPS

This article goes hand in hand with my previous one, since the findings I report in here are those that led me to update the power source of my server.

When you buy a PC, usually the PSU is the last of the worries: the more Watts it’s got, the better, as it can handle all the power hungry hardware you plug to it. Also, usually, this is “just right”, as we use our main PC for just a few hours per day (as long as you make sure you either use suspend for short pauses, or hibernation for longer ones, so you don’t waste energy while you’re not actually using it).

When it comes to servers tho, that are made to run 24/7, power efficiency is of paramount importance, because, make your own calculations, a single watt, year-wise, will be going to cost you something. Using my estimates, and living in Italy, for each watt of consumption of any always-on electric appliance, I will pay, after a year, about 1.75€. Not much in itself, but try and multiply it by 100.

Also, the more power you use, the more you end up polluting the environment, and raising the earth temperature.

So, of the 100, 150 or 200W-whatever that your PC drains, how many do you think are really needed to run the PC, and how many go wasted in the form of heat? For each fan you need inside you PC, you are raising one notch the waste-index of the computer.

Giving for granted the waste of power that goes into the hardware itself, I am going to talk about what regards power supply units, the PSU boxes that nawadays are very nonchalantly sold in the range of 500W-1000W. Do yourself a favour and buy a wattmeter (kill-a-watt or whatever you call it) and measure the power absorbed by your home computer, it will surely be way lower than the maximum rating of the PSU it’s using; the more the real load is distant from half the nominal power of the PSU, the more you’re wasting in heat, since the efficiency of a PSU is a gaussian curve that has its peak (be it 70% in the old fashioned PSU’s, or up to 86% in the newest ones) at 50% the maximum load. In other words, if the hardware in your PC drains 100W, you should get a 200W PSU, even if nowadays it’s hard to find one, so it’s still better a recent 86+ 5ooW one.

For a simple comparison: my current server, before I did the complete switch described in my previous post, was equipped with a 350W PSU, the only one I had available, and it drained little more than 42W in idle. One day, I had too much free time in my hands and went scavenging for other PSU’s, so I had the chance to test it with a 250W PSU, and the drain lowered to 39W, while, with a very old, and supposedly very inefficient, 120W PSU, the drain went even lower at 37W. As soon as I bought and installed a PicoPSU, and connected it to a PSU brick rated 12V@3A that I had from an old external disk, I got a surprising 29W drain while in idle, a total saving of 13W off the 350W PSU. Translates to roughly 23€ savings in a year… the amount it costed me to buy the PicoPSU from the US. A break-even after a year is a good break-even, I say.

Uninterruptible power supplies are another source of waste, even if you would never suspect it: my car-battery modded UPS drained an additional 10W in idle; thinking about it, though, it makes sense, as with a UPS you’re doing an additional conversion, from 220V to 12V, or from 12V again to 220V (in the PC it goes even one more time from 220V back to 12V), which is intrinsically inefficient. In a year, 10W would mean 17€, more than what I paid for a 120W 12V fanless power adapter from China; I already had the car battery, so again a one-year break-even by exchanging the UPS with a plain AC/DC 12V adapter, good!

Virtualbox bridged network adapter driver slows down LAN speed

When I upgraded from WiFi to a physical CAT5E cable running between my router in the other room and this desktop, I jumped from 2-3MB/s tops (1MB/s usually, sometimes less) to 11-12MB/s speeds during file transfers from my home server.

Lately I was checking that the speed to download some fansubs off the server got down to 5-6MB/s, exactly half of what I was used to; I noticed there was another non specified adapter listed in Windows 7’s statusbar icon hover, and I traced it to Virtualbox’s bridged network adapter. Since I recently had installed that to test something for which I had no need anymore, I simply uninstalled Virtualbox, and as soon as the virtual network card driver was gone, speeds were back to 11-12MB/s.

Should this be in any way a normal behaviour?

reCAPTCHA fails to deliver, bypassed or cracked, spam still comes through

I like(d)  the idea behind reCAPTCHA, blocking spam while helping scanning books is cool, and let’s be honest, reCAPCHA images are more readable to the human eye than the random deformed alphanumeric combinations the usual antispam codes produce.

Anyway, even if I have Akismet plugin installed, being the comments captcha’ed I expected almost no spam at all, not certainly from bots, yet it’s been a constant for me; lately, a huge wave of spam messages, almost identical, hitted the website; this also happened on the punbb forum of my professional website, where reCAPTCHA plugin was in action, and you understand that finding a spam post containing plenty of links with obscene thumbnails attached is not good for my image.

What’s the reason behind all this? Possibly reCAPTCHA pollution by special kind of keyword spamming to make certain known words always check positive, or advanced OCR techniques, or your average next door guy payed some millicent each captcha he decyphers. I don’t really care, what I know is that spam is passing through.

So I decided to drop reCAPTCHA altogether and switch to good old onsite captcha generation, let’s see what happens, there is now SI Captcha plugin installed (suppose SI stands for SecureImage, I recognize the pattern).

  This article has been Digiproved

Li-Ion battery calibration, funny myth? Personal thoughts

I regularly lurk over at XDA since I started -happily- using my HTC HD2 Leo (actually, I just brought it to a collection center for warranty servicing… dead touchscreen, sigh). Since then, I began reading about “funny” practices regarding lithium ion battery usage to prolong their life. Even before that, when I still used older pocketpc’s (namely, iPaq’s) I would always run down the battery to about 30% and then recharge to full, and I avoided at most to recharge before it was “time”; on the other hand, you can often read guides saying that LiIon batteries get better the more often you recharge them, and get worse the bigger and less frequent the charges (sure, now tell me your laptop battery improves by always using it attached to the mains charger…).

Following is an excerpt taken from here (I suppose these are pretty standard steps, I’ve read similar ones on some XDA threads):

  1. Run the device down until it turns itself off.
  2. Turn it back on and wait for it to turn itself off again.
  3. Remove the battery for 10 seconds.
  4. Replace the battery, but leave the device off.
  5. Charge the device until full and then for another hour.
  6. **Root users only** Using a Terminal Emulator, type “su” enter, followed by “rm /data/system/batterystats.bin”
  7. Run the device’s battery down until it turns itself off.
  8. Turn the device on and charge for at least 8 hours.
  9. Unplug the device, turn off, then charge for another hour.
  10. Unplug the device, turn on, wait 2 minutes.
  11. Turn off again and charge for another hour.
  12. Restart and use as normal.

Now, the least of my intentions is to criticize their work in any way (believe me), yet, personally (very personally) I think you could insert in any place in that list the following statement:

  • Dress in a striped white and greenish scottish skirt, and, while wearing ONLY that, during a full moon, jump yelling “IIIOOOONNNN” around your charging phone

and it would perfectly fit in the overall mood of said list.

On a side note, when the charging device says it’s full, it stops sending energy to the battery, so for any kind of purpose you could leave the charger attached for a whole day after the led got green, it won’t really make any difference.

I am an extreme case, and I know it, but I can very honestly report my experience: I have the standard original battery, and I bought off chinese eBay other 3 clones (1230mAh, perfectly identical to the original except a slightly tinier barcode), together with a desktop charger.

I use the phone until it runs down to ~20% (lately down to 10% or even 5% if I’m doing something I don’t want to interrupt, like reading manga) at which point I take out the battery, and put inside the next charged one (I have them numbered, from 1 to 4). The drained battery goes straight inside the desktop charger (or in my pocket, until I get back home).

I rarely use the car charger, but I kind of regularly use the phone inside the car as MP3 player/navigator.

I have gotten, on very light use, up to 4 days uptime. Yes, you read it well, FOUR days uptime; I may have used it very little, yet it’s still 96 hours. Are you going to tell me that with those tricks you read about it could’ve lasted even longer?

  This article has been Digiproved