Profile

Cover photo
Hugo Visser
Works at Little Robots
1,454 followers|1,208,717 views
AboutPostsCollectionsPhotosYouTube

Stream

Hugo Visser

Shared publicly  - 
 
The blessing and curse of auto updating Google Play Services

TL;DR: Google Play Services broke my app and there's nothing I can do about it but wait and hope for the best.

As Android developers we all know and probably use Google Play Services in our apps: it provides new functionality on older devices and easy integration with Google API's. As a developer you use the client part of Google Play Services, while on the device the component gets regular updates and feature enhancements. This is all great except for one thing: your app QA is now at the mercy of the Google Play Services updates.
When bugs get fixed in Google Play Services, this is great: you don't have to update your app to benefit from fixes and you don't need to bother too much with updating SDK's for various Google products because it's taken care of for you. However the flip side is when a regression or bug is introduced. Potentially, your app can break at any time. Now, this might sound a bit dramatic, but this has happened to me a couple of times now.

My app, Rainy Days, relies on Google Maps a lot; in fact it's main screen is a Google Map. In may of this year I started to notice white squares in some areas of the map. I didn't think too much of it, couldn't really reproduce it and I was quite busy with other stuff. Maybe a video driver glitch?
Then, users started to report the same thing. More and more users as a Google Play Services update was rolling out. I dropped everything that I was working on and tried to figure out the root cause and work around it. I recently filed a bug for it (https://code.google.com/p/gmaps-api-issues/issues/detail?id=8360) since the bug is still present in the current Google Play Services version. It turns out this bug was already reported (https://code.google.com/p/gmaps-api-issues/issues/detail?id=8084) around the same timeframe that Google Play Services 7.0 was rolling out and I implemented the workaround in my app.

Fast forward to yesterday, when a user is contacting me that "all of a sudden" Rainy Days is crashing on start up. A couple of weeks after the last update, but a roll out of Google Play Services is in the air, already pre-announced. A quick look at some crash reports reveals this crash happening on various devices:

java.lang.NoSuchMethodError: No static method initFactories(Lcom/google/android/gms/maps/internal/ICreator;)V in class Lcom/google/android/gms/maps/MapsInitializer; or its super classes (declaration of 'com.google.android.gms.maps.MapsInitializer' appears in /data/app/com.neenbedankt.rainydays-2/base.apk)
       at com.google.android.gms.maps.internal.CreatorImpl.initV2()
       at com.google.android.gms.maps.internal.ICreator$Stub.onTransact(ICreator.java:107)
       at android.os.Binder.transact(Binder.java:380)


So it appears that the public api com.google.android.gms.maps.MapsInitializer is broken all of a sudden, making my app crash.
Fortunately, this user contacted me and is willing to troubleshoot. Most users will just uninstall and give you a one-star rating, even if they have been using the app for ages. Users are harsh (but that's for next time ;))
Long story short: the user had Google Play Services 7.8 installed on his S5. After uninstalling that version and then reinstalling Google Play Services again (my app will show a message if the Play Services version is too old) everything is fine again. Why? Because the version of Google Play Services that is installed this time is 7.5. I can only speculate here, but I suspect that the rollout was stopped by Google, but this user was already upgraded. And looking from the crash reports this isn't the only one.

To reiterate: there's absolutely nothing that I can personally do about this. My app just breaks because of a regression in one of the libraries that gets auto updated. I have no opportunity to test with this new library version or prevent it to be used with my app. QA-wise I'm at the mercy of Google Play Services rolling out and dropping everything to workaround or fix problems caused by it. All I can hope now is that the fixed version of Google Play Services will roll out soon to the users that didn't contact me, if they haven't uninstalled the app already.

IMHO this breakage in particular is pretty bad and easy to reproduce. I hope Google will QA Google Play Services better in the future, test on even more devices and so on. With auto upgrading libs comes a big responsibility! It's great when it works, it's very painful if it doesn't.

#android   #androiddev   #gde   #blogpost  
48
6
Stefan Hoth's profile photogeorge oloo's profile photoPeter Scully's profile photoAlexander Lent's profile photo
19 comments
 
+Daniel Resnick +Hugo Visser I have an app showing this crash as well. Crashlytics/Fabric shows around 4500 daily active users, of which 0.5% experience this crash. Both Samsung SM G900F (S5) and Huawei G700 U10 are listed. I do not use Proguard. The APK references GMS version "7f0b0001".
If you need more info let me know.
Add a comment...

Hugo Visser

Shared publicly  - 
 
 
Drag and Swipe with RecyclerView - Part Two

Just (finally) published part 2 of the series, Handles, Grids, and Custom Animations. Was hoping to fit more in, but the good news is that part 3 will come much quicker this time!

Corresponding GitHub project was also updated:
https://github.com/iPaulPro/Android-ItemTouchHelper-Demo

Please file any issues:
https://github.com/iPaulPro/Android-ItemTouchHelper-Demo/issues

#androiddev  
Part Two: Handles, Grids, and Custom Animations
1 comment on original post
6
2
Sergey Tsybrovskyi's profile photoStephen Anthony's profile photo
Add a comment...

Hugo Visser

Shared publicly  - 
 
This gets me excited!
 
Introducing Nearby for Android and iOS.

Use Nearby Messages to build proximity into your apps. Help users work and play better together, when they are together.
19 comments on original post
12
3
Brian Duff's profile photoOmar Tosca's profile photoDaniel Novák's profile photoStephen Pengilley's profile photo
2 comments
 
+Thomas Keller we're looking forward to seeing what kinds of features and apps folks build with Nearby :)
Add a comment...

Hugo Visser

Shared publicly  - 
 
I've been scratching my head on this one so I'll just throw it out here now: using CoordinatorView and AppBarLayout, would it be possible to replicate the toolbar scroll / hiding behavior that is now currently in the Bundle app? The default behavior doesn't give me the animation on a partial scroll and I can't seem a straightforward way to extend the AppBarLayout.Behavior class either. I'd love to replace my custom solution with the components from the support design library if possible.
3
2
Daniele Segato's profile photoIan Lake's profile photoEric Korb's profile photoRouge Official's profile photo
5 comments
 
+Daniele Segato​ - the Design Library tries to implement the specs [1] and you'll note there isn't a spec specifically for a flexible space and tabs setup, although I'd need to actually see code to determine if there's something that can be fixed to support that pattern anyways

[1] - http://www.google.com/design/spec/patterns/scrolling-techniques.html
Add a comment...

Hugo Visser

Shared publicly  - 
 
 
The return of the splash screen 
Along with a tweak in the application design guidelines, Google has updated its own applications for Android with a subtle graphical tweak to remind users just who the driving force behind the ecosystem actually is. Not only are splash screens now an acceptable part of Android design, Google is making immediate use of them in a defensive move against other cloud providers such as Microsoft.
2 comments on original post
6
Bogdan Zurac's profile photoMathieu Méa's profile photo
2 comments
 
I can understand the branding issue with Google Drive vs. Microsoft Office (especially since both are pre-installed on more and more Android devices) but Maps has no real competition on Android and YouTube has no real competition on the Internet.
Add a comment...

Hugo Visser

Shared publicly  - 
 
Hey hey, just blocked a huge troll that pops up in about any Android related post. My stream looks cleaner already!
8
Juhani Lehtimäki's profile photoHugo Visser's profile photoPaul Lammertsma's profile photoRory Glynn's profile photo
15 comments
Add a comment...
Have him in circles
1,454 people
Jeff Axelrod's profile photo
Benjamin Richardson's profile photo
Miguel Aragues's profile photo
Andre Salomons's profile photo
Nino Nanitashvili's profile photo
David González's profile photo
Aran Arunakiri's profile photo
raul gallart's profile photo
Michael Ritchie (ThanksMister)'s profile photo

Hugo Visser

Shared publicly  - 
 
Any followers that have experience with geotools? I'm trying to build a small webservice to reproject a raster image. I think all ingredients are there in geotools, but I can't figure out the recipe :) Any help would be apprecated! Also alternative solutions in other languages welcome.
1
Add a comment...

Hugo Visser

Shared publicly  - 
 
android-apt 1.6 released
I just released android-apt 1.6 to Maven Central. Here are the changes:

* Build order is no longer changed for project dependencies. Changing the build order to ensure the dependent project was packaged, gave some issues, for example for projects that have broken packaging tasks that would otherwise not be invoked.
* It's now possible to specify specific processors to be run. This is useful for annotation processors that don't register automatically or if you have an annotation processor as part of a project dependency.
* Annotation processors declared in the provided scope are now also picked up by android-apt. This is mainly for plugins that contribute annotation processors through the provided scope, like the Android databinding plugin. Using the apt scope is still recommended.
* The processor path should now be matching the compile & provided classpath. This caused some issues with the Android databinding plugin which should now be fixed. Thanks to +Evan Tatarka for suggesting this fix and reporting the issue.

I've updated the README to include a small FAQ to clarify why this plugin exists ;)

For more info, see the project site at https://bitbucket.org/hvisser/android-apt

Happy processing :)
#androiddev   #gde   #android   #opensourcecode  
46
10
Rouge Official's profile photoEugen Martynov's profile photoSalvador Gómez's profile photoHilmi Apak's profile photo
3 comments
 
