Showing posts with label rant. Show all posts
Showing posts with label rant. Show all posts

Saturday, January 03, 2026

Bad Ideas with Obfuscation

All my release versions of my Android apps are obfuscated with Proguard - which us quite usual.

However, it is a bad idea in some circumstances:

When you rely on reflection.

Sounds rather obvious, but sometimes you "dont know" this happens. Like when you serialize and deserialize JSON/XML data ("Rest") via Jackson
It is obvious, isn't it, but a couple of years ago it took me ages to find.

When you rely on class names.

Also rather obvious. What I did was have a listener class that will be asked if it wants to receive certain updates, and one of the parameters was the Class data that changed. Think of it like "Do you want to know if any of those Favorites changes?" and passing the "Favorite" class as a parameter,.
The listener has a 
public boolean wantsUpdatesFor(Class<?> clazz)
{
return Favorite.class.equals(clazz);
}
Worked fine in debug, didn't work in release. The main difference was of course obfuscation.
I removed it for those classes (or rather the whole package of them) et voilĂ  worked again

Conclusion

If you find something works fine in debug but not at all in release, it's not always the emulator or its Android version or something like that, look at obfuscation was well and maybe remove it for a quick test.
(Or create a no-obfuscation build variant for that).

Wednesday, November 26, 2025

Read the effing Docs

Yeah, not really news, but just fell into one of those traps, where you not only forget/fail to fully read the documentation, but also fall prey to premature optimization.

It probably dates back to my 8086-Assembler-4.77MHz programming times, that I want to avoid an API call whenever possible - so if their result appears invariant, I happily store if to avoid a second call.

40 years later, when working with Android RecylcerViews, this led to a terrible bug that cost me 2 days to identify and fix.

As the docs say for onBindViewHolder (for the RecyclerView.Adpater)

Note that unlike android.widget.ListView, RecyclerView will not call this method again if the position of the item changes in the data set unless the item itself is invalidated or the new position cannot be determined. For this reason, you should only use the position parameter while acquiring the related data item inside this method and should not keep a copy of it. If you need the position of an item later on (e.g. in a click listener), use getBindingAdapterPosition which will have the updated adapter position.

In order to pass the adapter position down to an onClick lambda, I even — specifically — made it final.

No wonder, that the code didn't work correctly in some — albeit very rare — circumstances, e.g. when an item further up in the list got removed from the view / adapter.

Again, reading the above would make it clear that this was not a time for premature optimization.

I think I should avoid those optimizations at all, the compiler and jvm is quite good at it anyway — especially identifying invariant function calls. Moreover, Android phones no longer run on 4.77MHz CPUs ;)

Lesson learned.

Wednesday, December 28, 2022

OxygenOS 13 missing per-app language

A couple of weeks ago I got the Android 13 / OxygenOS 13 update for my OnePlus 9, looking forward to the per-app language feature from Android 13.

Reason for that is, that I just like to run my devixes in English, but some local (i.e. Austrian or German) apps just have terrible translations, or I am just not in an "English context", i.e. when Banking or doing my taxes.

Some apps of course can set the language within the app, but some just take the system settings.

Android 13 allows to override this (with a tiny little help of the app, it only has to declare in the manifest which languages it actually has translations for).

But it appears OxygenOS13 failed to implement exactly that feature.


Bummer.

Sunday, July 02, 2017

Instagram is weird...

So I posted two (only 2 !!) pictures of a garden on instagram, and all of a sudden I get dozens of followers with garden-related accounts/names. I did not even tag those images as garden-something....


Weird


.

Sunday, February 21, 2016

MWC 2016 - need to go offline

So, as every year, just after CES the Mobile World Congress in Barcelona is starting right now. Time to go offline for a week... or be bored to death with all the new phone, screen, GHz, multicore and VR announcements.

Friday, September 25, 2015

The iOS9 Podcast app is totally broken

Usually I hate and hence avoid to slam an app or service like this, but the podcast player in iOS9 really sucks. At least for video on an iPad.

No full screen video anymore, too much white space, and even with all that unused space, the controls are too small

Exhibit A:

Please Apple, we need an urgent update to fix/revert this.

Wednesday, July 22, 2015

Publishing in the 21st Century

