Profile

Cover photo
Cyril Mottier
Works at Capitaine Train
Attended INSA de Rennes
Lives in Lyon, France
11,434 followers|6,489,635 views
AboutPostsPhotosYouTubeReviews

Stream

Cyril Mottier

Shared publicly  - 
 
New "-round" resource qualifier in Android M Preview 2
 
Round screen layouts are now part of the `Configuration`[0] in Android M preview 2. In other words, this new addition introduces a shiny new "-round" resource qualifier that allow developers to have different layouts between round and rectangle screens (as you can currently do with WatchViewStub[1] for instance).

What does all of that mean? Well, if this addition makes it to the Android M release, "hacks" around WindowInsets.isRound()[2] and use of WatchViewStub will finally be over.

[0]: http://developer.android.com/reference/android/content/res/Configuration.html
[1]: http://developer.android.com/reference/android/support/wearable/view/WatchViewStub.html
[2]: http://developer.android.com/reference/android/view/WindowInsets.html#isRound()

#androiddev   #android   #gde   #article  
147
52
Héctor Júdez's profile photokalpana chaurasia's profile photoVk Hooda's profile photoPedro Paulo Amorim's profile photo
4 comments
 
+Kelly Merrell​ round-xlarge: the Android mirror 
Add a comment...

Cyril Mottier

Shared publicly  - 
 
While travelling to the Android Developer Days, I had plenty of time to get bored. For some reasons, I started to play with the official Android Clock app and noticed some possible improvements.

Here is my Android Clock app clinic notes: http://cyrilmottier.com/2015/05/14/the-android-clock-app-clinic/
72
16
Javier Pinedo's profile photoZhelyazko Atanasov's profile photoGabriel Pozo's profile photoEric Hung's profile photo
2 comments
 
+Jaleel Akbash Here is the video of Droidcon Paris. https://www.youtube.com/watch?v=ekN2zvFytZk. The talk at ADD was basically the same.
Add a comment...

Cyril Mottier

Shared publicly  - 
 
 
Decided to spend the evening updating my floating label implementation, FloatLabelLayout, to match the Material Design spec[0].

The text growing/shrinking animation needs a bit more work but it's mostly there. I've also started using ViewCompat#animate() so that we're backwards compatible back to API v4 (although the animation will only work in API 14+).

You can find the source on GitHub: https://gist.github.com/chrisbanes/11247418

#AndroidDev   #MaterialDesign

[0]: http://www.google.com/design/spec/components/text-fields.html#text-fields-floating-labels
122
29
smine yang's profile photoFred Muiru (freddIeptf)'s profile photoDanish Aziz's profile photoTony Guo's profile photo
5 comments
 
Hi can u tell me about this please thank u
Add a comment...

Cyril Mottier

Shared publicly  - 
6
2
Julien Banse's profile photoEric Grall's profile photo
Add a comment...

Cyril Mottier

Shared publicly  - 
 
 
Hi, we have began to discuss in this Dart Google Group how Dart support to build real native Android applications (running in Dalvik or ART, not in Dart VM) could be implemented by using the new Jack and Jill compilers provided with Android Lollipop, and we would be really interested to see Android developers joining the discussion ...
Google Groupes vous permet de créer des forums en ligne et des groupes de messagerie avec une interface enrichie pour les discussions de groupe, et d'y participer.
35
8
Philipp Ebert (ultrah)'s profile photoDavid González's profile photoGiovanni Laquidara's profile photoStefan M.'s profile photo
 
+Cyril Mottier great to see you interested in Dart : )
Add a comment...

Cyril Mottier

Shared publicly  - 
 
Dealing with spacing in grids on Android is not always straightforward. There are some tricks though, one of which consists on using android:divider on LinearLayout.

In order to better explain the technique, I have just published a blog post that explains the idea in details. I hope this trick can be useful to you. I personally use it extensively.

http://cyrilmottier.com/2014/11/17/grid-spacing-on-android/
Most user interfaces - on both mobile and web - are based on a notion of grids. Grids basically consist on splitting the user interface in a bunch of …
134
67
Cristian Garcia's profile photozhang qi (stormzhang)'s profile photoHamouda Ahmed's profile photoAdam Graves's profile photo
6 comments
 
It's quite helpful!Thank you!
Add a comment...
Have him in circles
11,434 people
Jose Manuel Arenas García's profile photo
Quentin Dommerc's profile photo
fan ei's profile photo
Fatoumata Bintou SALL's profile photo
Daniel Stoinov's profile photo
Fredrik Hammarström's profile photo
Sven Jacobs's profile photo
Alex Danvy's profile photo
Luong Bui's profile photo

Cyril Mottier

Shared publicly  - 
 
The status bar height in the Android M developer preview is changing. It is now 24dp tall in order to match Material Design quidelines (previously 25dp). From what I remember, it is also the first change in height since Android 1.0.