Yeah - thank you.  Dagger and AutoValue would be nearly impossible to use with out this or something like it. 
Add a comment...

Hugo Visser

Shared publicly  - 
 
 
I posted an article over the weekend on the updates to System UI Tuner in the latest #AndroidM  preview, and how you can take advantage of them to tweak the status bar.

Hopefully these features will remain (in some capacity) in the final release!

h/t to +Jake Wharton for giving me the idea.

#Android   #GDE   #Article
View original post
4
Add a comment...

Hugo Visser

Shared publicly  - 
 
 
Use colorPrimary to colorize your App Bar
Pro-tip by +Ian Lake 

The app bar [1], or action bar, is an iconic part of many Android apps, providing a consistent place for navigation affordances and frequent, important actions. But it can also be a great opportunity to bring some personality to your app. An easy way to do that is by using your branding color as the background of the app bar.

In fact, AppCompat makes this very straightforward using a technique of providing a color palette [2] for your app. While introduced in the Material themes added in Android 5.0, AppCompat makes this technique available to all Android 2.1+ devices.

If you’re using a theme such as Theme.AppCompat, you’d only need to add a colorPrimary attribute:
<style name="AppTheme" parent="@style/Theme.AppCompat">
<item name="colorPrimary">@color/primary</item>
</style>