I always found that one of the core features or tasks of a publisher it to spend money made with best-selling artists on the newcomers. This applies both to publishers of music (a.k.a. labels) and literature.
Call it a cross-subsidy (and yell fire if you are too neo-liberal for this).

Over the last decades it appears that this is no longer the case.  
It seems that corporate financial controlling measures are being applied to each author or book of its own (or artist/album), and if it can not turn a profit, it will not be published. Profits from say Harry Potter [1] stay with the Harry Potter team and division and are not invested to find the next promising author.
That's because everyone hates cross-subsidies. Even within one company.

I especially find this is the case in music:
Take the recent rant of Taylor Swift against Apple. She complained (whether rightfully or not) about the fact Apple will not pay the artists during the 3 months trial period, because they, Apple, themselves don't receive any money.[2] Let's for a second ignore whether this is fair or not, let's turn to a separate aspect:

Taylor Swift claimed in her open letter to Apple that she's is not complaining for herself (as she gets enough money) but for the young / indie artists:
This is not about me. Thankfully I am on my fifth album and can support myself, my band, crew, and entire management team by playing live shows. This is about the new artist or band that has just released their first single and will not be paid for its success. ...
So is she asking Apple to take on the role of a publisher? She is asking them to help (i.e. finance) the young artists. Shouldn't the labels be doing this with the revenues they already make?
Interestingly she does not mention that this could be done out of the revenue streams from her music, only from the young artists themselves. That's odd.

So this is only a little less greedy than actually asking for herself - as she claims this is not doing.
Not so philanthropic after all.

Where are the publishers or labels in all of this? By taking themselves totally out of this equation, they will get by-passed in the future. Why would anyone need a publisher, when they don't even fulfill one of their core tasks? What's the value of a label/publisher to a young artist?

Instead of greedily clinging to their old business model, which is falling apart, they should think of creating new and relevant offerings to their customers, i.e. the artists.



--
[1] I admit I have done the research on this author/book/publisher, I just use it as an example. Correct me in the comments if I'm wrong.
[2] Apple of course changed this after her open letter.

Friday, July 11, 2014

How sorting gets ruined.

Frequent readers - or close followers - of this blog will know, that the share feature (SEND intent) is one of my favourite features on Android.

To recap: it allows any application to share content via (or send content to) any other application, e.g. email, facebook, google+, sms/text, bluetooth, ... You name it.
All that needs to be done is for the target app to register itself for handling certain content types, and then it can be picked by the user, whenever a suitable content type needs to be sent. Android will automatically generate the list of all apps that are available for this content.

So far, so god.

Now in order to be at the top of that list, most apps "fake" and "A" into this name. But this is getting out of hand.

Let me draw your attention to exhibit A:
Exhibit A - the share menu
So this makes the alphabetical sorting totally pointless.
This has to stop.

Next app will probably register itself with an underscore....

Reminds me of my times at Sun Microsystems not too long ago. Obviously a lot of things started with S there ... Sun, Solaris, SPARC, ... but then they created lines of business called Server, Storage, Software, Services.... So even when you sorted a list alphabetically, 90% would cluster under S...

Pointless.

Saturday, February 22, 2014

REALLY!?! - On the Problem of Incomplete Data

