User experience: Android 6 ( with cm 13 ) on the Samsung GT-P3100 without google apps

Being the owner of a Samsung Galaxy Tab 2 7.0 I decided not only to upgrade the Android version to 6.0.1 with cm13, but also see how far I can get without google apps.

I have nothing against google, they provide valuable services and technology. However, I think their enthusiasm in collecting data has gone too far. I want a good search engine and a reliable mail service, I don’t want a service that logs every single thing I do through my google account, from the search terms I entered to the times I played chess on my tablet. Is all the data collection on your android phone really necessary? Yes, you can opt out of most of it, but still, who goes to the settings, navigates all convoluted and hidden menus just to disable google’s hunger for your data. I’m not paranoid, I just like to stay in control. So I decided to try my tablet without google apps.

Here it gets problematic. Using an unmodified android phone without a google account is flatly impossible and not accessible to the average user since it will not work without rooting your device and installing an alternative android distribution of your choice.

There is no other way of removing google services from your android device than rooting and overwriting the system with another OS. There should be plenty of material on the process around, so I won’t cover it here and focus on my user experience. An android device without google apps does not come without serious drawbacks.

Most importantly, android without google is android without the google play store, which is google’s idea of installing and updating new apps.

There is F-Droid with comparable functionality, but only with open source apps. For apps that are only available in the play store, there is only one way: downloading the apk and installing it manually, which is tedious and a threat to your device security: who would easily trust some 3rd party apk download? The easiest solution here is to retain the old apks you collected from your time on google play store and install them on the google-less device. Needless to say, this method is worthless if you want to install something entirely new.

Furthermore, many google play apps will not work without google play services and refuse to start or malfunction.

Creating a backup of your data is now your own responsibility. No auto-synching of contacts to google anymore. I export them now manually to a vcf file from time to time.

Here a small list of the apps that will cease to work and their replacements. I’m not a heavy user of those apps, enthusiasts might find the solutions frugal and not suitable for their productive use.

-Google calendar: Fortunately, there is a standard calendar application on android with the same functionality. Displaying the events from your google calendar requires a little work though: I used an ics importer from the f-droid repo and connected it to the private url of my google calendar. Problem solved. Beware that this is only a read access, but that is fine with me.

-Gmail app: Android standard email client does the job.

-Google maps: For some strange reason this apk installs and runs without complaining about missing google services.

-Whatsapp is no google app, but I include it since it has a high priority for many people. Whatsapp has its own autoupdate and runs without problems, only displays a warning once when installing. If you keep whatsapp’s history file on the device, it is easy to import your old messages, and you are prompted to do so.

Other apps of choice include mupdf for pdf reading, CoolReader for ebook reading and open cycle maps.

After more than three months without google apps I’m not switching back anytime soon. Certainly this is not everybody’s cup of tea, but maybe my little article has encouraged you to give it a try. Mobile devices are not intended to be very protective of the user’s privacy, so it’s up to you to take a small part of it back.

Android – Which are the best fonts for reading ebooks?

A multitude of apps for reading ebook formats exists for the android platform. As different as they might be, they have one thing in common: they use the default font bundled with Android. The font selected by default is Roboto or Droid, which is not really bad, but not optimized for reading thousands of pages either. So, in my opinion, what all those reader apps really lack is a good font.

A quick search on the net revealed that some fonts exist which were designed with the specific purpose of reading ebooks in mind. Amazon has developed the Bookerly font which is delivered with their kindle devices. The Literata font comes with Google Play Books. Both are a noticeable typographic improvement over the fonts available as default on Android in terms of readability. The question is how to get these fonts into your favorite reader app?They can be downloaded as true type fonts. In order to use them, it is enough to copy the file to the /system/fonts folder. Adding new fonts is possible on android without installing any third party apps if you have a rooted device. Why are there special apps for things that are as simple as copying font files to the font directory? Wonders never cease.I managed to find the fonts on this site:
http://www.newswirl.com/bookerly-font-download/
Direct links:
http://www.newswirl.com/wp-content/uploads/Bookerly.zip
http://www.newswirl.com/wp-content/uploads/Literata.zip
Which of the two fonts is actually better is very hard to say. Both are a great improvement over the standard Roboto font. I favor the Bookerly font, but ultimately this is a very subjective choice.

SWF archeology: how to retrieve the dimensions from a flash (swf) file

Embedding flash objects can be troublesome, if you don’t know the native resolution of the file you want to display.

Of course you can use the embed tag or the object tag and set its width and height to 100%, but you have to stop editing and view your page to find out how big the object actually is.

In a WYSIWYG html richtext editor a placeholder that has exactly the size of the swf object helps a great deal to get an impression how big the element will actually be when viewing it.

Let’s see how this can be accomplished:
swfs files store the width and height of the object in the file’s header.
All we need to do is read the file header and interpret our findings.

The first 3 bytes of a swf file indicate the file type.
FWS is the magic byte number for normal swf, CWS indicates a compressed file, where everything beyond byte 8 is zlib compressed. We can also find version info and file size in the header after byte 3, but this has nothing to do with the file’s dimensions.

Reading another 9 bytes starting with byte 9 (this is where the header ends) will give us a rect structure, which stores the file’s dimensions. Read it in high-to-low order.

If you don’t know what a rect structure is (I didn’t know either), fortunately things are well documented.

structure of rect
Nbits nBits = UB[5]
Bits in each rect value field
Xmin SB[nBits] X minimum position for rect
Xmax SB[nBits] X maximum position for rect
Ymin SB[nBits] Y minimum position for rect
Ymax SB[nBits] Y maximum position for rect
Xmax-Xmin will give us the dimensions for x. The length of the Xmax and Xmin field in bits is determined by nbits.