#AndroidDev   #Android   #gde   #blogpost  
291
88
Tijmen Ennik's profile photoLimbani Bhavik's profile photoMilan Samardžić's profile photoBob Peng (xifan)'s profile photo
22 comments
 
And the xml variable is probably still private ...
Add a comment...

Cyril Mottier

Shared publicly  - 
 
Introducing a new <tag /> XML tag to attach info to Android Views

It is no secret, the Android framework has a very open, large and verbose API. It basically lets developers create everything they want as long as they have a clear idea of the final product. However, there are some cases where framework capabilities are not obvious because they are not well documented or just hidden in the verbose API. This is especially true when dealing with the Android View ecosystem. In this post I would like to discuss about how to attach information to a View.

The framework comes with several ways allowing developers to attach information to a View. Some of them have always been available while some other are relatively new. In order to better list these techniques, I have split the post in several parts. Each part relates to an API level.

Android 1.0

Being a object oriented programming language, Java has always offered an easy way to add information to an object: inheritance. The language lets developers prevent this by either making the constructor private or the class final. But because Views have been designed for inheritance, it is quite simple to extend a given class and add information. For instance, you can add information to a TextView creating a TextViewWithData which extends TextView.

Inheritance works great but has one main problem : it is not global. If you want to be able to add info to all View classes, you have to extend all of them creating a "shallow" copy of the framework classes.

Actually, Android has always allowed developers to attach/retrieve information at the View level. This is done thanks to the setTag(Object)[0] and getTag()[1] methods. Android also provides a android:tag[2] XML attribute you can use directly attach a String tag to a given View. In general, you should use findViewById(int) in order to retrieve a given View in a View hierarchy. However, there are some cases where getting a View with a particular tag can be handy. This can be done using findViewWithTag(Object)[3].

Android 1.6

API 4 introduced a new way to attach tag objects to Views. Indeed, both setTag(int, Object)[4] and a _getTag(int)[5] were introduced. The main advantage of these methods was it was possible to add several tags to a View. There are some requirements though: keys had to be a resource identifier (i.e.@+id/something). In practice, these methods were introduced to store references to child Views.

Although these methods methods looked nice it was strongly discourage to use them because the implementation was mostly leading to memory leaks. Indeed, tags were actually held in a static global pool. You can have a look at [6] and [7], and more specifically +Adam Powell comment, to better understand the issue.

Android 4.0

The internal implementation of setTag(int, Object) finally changed in Android 4.0. A switch to a non static SparseArray local to the View itself was made. In other words, starting API 14, it is now safe to use setTag(int, Object) to store references to child Views in the hierarchy.

Android 5.0

Recently, API 21 introduced a brand new way to attach information to Views straight from the XML definition of a layout. A new XML tag <tag /> were in introduced in LayoutInflater allowing us from attaching text information to the parent View. If you like deep diving into the Android source code, you can have a look at +Alan Viverette's commit[8]. Here is an example of how to use it:

values/ids.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <item format="reference" name="btn_state" type="id" />
</resources>

activity_tag.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <Button
        android:id="@+id/btn_negative"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="@android:string/cancel">

        <tag
            android:id="@id/btn_state"
            android:value="@string/btn_state_negative"/>

    </Button>

    <Button
        android:id="@+id/btn_positive"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="@android:string/ok">

        <tag
            android:id="@id/btn_state"
            android:value="@string/btn_state_positive"/>

    </Button>

</LinearLayout>

The new <tag /> tag brings a new way to statically attach information to a View. It's now up to you to determine some great use cases to this new LayoutInflater-interpreted XML tag.

[0]: http://developer.android.com/reference/android/view/View.html#setTag(java.lang.Object)
[1]: http://developer.android.com/reference/android/view/View.html#getTag()
[2]: http://developer.android.com/reference/android/view/View.html#attr_android:tag
[3]: http://developer.android.com/reference/android/view/View.html#findViewWithTag(java.lang.Object)
[4]: http://developer.android.com/reference/android/view/View.html#setTag(int, java.lang.Object)
[5]: http://developer.android.com/reference/android/view/View.html#getTag(int)
[6]: https://code.google.com/p/android/issues/detail?id=18273
[7]: https://plus.google.com/u/0/+NicolasKlein/posts/2cH1tw3bCy9
[8]: https://github.com/android/platform_frameworks_base/commit/451a3417e97d9d3bb835290a65f9af30b112c789
226
139
zhang qi (stormzhang)'s profile photoByron Jones's profile photoDanish Aziz's profile photoZsolt Boldizsar's profile photo
11 comments
 
Hi share mom
Add a comment...

Cyril Mottier

Shared publicly  - 
 
A Story of Software Development Methodologies

I have been asked several times how to deal with release cycles of a mobile application. I don't think there is a perfect way to deal with such problems. I just wrote an article that describes how this is done on large Android applications project like Capitaine Train:

http://cyrilmottier.com/2014/12/09/a-story-of-software-development-methodologies/