A couple of months ago, the Austrian Federal Railways (Ă–BB) opened their data for Google (maps). Whether this can be already considered "open data" or not, is not todays subject.  Wiener Linien (let's call them the Vienna Transport Authority) did not.

My concern is, that Google now has the time table data of the railways, but not of the (local) public transport in Vienna (underground, tram, bus).

Which leads to incomplete data for commuters in and around Vienna (within Google Maps), or a segment, which I in reverence of SNL like to call



REALLY!?!

So, because there is no underground/metro/tube data. Incidentally Ă–BB also operate the airport transfer bus, which happens to have a station right next to my office. And thus... Google Maps fills the gap in Vienna with a nice little transfer to the airport and back to my office... Because that's the only routing data (apart from walking) the find.

REALLY!?!
My regular commute time is around 50 mins.
So please, all, get your act together.

Thursday, August 01, 2013

Skydrive?

So, Microsoft will have to rename Skydrive...
BBC News - Microsoft made to rename Skydrive after BSkyB victory:

Makes me chuckle, and to some extent mad... No one would confuse Sky (the TV network) and Skydrive. Really.

If this were IBM, this could never have happened; they'd have clled it  'DDSF' from the start - as in 'Dislocated Data Storage Facility' :)

Sunday, July 14, 2013

HTC confirms One S will no longer receive Android updates

Crap, crap, crap. After only one year.
This has been out for about 2 weeks already, but - optimist as I am - I wanted to wait for HTC to backpedal on this.

They didn't... so there.
HTC confirms One S will no longer receive Android updates:

"We can confirm that the HTC One S will not receive further Android OS updates and will remain on the current version of Android and HTC Sense. We realize this news will be met with disappointment by some, but our customers should feel confident that we have designed the HTC One S to be optimized with our amazing camera and audio experiences."

Yeah, "confidence" is what I feel... right...

Saturday, May 04, 2013

How not to share on Android

This morning my wife told me that one of our favorite restaurant guides for Vienna (Wien, wie es isst) now has an Android app. I knew this app from the iOS version (earlier on my iPod touch) and I had not been impressed by it - largely because of the required paid subscription and lack of features.

Well, half an hour later she found a review of a new restaurant in Vienna, which we decided to try soon, and she wanted to make a note of this (address, phone, ...) in Evernote.
When I saw her typing like there was no tomorrow, I asked here, why she did not simply share this restaurant from the guide app to Evernote.

Well, turns out, you can't.  Because those (strong language deleted here) developers decided not to properly implement the share functionality (with the Android SEND intent), but implement their own.

And guess what happens then: you only implement a view of the share functions / targets... and this is not what Android is supposed to be.

Of course, we can only find Facebook, Twitter and E-mail there, because the developer had no clue that I had e.g. Remember-The-Milk on my smartphone; or Evernote, or Google Keep for that matter, or any other app that might want to receive this information.

Simply freaking share with the SEND intent, please! It is easier, less effort (for the developer) and will actually fit the user's needs and expectations. That's why it is there.

Wednesday, May 01, 2013

One of thoooose popups


So, which is it...
Cancel or Stop ?




Well in this case at least it can be resolved: Cancel cancels the stopping of the download, i.e. resumes the download.

Developers and Designers, listen to me!
You have to pay more attention to  wording and/or translation.

Thursday, March 14, 2013

Tuesday, February 26, 2013

Repair while you wait

Since I'm still waiting for the Jelly Bean upgrade for my HTC One S (the "new" one I bought to replace the one with the broken glass, the one with the S3 processor) I did enough JB Testing on the "old" one (the one with the broken glass) ... I finally brought it in for repair ... hope to have it back soon, so I can go back to my "old" phone with the "new" Android version.

My, this sounds odd.
And only because ${expletive} HTC still did not release JB for some of the S3 processor versions on the One S... Arrrrrghksdfkjh


Tuesday, January 08, 2013

Why, Flickr, Why ?

As much as I like the new flickr app for iPhone [1] and Android, I wonder, why they could not decide on one layout for the toolbar

The above is from iPhone, the lower is from Android.


Why, Flickr, why ?


--
[1] actually, I use it on my iPad, but there is no HD version yet, so I have to use the iPhone version... room for another rant :)

Monday, December 24, 2012

You're asking me, Google?

Have a smartphone or tablet? Get Chrome for Mobile
Oh c'mon, Google, you know anyway. Why are you asking me?
Especially since I'm using chrome on my Android as the default browser.

Friday, November 30, 2012

I Hate Apps That...

... are only a badly written container for HTML, without any proper error handling...


And btw: this is not Android specific...

Monday, May 28, 2012

Oh, Google...

Google not only just renamed their docs to Google Drive, a couple of weeks later they also released a new iOS app for faster access, more responsiveness on the suggestions, etc etc...

Why, oh Google, did you guys forget to rename Google Docs in this app ??


Sunday, May 13, 2012

Why do I have to manually set the time on a Kindle?

Granted, I'm still spoiled by ye good olde Palm (Pilot).

So one thing that really annoys me is when the clock on my gadgets get totally out of sync.
Like 1hr 5min on my Kindle 3 - ok, the 1hr most probably stems from DST and not from an inaccurate clock, but still.

I expect my connected devices to get their time from the network (or from the PC, depending on how they are connected).

Why can Whispersync synchronize books and my position within this book, but not get the time from some source on the net? Or the PC when I connect the kindle via USB?

This is annoying.

To fix the time you have to go to Home > Settings > page 2 > Device Time > ...