And your App Bar will automatically be colored appropriately. You’ll note we’re using just colorPrimary and not android:colorPrimary as android:colorPrimary only works on Android 5.0 devices unlike the AppCompat provided colorPrimary. Just make sure you’re using the right theme so that the text and icons have enough contrast:
- Theme.AppCompat -> dark activity, dark app bar
- Theme.AppCompat.Light -> light activity, light app bar
- Theme.AppCompat.Light.DarkActionBar -> light activity, dark action bar

But perhaps you’ve already moved over to Toolbars (perhaps wrapped in the Design Library’s AppBarLayout [3])? In those cases, you’re probably using a Theme.AppCompat.NoActionBar or Theme.AppCompat.Light.NoActionBar theme and including those elements in your layout XML files. Thankfully, you can still take advantage of your colorPrimary using the format ?attr/colorPrimary:
<android.support.v7.widget.Toolbar
android:background="?attr/colorPrimary" />

This ?attr/ format allows you to pull any attribute out of your theme, making it easy to consolidate your theming into a single place and avoid finding/replacing across many files.

The other thing we’ve lost is our text coloring though - there’s no Theme.AppCompat.Light.DarkActionBar.NoActionBar. Here’s where a ThemeOverlay can prove incredibly helpful. ThemeOverlays, unlike a full theme, only seek to overlay the current theme, changing the few things they need to. For example, if we had a light theme but wanted a dark Toolbar, we could use:
<android.support.v7.widget.Toolbar
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
With just that change, our text and icons are now back to a white color - perfect for a dark Toolbar.

You’ll find a number of other colors you can and should add to your theme such as colorPrimaryDark for changing the status bar on 5.0+ devices to a darker branding color and colorAccent for a contrasting accent color designed to make elements such as a FloatingActionButton really pop out. If you’d want to learn more about AppCompat, check out our video on Consistent Design with AppCompat [4].

For now, bring some personality to your app by using colorPrimary to color your App Bar or Toolbar!

