Monday, 15 September 2014

Geeky car insurance

My car insurer of choice - Aviva - takes an interesting approach to estimating the risk score. We all heard about insurers who want to install an extra little box to your car which will estimate your driving style, yada yada. Aviva actually employed slightly different approach: you install an app on your phone, and then check in at every start and end of journey. Once you've driven 200 miles with the app, your driving style is evaluated and you can receive a hefty discount (up to 20%, really) on your insurance premiums.

 

This way no one actually tells you to install the box or the app - but if you do that, you can save few extra quid on your car insurance - for some of the younger drivers insurance premiums can be crippling, so this would be a really good deal (and admit it, some although not all younger drivers can benefit of some err ... improvements with regards to their driving style).

What do you think of this approach? Would you install such an app?

Friday, 22 August 2014

Using GestureDetector in Android ImageView

I've found quite a few discussions on the Internet with regards to using GestureDetector for your ImageView; some of them are more useful than the others. The bottom line is: there are two ways of doing this:

  • Either subclassing ImageView and using newly created view in your activity XML file
  • Or simply delegating all events from ImageView to the gesture detector in your activity.
In fact, second way is extremely simple, so I want to share with you an example of how this can be done.


public class ShowImageActivity extends Activity {

  private static final String TAG = ShowImageActivity.class.getSimpleName();

  class MyGestureListener extends GestureDetector.SimpleOnGestureListener {
    @Override
    public void onLongPress(MotionEvent e) {
      Log.d(TAG, "onLongPress " + e.toString());
    }

    @Override
    public boolean onSingleTapConfirmed(MotionEvent e) {
      Log.d(TAG, "onSingleTapConfirmed " + e.toString());
      return true;
    }

    // You really need all these boilerplate methods for GestureDetector to work

    @Override
    public boolean onSingleTapUp(MotionEvent e) {
      return true;
    }
    @Override
    public boolean onDown(MotionEvent e) {
      return true;
    }
  }
  

Wednesday, 16 July 2014

LG G Watch CPU and RAM

I find it quite amusing that Android Wear LG G Watch has 4 cores and 512Mb of RAM on board - for such a tiny device this is somewhat crazy




shell@dory:/system $ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 38.40
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 3

processor : 1
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 38.40
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 3

processor : 2
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 38.40
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 3

processor : 3
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 38.40
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 3

Hardware : Qualcomm MSM 8226 DORY (Flattened Device Tree)
Revision : 0007
Serial  : 0000000000000000

shell@dory:/system $ cat /proc/meminfo
MemTotal:         471952 kB
MemFree:           28048 kB
Buffers:           59792 kB
Cached:            98004 kB
SwapCached:            0 kB
Active:           278340 kB
Inactive:          69112 kB
Active(anon):     196048 kB
Inactive(anon):      128 kB
Active(file):      82292 kB
Inactive(file):    68984 kB
Unevictable:         744 kB
Mlocked:               0 kB
HighTotal:             0 kB
HighFree:              0 kB
LowTotal:         471952 kB
LowFree:           28048 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:        190400 kB
Mapped:            63416 kB
Shmem:              5776 kB
Slab:              24568 kB
SReclaimable:      10728 kB
SUnreclaim:        13840 kB
KernelStack:        4752 kB
PageTables:         6008 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      235976 kB
Committed_AS:    6194552 kB
VmallocTotal:     521216 kB
VmallocUsed:       37204 kB
VmallocChunk:     304156 kB


I can easily remember my computer not 5 years ago, and it had specs sufficiently less than that!
Another amusing fact is that Wear has /sdcard mounted (even though there's obviously no SD Card whatsoever) which even has pretty standard for Android devices directory structure. 

Using Android Wear as a camera remote viewfinder

Since the moment I found Android Wear watches (I use LG G Watch) can be used as a remote release for standard Android camera app, I was waiting for the logical conclusion to this functionality - that is, ability to use the watch as a remote viewfinder. Lo and behold, meet github.com/dheera/android-wearcamera - Android Wear Camera by one Dheera Venkatraman (Play Store link). It does exactly what you think it does - when you start this app, it shows you a button-less camera view, which is mirrored on your watch. If this is not an ultimate selfie-tool then I don't know is.


The UI is minimalistic if I ever seen one, but hey - it does work!

Now, there are naturally tons of bells and whistles I would love to see added to this app, but even in its current for it works - and best of all, it is GPL-licensed, so anyone can git clone it and tune it to his or her heart delight!


Monday, 14 July 2014

Saving on holidays roaming calls with HulloMail

If you are not using HulloMail just yet, then you probably should. It closely resembles Google Voice's voicemail or iPhone's Visual Voicemail, except it takes it few steps forward with some really smart features. That's not the point, anyway. The killer feature for me is that it can forward all your calls (not only missed ones) to a voicemail so your phone essentially never rings, but you receive notifications about calls all the same via push notifications and email. This means you cut out all non-essential calls but still can react on those which are important.



This is especially a killer feature if you want to use a local SIM card of the country you're going to but still want to keep an eye on who's been calling you.

Friday, 11 July 2014

Chrome apps in native environment

As I just found out, it's exceedingly easy to convert a Chrome page (or any web page, for that matter) into an app which has its own icon and for all intents and purposes behaves like a normal app, not a Chrome window: just right-click chrome app shortcut in Apps menu and select "Create Shortcut" there. Result? Here you go:

Resulting "app" looks like a normal window (as far normal windows go in Unity, that is).


Wednesday, 9 July 2014

LG G Watch - three days of using Android Wear

When Android Wear was announced I basically pre-ordered it the moment new watches appeared on Play Store. First obvious question which everyone has been asking me so far: why LG and not Samsung? Well, few reasons:
  • Battery life on LG should be better – and every single review shows that indeed, it is.
  • Overall looks – I kind of like rectangular unobtrusive look of the G Watch. It should be an accessory, not a Christmas tree light!
So far, I am not at all disappointed (*) – watch performs formidably, doing everything it should and more. Since I used original Pebble and Pebble Steel before G Watch, it had a lot to live up to, so I tried to compare it side by side with the only smartwatch platform I know.
Please note, that I will only use my own impressions and will not even recourse to data sheets to compare these two.

Android Wear vs Pebble

 

Pebble Steel was and is a beautiful piece of technology, which I love a lot. Let's see how G Watch compares against it. First things first though...
  1. Looks – as always, everyone's a critic and everyone's got their own preference. I like the way Steel looks, but big "Pebble" word kind of stands out and attracts attention. To me G Watch is a winner: it's black, it has no visible elements, it shows time.
  2. Weight – without checking the datasheets, roughly the same. Maybe G Watch is a bit lighter, but either way, their weight is largely unnoticeable to me.
  3. Size – G Watch actually is bigger, and it's easy to see on the picture above. However, on my hand it looks very adequate:

So let's go on ... what now? Screen.