Profile cover photo
Profile photo
Stratos Theodorou
Android, UX, Games and Stuff...
Android, UX, Games and Stuff...

Stratos's posts

Post has attachment

Post has shared content
There goes pixel-perfect. Hello pixel-plus-one-perfect!

Post has shared content
Here is your chance to get 5 free tickets from +GDG Thessaloniki to the first ever happened +droidcon in Greece on September the 10-12, 2015 in #Thessaloniki .

The first 5 followers who rightly spot out the venue where +Droidcon Greece is going to happen in Thessaloniki, will be granted one VIP ticket each to attend to the first #droidconGR  conf in Greece!

Disclaimer: from the competition are excluded members of the droidcon team, partners and their relative, as well as external collaborators

1. Choose from the list below
2. Share the post and write with these hashtags  #droidconGR   #droidcon    #droidconGRvenue  your choice.
3. You will have till Monday the 20 of July to be able to access the competition, all other shares or reshares and answers will not be considered

We will announce the winners by mentioning them on our Google+ page

Fingers crossed to everybody!
24 votes
votes visible to Public
Poll option image

Post has shared content
LinearLayout-like FrameLayout? I want it!! #androiddev
Apparently the release 22.2.0 of the support libraries also includes a library with a PercentFrameLayout and PercentRelativeLayout class.

2 Photos - View album

Post has shared content
More cheese for Android developers! #androiddev
More Material Design with Topeka for Android

#Materialdesign is a new system for visual, interaction and motion design. We originally launched the Topeka web app as an Open Source example of material design on the web.

Today, we’re publishing a new material design example: the Android version of Topeka. It demonstrates that the same branding and material design principles can be used to create a consistent experience across platforms.

Learn more on the Android Developers blog:

Animated Photo

Post has shared content
Because Developing for Android was published as a series of chapters (we didn't want to bury everyone in its hugeness all at once), I've posted this as a "Contents" list to the chapters. I've also added a Contents section to the Introduction chapter.

Developing for Android
The Whole Frigging Thing

Post has shared content
Composition over Inheritance
What it means for your Activities

So we've all heard the suggestion that we should prefer composition over inheritance. For those that haven't, the idea is classes should only inherit from classes if they can fully stand in for their parent class, not just to share some behavior (more information at [0]). Despite this, I can't count how many Android projects I've been on/seen that had some BaseActivity that all of their Activities must extend from.

This can be problematic on a few fronts. The most obvious is that when Joe Newguy comes in and adds ShinyFeatureActivity, there's nothing forcing him to make sure it extends BaseActivity. Hopefully it's caught in code review. Additionally, it prevents you from extending from any other Activity class (E.g. PreferenceActivity, ListActivity...). Many of these Activity subtypes have been replaced by Fragment subtypes, but not all. Some libraries might also need their own Activity subtype.

Somewhat more insidious is that you might have some behaviors that are used in several of your Activities, and another set of behaviors for another group of Activities. Since Java doesn't support multi-inheritance, you have no choice but to put all of the behaviors into a single base class if these groups overlap. That means reduced maintainability, and possibly some performance penalties.

It's easy to see why we like to do this. Code reuse is a good thing, right? And much of our common logic needs to happen at specific points in the Activity lifecycle. Application.ActivityLifecycleCallbacks can be a pain to work with (they're passed Activities rather than living in them) and likely need to be registered in Application.onCreate() which we try to avoid.

This is where headless Fragments come in. While a lot of Android developers think of Fragments as UI components, they're really more lifecycle components. So what do I mean by "headless"? Just that onCreateView() either isn't overridden or returns null. Essentially, these are Fragments that implement some process or control that doesn't have a UI itself.

To differentiate my headless Fragments from my View oriented Fragments, I've taken to suffixing my headless Fragments with "Helper" and other Fragments with "Fragment". For example, AnalyticsHelper would be a headless Fragment for attaching my analytics logic, while HeaderFragment shows a header View for something. This is totally optional, but I've found it helpful.

Since there is no UI for these Fragments, there is no layout ID necessary to inflate into or animations to worry about, so your factory methods can be smarter and more controlled. For that matter, they can handle adding the Fragment themselves. I've created a gist [1] that shows how to do this. In Android Studio, you can add this to the "File and Code Templates" section in settings, and when you create a new class (New -> Java Class), select it in the "Kind" dropdown.

Adding FooHelper to its parent is as simple as calling FooHelper.attach(this). You'll get compiler errors telling you if the parent doesn't implement FooHelper's callback interface, and if attach() had already been called, it will return the preexisting fragment. The gist includes overloads for framework Fragments and Activities, but switching them to use support Fragments and FragmentActivity is pretty trivial. It also includes a getParent() that is a simplified version of my FragmentUtils.getParent() gist [2].

Obviously headless Fragments are more useful than just getting stuff out of your BaseActivity. They're also great for encapsulating processes that need lifecycle callbacks (or onActivityResult(), or a child FragmentManager...). The great thing about replacing BaseActivity, though, is that now you can split up the "common" logic onto single-purpose modular components, and decide for each Activity which modules you actually need. If most of your Activities need a lot of the same modules there's no reason you couldn't write a CommonComponentsHelper to pull them in, but now you're not forced to keep all your common dependencies in one base class.


Post has shared content
I totally agree. Data Binding sounds very promising and I also loved the (long awaited for) fine-grained permissions at runtime. Otherwise, nothing too special.
Many thanks also to the android tools team for making our lives easier! Great announcements yesterday.
Except for Data Binding Library, GCM for iOS and topics subscription and Support Design Library, I personally think that this year's I/O has not met my expectations.

Still waiting to see the Brillo project live with all its goodies (Weave etc.).

P.S.1:Hope that the Data binding Library will grow enough to be a default way of constructing Apps in Android. It really is powerful at least Developer-friendly wise. Got to see it performance-wise though!

Android design support library!!! Yes, baby! #io15

Post has shared content
More material, more fun!
Get ready for even more material design

Google I/O 2015 kicks off tomorrow, and we’ve got an exciting lineup of design-focused content to experience both in-person and online. This year, we’re focusing on the ways we’re making it easier than ever to design and develop in material—with added assets and resources, backwards compatibility, and continuous updates to our design guidelines. We’re also celebrating some of the inspiring ways designers and developers have started to bring material design to life in their own products. Tune in at 4PM PDT on Thursday, May 28, to hear Matias Duarte’s “Material Now” session (, to get a complete overview, and keep a look out for more updates.

#io15   #materialdesign  
Wait while more posts are being loaded