#gde   #blogpost   #android  
I have been recently asked how the Android team at Capitaine Train is working: “How often do you release new versions of the application?&rdquo …
148
63
Jacob Nørskov's profile photoSpencer Riddering's profile photoHesamedin Kamalan's profile photonorman ho's profile photo
Add a comment...

Cyril Mottier

Shared publicly  - 
 
Hmmm what to say about this great post? I think the image below is just self-explanatory :-)
 
Android Wear round device frame

I just published an Android Wear round device, based on +Cyril Mottier​'s Android Wear Flat Device Frame [0].
It uses the actual screen resolution (320x320 pixels) of one of the currently available round Wear devices: the LGE G Watch R.
This frame can be very useful to promote wear apps or to be used in amazing presentations.

You can download it for free (licensed under the CC BY 3.0) here: 
http://goo.gl/GaW0Yf

[0]: http://cyrilmottier.com/2014/07/31/android-wear-flat-device-frame/

#androiddev #androidwear
32
4
J.L H's profile photoEric Hung's profile photo
Add a comment...

Cyril Mottier

Shared publicly  - 
 
A quick interview I made during Devoxx 2014 about Android Wear. I mainly explain what's new in Android Wear for Android developers and also give some use cases such as the application I worked on right after the unveiling of the Android Wear SDK at Google I/O 2014: Capitaine Train for Android Wear.

PS: Thanks, +Alexis Moussine-Pouchkine and (really) sorry for interrupting you several times :s
81
15
Eric Hung's profile photoPatrick Merlot's profile photoJ.L H's profile photoDmitry Shabalin's profile photo
 
Very nice interview +Cyril Mottier!! :-)
Add a comment...

Cyril Mottier

Shared publicly  - 
 
Quick Access to your Application Notification Settings

Android Lollipop is coming soon and brings a lot of improvements from a user perspective. One of the major visual enhancement is obviously Material Design. But Android Lollipop also includes richer and more interactive notifications.

Android has been providing notification settings for quite a long time now. These settings are available by long pressing a notification. Unfortunately, these settings were clearly suffering from a lack of controls as they were global to your application. Disabling notifications for a particular app was forcing the system not to display any of the following notifications (even Toasts…).

Starting Android Lollipop, the system UI gives a finer control over notifications. For instance, it is now possible to tweak how your app's notifications are shown based on their priority or how sensitive they are. But there is more! It is now possible to add a quick access button that brings users right to your application notification settings. This new quick access button (the "gear" icon is the screenshot below) is available just by long pressing a notification triggered by your app in the notification tray or right from the lock screen.

Implementing such a notification settings quick access inside your application is very easy and requires only a few lines of code in your AndroidManifest.xml. The trick consists on adding a new <intent-filter /> with the INTENT_CATEGORY_NOTIFICATION_PREFERENCES[0] category to your notification preferences Activity:


<activity
    android:label="@string/settings_title"
    android:name=".SettingsActivity">

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
    </intent-filter>

</activity>

Adding this new <intent-filter /> to your application is fairly simple. I highly encourage you to do so as it can prevent your users from completely muting your notifications or even uninstall your application because they consider it as too noisy.

[0]: http://developer.android.com/reference/android/app/Notification.html#INTENT_CATEGORY_NOTIFICATION_PREFERENCES

#gde   #android   #article  
215
97
Alejandro Tellez's profile photoAlexander Savin's profile photoStephan Schmitz's profile photoSeyed Mohammad Hossein Mayboudi's profile photo
21 comments
 
Thank you.
Add a comment...
People
Have him in circles
11,434 people
Jose Manuel Arenas García's profile photo
Quentin Dommerc's profile photo
fan ei's profile photo
Fatoumata Bintou SALL's profile photo
Daniel Stoinov's profile photo
Fredrik Hammarström's profile photo
Sven Jacobs's profile photo
Alex Danvy's profile photo
Luong Bui's profile photo
Collections Cyril is following
Education
  • INSA de Rennes
    Computer Science, 2006 - 2009
Basic Information
Gender
Male
Story
Tagline
A curious guy always looking for new challenges.
Work
Employment
  • Capitaine Train
    Mobile Software Engineer, 2013 - present
  • Prixing
    Lead Mobile Software Engineer, 2012 - 2013
  • Greencopper
    Mobile Software Engineer/Technology Manager, 2010 - 2012
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Lyon, France
Previously
Paris, France - Vannes, France - Rennes, France - Helsinki, Finland
J'ai toujours une appréhension lorsque je vais chez le dentiste. Mais le personnel et notamment le docteur Bernard ont su me mettre à l'aise et cela m'a permis de me détendre et de mieux vivre les soins. Merci à eux. Les locaux sont aussi très accueillant et rassurant : une hygiène impeccable et du matériel dernier cri.
Public - in the last week
reviewed in the last week
1 review
Map
Map
Map