#BuildBetterApps

[1] - http://goo.gl/Meu1sE
[2] - https://goo.gl/EHaUMj
[3] - https://goo.gl/Wo1IBv
[4] - https://goo.gl/O1iVPB
17 comments on original post
8
3
Franck Schneider's profile photoStephen Anthony's profile photo
Add a comment...

Hugo Visser

Shared publicly  - 
 
My friends at Bundle just released a new update for iOS. I'm practicing my rhymes for the Android update as we speak.
Pieter-Pleun Korevaar
Bundle version 1.0.3.
4
Said Tahsin Dane's profile photoHugo Visser's profile photo
2 comments
 
Aww that sucks +Said Tahsin Dane!
Add a comment...

Hugo Visser

Shared publicly  - 
 
Dutch paper +volkskrant has an article today on an Android exploit that researchers of the +Vrije Universiteit Amsterdam have found. It basically works like this:

- Attacker controls the browser of the user on their Windows/Linux/Mac desktop (not Android).
- Attacker steals Google credentials that allows installation of an app from the Play Store on any of the devices that the user might have.
- App is automatically installed, like installing any app from the web version of the Google Play Store.

So far, this might be a security concern. An attacker that is able to exploit your browser can pretend to be you and act like you. Which is usually the whole point of exploiting right :)

Now the tricky part: the user needs to actually activate the app. At 3:06 in the video, you hear the researcher say that the user has to click on the app, which is correct. Possibly, because it has "an attractive icon". Then they go on stating that even without clicking on the app, it could be launched from a bookmark or web page. However, they don't show how that would look like for obvious reasons, since the user would get a dialog asking if the web page should be openened in the browser or using the app that was installed.

If the app is started, it pulls in additional payloads. The video talks about replacing the Paypal app. That would require a user to enable the "Unknown sources" option on their phone, triggering a warning dialog. Then the replacement app would be installed manually by the user, no Google Play Store involved. The video actually shows that the user has to confirm installation and it has very different UI compared to the normal install UI.

When that happens, the app can steal information and data, but still within the app sandbox. For example, it couldn't steal data from your banking app.

Now everything after 3 minutes into the video is something that is not a new way of exploiting Android devices. In fact, most malware that is coming from what ever source (alternative app stores, torrent sites etc) would act this way. 

IMHO the video is biased and not very scientific in a multiple ways:
- It assumes your browser can be easily hacked, but I'll let that slide
- It assumes that malicious apps can live long and prosper on Google Play and they show an app being installed that does not have a malicious payload (as far as I can tell).
- They don't show you the prompts and security warnings an Android phone would show you in this scenario.

Here's the video: https://www.dropbox.com/s/jd45lfnkefb4lp1/mitbandroid-vo3.mp4?dl=0
Article (Dutch): http://www.volkskrant.nl/tech/groot-lek-in-android-telefoons~a4089416/
And how launching an app from the browser would really look: https://twitter.com/botteaap/status/614784118883287041
Shared with Dropbox
39
12
Duncan Whyte's profile photoVincent Pluk's profile photoGabor Orosz's profile photoAnders Johansen's profile photo
34 comments
 
By the way, I'm by no means doubting that malware can make it to Google Play. What I implied is that there are checks in place and that malware would probably get pulled fairly fast, compared to a site hosting a random apk somewhere. Just some more nuance :)
Add a comment...
Hugo's Collections
People
Have him in circles
1,454 people
Jeff Axelrod's profile photo
Benjamin Richardson's profile photo
Miguel Aragues's profile photo
Andre Salomons's profile photo
Nino Nanitashvili's profile photo
David González's profile photo
Aran Arunakiri's profile photo
raul gallart's profile photo
Michael Ritchie (ThanksMister)'s profile photo
Basic Information
Gender
Male
Story
Tagline
Rocking the bytecodes
Introduction
Google Developer Expert, passion for Android, developer, made the Rainy Days app, owner at Little Robots, organiser at The Dutch Android User Group, likes to DJ, pretty square otherwise.
Work
Occupation
Android developer by day and night.
Employment
  • Little Robots
    Main Robot, 2014 - present
  • Dutch Android User Group
    Organizer, 2013 - present
  • Qbus
    All things tech, 2010 - 2014