Still, the results appear off the scale. Nothing wrong here, x and y dimensions are stored in twips (some invention of ressourceful typesetters?). Just divide the results by 20 and you get the size in pixel.


Here is a simple example in tcl (if you are looking for examples in c, there’s an overabundance of them on the web):

set f [open $swffile r]
fconfigure $f -translation binary -encoding binary
set header [read $f 3]
set version [read $f 1]
#size is uint32
set size [read $f 4]
set data [read $f]
close $f

if {$header ni {FWS CWS}} {
  #file is not flash
  return
}

#if the file is compressed, uncompress it first
if {$header eq {CWS}} {
  #compressed file, uncompress with zlib
  #we could use something nicer here, like ns_zlib or the zlib package
  set fileID [open "/tmp/swfuncompressed_XXXXXX" w]
  fconfigure $fileID -translation binary -encoding binary
  puts $fileID $data
  close $fileID
  set data [eval exec "/usr/bin/openssl zlib -d -in $tmp_file"]
  file delete $tmp_file
}

#rect contains dimensions
set rect [string range $data 0 9]

#structure of rect
#Nbits nBits = UB[5]
#Bits in each rect value field
#Xmin SB[nBits] X minimum position for rect
#Xmax SB[nBits] X maximum position for rect
#Ymin SB[nBits] Y minimum position for rect
#Ymax SB[nBits] Y maximum position for rect
binary scan $rect B* bin_rect
set end 4
set start 0
set nbit 0
foreach char [split [string range $bin_rect $start $end] ""] {
  set nbit [expr {($nbit << 1) + $char}]
}

for {set i 0} {$i<4} {incr i} {
  set start [expr {$end+1}]
  set end [expr {$end+$nbit}]
  switch $i {
    0 {
      set xmin 0
      foreach char [split [string range $bin_rect $start $end] ""] {
        set xmin [expr {($xmin << 1) + $char}]
      }
    }
    1 {
      set xmax 0
      foreach char [split [string range $bin_rect $start $end] ""] {
        set xmax [expr {($xmax << 1) + $char}]
      }
    }
    2 {
      set ymin 0
      foreach char [split [string range $bin_rect $start $end] ""] {
        set ymin [expr {($ymin << 1) + $char}]
      }
    }
    3 {
      set ymax 0
      foreach char [split [string range $bin_rect $start $end] ""] {
        set ymax [expr {($ymax << 1) + $char}]
      }
   }
  }
}

set dimensions(width) [expr {($xmax-$xmin)/20}]
set dimensions(height) [expr {($ymax-$ymin)/20}]
return [array get dimensions]

 

Movie review: Passengers

Trailer

Finally decided to give this movie a try. It offers opulent and truly creative sci-fi visuals, Jennifer Lawrence and Chris Pratt trapped in what is supposed to be a romance setting in outer space, that’s about everything that is good about this movies summed up in one sentence.

The biggest issue with this movie: It cannot really decide what it wants to be. We have moments of utter abandonment in outer space ( the drama part ), attempts at the obvious romance ( the romance part ) and later some heroic action ( the action part ). Neither of them are convincing and fall short of their possibilities.

Here’s the plot: An engineer on a spaceship travelling to a distant planet is accidentally resurrected from long-distance travel stasis by a malfunctioning system and discovers that he is the only human being on the ship who came out of stasis, and that 90 years too early.

It is easy to comprehend that his reaction is pure and unfiltered despair. Getting back to sleep is impossible and his only company is the robotic bartender. The camera follows him wandering around the ship, enjoying all of its luxuries while still yearning for human company and slowly turning into a complete slob with a castaway-style beard.

This part of the movie could be exploring the human condition and cosmic loneliness, but no, no insightful philosophical monologues, no plans except for trying to smash the door to the bridge, just an average guy slowly degrading into a total slob.

Then he discovers sleeping beauty Aurora and develops an unhealthy obsession, reading her files and believing he has found the perfect woman without ever explaining why? Strangely enough, he does not care at all about the other 5000 passengers.

By now the next steps he will take should be obvious to the viewer and we get transported directly from the despair part to the romance part. If you thought the first part was wasting its potential, you will agree that the romance part is equally bad.

The creepy side of the guy is never explored, which might have more interesting than boring the audience with the intricacies of courting. Their love abruptly metamorphoses into hate as the robotic bartender tells her the truth. But then, we still get no real drama, some superficial tears, broken hearts etc but not more.

Then enters the action part: Something in the ship is broken and they have to fix it or face inevitable annihilation. Well, nothing to add here. Why all the red light on a spaceship when an alarm goes off? Is it one of the unwritten rules of the sci-fi genre or just careless imitation? Who cares.

Then there is an ending. A really bad ending: The guy saves the spaceship, finally dies and the girl brings him back to life by mashing all the buttons of the medical tube. Now that the guy has come back to life, all his misdeeds are forgiven and love enters the stage again. Congratulations, he finally got away with his plan. They lived happily ever after, never touching the dark side of their relationship again.

There is one thing missing completely from the whole movie: depth. Everything, the characters, their dialogs, their actions are shallow and artificial. Well, one can enjoy the visuals and the acting, but this still does not compensate for the messed up plot and the cheesy dialoges.

My verdict: 3 stars out of 5. Watch it, if you are a genre enthusiast or die-hard fan of one of the actors. If not, stay away from it.