Profile

Cover photo
Udi Cohen
Works at Facebook, Inc.
Lives in New York, NY, United States
751 followers|1,311,959 views
AboutPostsPhotosYouTubeReviews

Stream

Udi Cohen

Shared publicly  - 
 
RIP CyanogenMod.
Cyanogen Inc. has announced that all support of CyanogenMod will cease, and will live on as LineageOS. What does this mean for developers and users?
1
Add a comment...

Udi Cohen
owner

Discussion  - 
 
Version 0.5.0 was released today!

What's new?
----------------------- - New design.
- Support for Groups of shows
- Bug fixes

Keep up with the great feedback. I would love to hear what you have to say about the new design and the new Groups feature.
1
Add a comment...

Udi Cohen

Shared publicly  - 
6
Nicola Dorigatti's profile photoUdi Cohen's profile photoArvid Gerstmann's profile photoUzair Mohammad's profile photo
5 comments
 
Awesome!
Add a comment...

Udi Cohen
owner

Discussion  - 
 
Version 0.4.1 was released.

What's new:
- Stability fixes
- Better network performance
1
Add a comment...

Udi Cohen
owner

Discussion  - 
 
Version 0.4.0 was published.

What's new:
- Better Search and Add experience
- Performance enhancements 
- Stability fixes
1
Add a comment...

Udi Cohen
owner

Discussion  - 
 
+Amir Shapsa Hi!
You mentioned that Grabag is crashing when you open it. Can you share what device and OS version are you using?

Thanks!
1
Add a comment...

Udi Cohen

Shared publicly  - 
 
Oh Amazon..you're lucky I'm addicted to your 2-days shipping..
Starting at the end of this month, Amazon will no longer sell the Chromecast or Apple TV. And that’s their right. But it’s also another in a long series of dumb, anti-consumer moves that has now crossed the line from annoying to downright dickish.
1
Add a comment...

Udi Cohen

Shared publicly  - 
 
I wrote a post for Facebook's engineering blog about performance optimization on Android.

We were using a HashSet for holding Long and Int values. After checking our memory footprint, we decided we can avoid all the autoboxing by creating a more optimized data structures.

In this post you can read how we found the problem, the options we had and what lead us to the chosen solution.

#perfmatters #androiddev

https://code.facebook.com/posts/857070764436276/memory-optimization-for-feeds-on-android/
Creating an optimized data structure led to a reduction in allocations and an overall improvement in memory efficiency.
23
24
danjuma kolo's profile photo
 
+Udi Cohen​...saw your aosp build guide.,..
Supposed I wanna build aosp nougat for a non Google device like OPPO n1.I was told I have to tinka to get device tree,kernel tree and vendo blobs....are these same with drivers u talked about?..if no can u give a step by step guide on how to create these 3..also what's the relationship btw android 7 and the soc...I was told some features may not work if nougate is built on Qualcomm not above 800.

Lastly sopposing I get the device tree of cyanogen 11 for OPPO n1,can I use it to build nougat for OPPO?
Add a comment...

Udi Cohen

Shared publicly  - 
 
Nice feature.

I'm not sure why the aspect ratio attribute is represented as a percentage, instead of a float for example (16:9 ->1.77). It's more natural.

Could it be that it was causing performance degradation when inflating the layout?
 
Use a fixed aspect ratio with the Percent Support Library 23.1
Pro-tip by +Ian Lake

The Percent Support Library (https://goo.gl/KbnO7W) makes it easy to set dimensions and margins in terms of a percentage of the overall space. In the 23.1 release (http://goo.gl/Ohd5Sy), it also gained the ability to set a custom aspect ratio via app:layout_aspectRatio.

This allows you to set only a single dimension, such as only the width, and the height will be automatically determined based on the aspect ratio you’ve defined, whether it is 4:3 or 16:9 or even a square 1:1 aspect ratio.

So building a navigation drawer header with a 16:9 background image would look like:
<android.support.percent.PercentRelativeLayout 
  android:layout_width="match_parent"
  android:layout_height="wrap_content">
  <ImageView
    app:layout_widthPercent="100%"
    app:layout_aspectRatio="178%"
    android:scaleType="centerCrop"
    android:src="@drawable/header_background"/>
  <!-- The rest of your layout -->
</android.support.percent.PercentRelativeLayout>

You’ll note we use layout_widthPercent instead of layout_width - this ensures that the height is not erroneously set to 0dp before the first layout pass is done and ensures the aspect ratio is always correctly computed based on the current width.

So how did a 16:9 aspect ratio turn into 178%? Our target 16:9 aspect ratio can also be expressed as a 1.78:1 ratio or equivalently, a width 178% of the height. This is the format the layout_aspectRatio expects.

Of course, you can also define the aspect ratio in separate XML files with code such as:

<item name="header_aspectRatio" type="fraction">178%</item>

This makes it possible to change or reuse them across different form factors or layouts.

Material design designates a number of ratio keylines (http://goo.gl/OHeq6x) which you can use in your app, but you could also consider using this for list items (where you may be using ?android:attr/listPreferredItemHeight) with items such as a profile image or video thumbnail for a fixed aspect ratio.

You’ll be able to use this with PercentFrameLayout, PercentRelativeLayout, or through any custom ViewGroup using PercentLayoutHelper (http://goo.gl/BBxu6p).
17 comments on original post
1
Udi Cohen's profile photoIan Lake's profile photo
2 comments
 
This is just an artifact of using the 'fraction' resource type.
Add a comment...

Udi Cohen
owner

Discussion  - 
 
Hi all

I published an updated version to fix a crash on start time.

You should receive it through the Play store. Please let me know if you're still experiencing problems.
1
Add a comment...

Udi Cohen

Shared publicly  - 
 
Introducing "Grabag" - a simple way to watch TV.

I'm a big TV fan and I admit that I spend many hours a week watching TV, using streaming services as Hulu and Netflix. Sometimes I like to put on something random to watch while eating, working on my laptop or when friends are over, but it was always hard to decide what to put on. That's the reason I created Grabag.

With Grabag (Grab Bag) I can pick all the TV shows I like, and the app will randomly pick an episode for me to watch. I then have a direct link to open it on the streaming app, to start watching it right away. It's simple and saves me a few minutes of decision making every time.

When I told people about it, many have said they have the exact same problem, so I decided to release the app for beta testing and later have a public release. If you're interested in joining and installing the app (Android only at this moment), I wrote all the details in this post:

http://blog.udinic.com/2015/10/29/introducing-grabag
3
Dany Fernández Díaz's profile photo
 
Good idea :) .
Add a comment...
Story
Bragging rights
Lead Android developer for Any.DO
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
New York, NY, United States
Previously
Tel Aviv, Israel
Links
YouTube
Other profiles
Work
Occupation
Work @ Facebook NYC
Employment
  • Facebook, Inc.
    2015 - present
  • Samsung USA
    Head of Android dev, 2013 - 2015
  • Any.DO
    Lead Android Engineer, 2011 - 2013
Basic Information
Gender
Male
Great haircut!
Public - a year ago
reviewed a year ago
Food: Very GoodDecor: GoodService: Good
Public - 4 years ago
reviewed 4 years ago
2 reviews
Map
Map
Map