<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arturo Mejia on Medium]]></title>
        <description><![CDATA[Stories by Arturo Mejia on Medium]]></description>
        <link>https://medium.com/@arturomejiamarmol?source=rss-781ea8a76ce5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MmZaP7--55CMu34XkTn7-w.jpeg</url>
            <title>Stories by Arturo Mejia on Medium</title>
            <link>https://medium.com/@arturomejiamarmol?source=rss-781ea8a76ce5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 09:59:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arturomejiamarmol/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Creating a Simple browser with Mozilla Android Components.]]></title>
            <link>https://medium.com/firefox-mobile-engineering/creating-a-simple-browser-with-mozilla-android-components-b33349cde4d0?source=rss-781ea8a76ce5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b33349cde4d0</guid>
            <category><![CDATA[web-browser]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[mozilla-android-component]]></category>
            <dc:creator><![CDATA[Arturo Mejia]]></dc:creator>
            <pubDate>Mon, 05 Nov 2018 19:40:07 GMT</pubDate>
            <atom:updated>2018-11-05T19:40:07.221Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t4tg4blQaT1z3vkF.jpg" /></figure><p>At Mozilla, we have multiple teams that work on different Android browsers like <a href="https://github.com/mozilla-mobile/focus-android">Focus,</a> <a href="https://github.com/mozilla-mobile/firefox-tv">Firefox for Amazon fire TV,</a> <a href="https://github.com/mozilla-mobile/firefox-echo-show">Firefox Amazon’s Echo Show,</a> and <a href="https://github.com/mozilla-tw/Rocket">Rocket</a>. Those are all are browsers with different use cases but with similar behavior in common, with the goal of sharing functionality across products and rapid iteration creating new browsers the <a href="https://github.com/mozilla-mobile/android-components">Android Components project</a> was born.</p><p>The <a href="https://github.com/mozilla-mobile/android-components">Android Components</a> is a set of reusable pieces of software that allows you to mix and match different components to create browsers without having to reinvent the wheel every time.</p><p>In simple, words <a href="https://github.com/mozilla-mobile/android-components">Android Components</a> is a set of Lego blocks that you can easily combine together to create browsers. We have a large array of components to cater different needs from UI to bare bone interfaces to allow you to integrate your own implementations for completed flexibility.</p><p><a href="https://github.com/mozilla-mobile/android-components">Android Components</a> is a project in continuous development, we have many components that are in active development, and many more that are coming. You can know the status of each component, for the prefix-colored circle in front of the name of each component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fhG7ji7vJONrpzp_bftwg.png" /><figcaption>Components status.</figcaption></figure><p>For this blog post, we’re going to focus our attention on creating a Simple browser using <a href="https://github.com/mozilla-mobile/android-components">Android Components</a>. All the source code is available on this GitHub <a href="https://github.com/Amejia481/Simple-Browser">repository</a>, for every step that we achieve there is separated branch, this way you can see the diff between each step.</p><p>Imagine that you want to create a new browser and you need a toolbar and a web view to render content, instead of creating everything from scratch and doing the hard work, a wise choice could be to use <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/browser/toolbar/README.md">browser-toolbar</a>, <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/browser/engine-gecko/README.md">browser-engine-gecko</a>, <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/browser/engine-servo/README.md">browser-engine-servo</a> or <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/browser/engine-system/README.md">browser-engine-system</a> components, that have all the behavior that you are going to need pre-baked in.</p><p>To have a bit of context, let’s dive in what a web browser does and how we can achieve the same using <a href="https://github.com/mozilla-mobile/android-components">Components</a>.</p><h3>What’s a web browser?</h3><p>A browser is an application that allows us to browse web pages. Every time that you access an URL many things happened behind the scene:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z86ixgYT9FhkM4zdc3kr8g.png" /><figcaption>A basic representation of what a browser does.</figcaption></figure><ol><li>Imagine that you want to go to <a href="https://www.mozilla.org/">www.mozilla.org</a>. You type the URL <a href="https://www.mozilla.org/">www.mozilla.org</a> on the <strong>ToolBar</strong>.</li></ol><p>2. After you hit the enter key, this URL goes through a loading process that involves fetching the URL, downloads the associated content normally an HTML file then, this content goes to a <a href="https://en.wikipedia.org/wiki/Browser_engine">web engine</a> who is responsible for interpreting these files (rendering) and giving us back our shiny web page.</p><p><strong>Note</strong>: The HTML file is the skeleton of our web page, it contains everything that will define how our web page is layout (HTML tags), looks (CSS) and behave (JavaScript).</p><p>Let’s see how we can do the same with <a href="https://github.com/mozilla-mobile/android-components">Android Components</a>.</p><h3>Let’s get our hands dirty!</h3><p>The first thing that we’re going to need is a <strong>ToolBar </strong>where we can type URLs.</p><h4>1.ToolBar (<a href="https://github.com/Amejia481/Simple-Browser">Source Code</a>).</h4><p>A <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/browser/toolbar/README.md">toolbar</a> is a UI component that allows us to capture user typing interactions, like handling an URL, showing suggestions or trigger a search.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KqgL4c5M6ZXqK5Zz9qokqg.png" /><figcaption>Basic toolbar.</figcaption></figure><p>Also It can be a container for other widgets, that help the user to perform common tasks like navigating back and forward or reloading the actual page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdrVce3-jTVjBqNxUCG5fg.png" /><figcaption>Toolbar with buttons.</figcaption></figure><p>Luckily for us, the Android Components team has done all the heavy lifting 🏋️‍♀️ for us, building a component called <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/browser/toolbar/README.md">browser-toolbar</a> that allow us to just include a toolbar widget and customize it to our needs. By the way, all these nice images above are from it!</p><p>To include any component first, we need to add the Maven Mozilla URL to our repositories block in the root build.gradle file.</p><pre>repositories {<br>    maven {<br>       url &quot;https://maven.mozilla.org/maven2&quot;<br>    }<br>}</pre><p>And add the <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/browser/toolbar/README.md">browser-toolbar</a> component dependency:</p><p><strong>app/build.gradle</strong></p><pre>implementation &quot;org.mozilla.components:browser-toolbar:{latest-version}&quot;</pre><p>You can find the latest version of components <a href="https://github.com/mozilla-mobile/android-components/releases">here</a>.</p><p><strong>Note</strong>: All the component are segregate by modules, this way you only need to include just what you need 😉.</p><p>Now we can add our toolbar ui.</p><p><strong>activity_main.xml</strong></p><pre>&lt;<strong>mozilla.components.browser.toolbar.BrowserToolbar<br>    android:id=&quot;@+id/toolbar&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;wrap_content&quot; </strong>/&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UI9V6d3FCi14BFTZIrtLEQ.gif" /></figure><p>Now our browser has a <a href="https://mozilla-mobile.github.io/android-components/api/0.28.0/mozilla.components.browser.toolbar/-browser-toolbar/index.html">ToolBar</a> 😍 <em>yay</em>!!!</p><p>🤔 wait a minute, the URL doesn’t load 😅, lets the toolbar does the right thing.</p><p><strong>Note: </strong>You can find more advanced uses and examples of a toolbar in our <a href="https://github.com/mozilla-mobile/android-components/tree/master/samples/toolbar">Toolbar Sample app</a>.</p><h4>2. Web Engine (<a href="https://github.com/Amejia481/Simple-Browser/tree/step-2-web-engine">Source Code</a>)</h4><p>As I mentioned above in a web browser the component that takes cares of taking a URL and renders it into a website is called web engine. There are multiple <a href="https://en.wikipedia.org/wiki/Browser_engine">web engines</a> implementations but at the moment, <a href="https://github.com/mozilla-mobile/android-components">Android Components</a> offers support for <a href="https://en.wikipedia.org/wiki/Gecko_(software)">Gecko</a>, <a href="https://en.wikipedia.org/wiki/Servo_(software)">Servo</a>, and <a href="https://en.wikipedia.org/wiki/Blink_(browser_engine)">Blink</a>(Android Web View).</p><p><a href="https://github.com/mozilla-mobile/android-components">Android Components</a> offers an abstraction layer called <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/concept/engine/README.md">concept-engine</a> (<a href="https://mozilla-mobile.github.io/android-components/api/0.28.0/mozilla.components.concept.engine/index.html">API Docs</a>) that is a set of interfaces that allow us to switch between web engine implementations without getting crazy in the process 🤪.</p><p>Let’s add <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/concept/engine/README.md">concept-engine</a> dependency</p><p><strong>app/build.gradle</strong></p><pre>implementation &quot;org.mozilla.components:concept-engine:{latest-version}&quot;</pre><p>Also let’s add a concrete web engine implementation, in this case <a href="https://en.wikipedia.org/wiki/Gecko_(software)">Gecko</a> 🦎.</p><p><a href="https://wiki.mozilla.org/Mobile/GeckoView">Follow the steps to include the dependency for GeckoView</a> 🦎 and add component <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/browser/engine-gecko/README.md">browser-engine-gecko</a></p><p><strong>app/build.gradle</strong></p><pre>implementation &quot;org.mozilla.components:browser-engine-gecko:{latest-version}&quot;</pre><p><strong>activity_main.xml</strong></p><pre>&lt;<strong>LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    android:orientation=&quot;vertical&quot;</strong>&gt;</pre><pre>    &lt;<strong>mozilla.components.browser.toolbar.BrowserToolbar<br>        android:id=&quot;@+id/toolbar&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;56dp&quot;<br>        android:background=&quot;#aaaaaa&quot; </strong>/&gt;</pre><pre>    &lt;<strong>mozilla.components.concept.engine.EngineView<br>        android:id=&quot;@+id/engineView&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;0dp&quot;<br>        android:layout_weight=&quot;1&quot; </strong>/&gt;</pre><pre>&lt;/<strong>LinearLayout</strong>&gt;</pre><p>Now to render the URL.</p><p><strong>MainActivity.kt</strong></p><pre>class MainActivity : AppCompatActivity() {</pre><pre>    private val engine: Engine by <em>lazy </em><strong>{<br>        </strong>GeckoEngine(this)<br>    <strong>}</strong></pre><pre><strong>    </strong>override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)<br>        setContentView(R.layout.<em>activity_main</em>)</pre><pre>        val session = engine.createSession()<br>        engineView.render(session)<br>        session.loadUrl(&quot;https://mozilla.org&quot;)<br>    }</pre><pre>    override fun onCreateView(parent: View?, name: String?, context: Context, attrs: AttributeSet?): View? =<br>        when (name) {<br>            EngineView::class.<em>java</em>.<em>name </em>-&gt; engine.createView(context, attrs).asView()<br>            else -&gt; super.onCreateView(parent, name, context, attrs)<br>        }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lXc1ZO6e-pJTz7346_ZehA.gif" /><figcaption>GeckoEngine (GeckoView 🦎)</figcaption></figure><p>Hooray 😎!</p><p>But there is more 😉, you can switch between engines implementation.</p><p>Let’s switch to an <a href="https://developer.android.com/reference/android/webkit/WebView">Android Web View</a>(<a href="https://en.wikipedia.org/wiki/Blink_(browser_engine)">Blink</a>)</p><pre>implementation &quot;org.mozilla.components:browser-engine-gecko:{latest-version}&quot;</pre><p>And replace the instance of engine by SystemEngine one!</p><p><strong>MainActivity.kt</strong></p><pre>private val engine: Engine by <em>lazy </em><strong>{<br>    </strong>SystemEngine(this)<br><strong>}</strong></pre><p>And it just work 😛!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hJcVnRQgeQ9vHesmKT6y_w.gif" /><figcaption>SystemEngine implementation (Android WebView)</figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FiI6eeGjwScTCM%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2FiI6eeGjwScTCM&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FiI6eeGjwScTCM%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="302" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d73c18f8f3eab1d9dd6e3c0099a6c26/href">https://medium.com/media/2d73c18f8f3eab1d9dd6e3c0099a6c26/href</a></iframe><p>This is the real power 💪 of Android Component, we do the 🏋️‍♀️ hard work for you!</p><p>Back to the business, let’s connect the toolbar and Engine View together 👌!</p><h3>3.Toolbar + Web Engine = Feature (<a href="https://github.com/Amejia481/Simple-Browser/tree/step-3-toolbar+web-engine">Source Code</a>)</h3><p>Now the main idea is to connect both of them together, this way every time that we enter an URL in the toolbar it loads in the <a href="https://mozilla-mobile.github.io/android-components/api/0.28.0/mozilla.components.concept.engine/-engine-view/index.html">EngineView</a>.</p><p>We could do it manually observing the changes in the <a href="https://mozilla-mobile.github.io/android-components/api/0.28.0/mozilla.components.browser.toolbar/-browser-toolbar/index.html">toolbar</a> and loading the typed URL on the <a href="https://mozilla-mobile.github.io/android-components/api/0.28.0/mozilla.components.concept.engine/-engine-view/index.html">EngineView</a>, but we have a smarter choice 🤓. For cases like this one, we have the concept of <a href="https://github.com/mozilla-mobile/android-components#feature">features</a>, these are the combination of multiple components that achieve certain functionality together.</p><p>There are two <a href="https://github.com/mozilla-mobile/android-components#feature">features</a> that do exactly what we need 🤩 <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/feature/toolbar/README.md">feature-toolbar</a> and <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/feature/session/README.md">feature-session</a> that just does exactly what we need.</p><p>Let’s add the <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/feature/toolbar/README.md">feature-toolbar</a> dependency</p><pre>implementation &quot;org.mozilla.components:feature-toolbar:{latest-version}&quot;</pre><p>We also we going to need the <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/feature/session/README.md">feature-session</a>(<a href="https://mozilla-mobile.github.io/android-components/api/0.28.0/mozilla.components.feature.session/index.html">API Docs</a>) component</p><pre>implementation &quot;org.mozilla.components:feature-session:{latest-version}&quot;</pre><p>Now let’s integrate <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/feature/toolbar/README.md">feature-toolbar</a> and <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/feature/session/README.md">feature-session</a> to <strong>MainActivity.kt</strong></p><pre>class MainActivity : AppCompatActivity() {</pre><pre>/*...*/</pre><pre><strong>    </strong>private lateinit var toolbarFeature: ToolbarFeature<br>    private lateinit var sessionFeature: SessionFeature</pre><pre>    private lateinit var sessionUseCases: SessionUseCases</pre><pre>    override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)<br>        setContentView(R.layout.<em>activity_main</em>)</pre><pre>        sessionManager = SessionManager(engine)<br>        sessionUseCases = SessionUseCases(sessionManager)</pre><pre>        sessionFeature = SessionFeature(<br>            sessionManager,<br>            sessionUseCases,<br>            engineView<br>        )</pre><pre>        toolbarFeature = ToolbarFeature(<br>            toolbar,<br>            sessionManager,<br>            sessionUseCases.loadUrl<br>        )</pre><pre>        //Adding a default session<br>        sessionManager.add(Session(&quot;https://www.mozilla.org&quot;))</pre><pre>    }</pre><pre>    override fun onStart() {<br>        super.onStart()<br>        toolbarFeature.start()<br>        sessionFeature.start()<br>    }</pre><pre>    override fun onStop() {<br>        super.onStop()<br>        toolbarFeature.stop()<br>        sessionFeature.stop()<br>    }</pre><pre>    override fun onCreateView(parent: View?, name: String?, context: Context, attrs: AttributeSet?): View? =<br>        when (name) {<br>            EngineView::class.<em>java</em>.<em>name </em>-&gt; engine.createView(context, attrs).asView()<br>            else -&gt; super.onCreateView(parent, name, context, attrs)<br>        }<br>}</pre><p>Now we have our simple browser up and running 🕺 💃!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hLwoAjg1apmvmuecYnNjZQ.gif" /></figure><h4>Navigation Buttons (<a href="https://github.com/Amejia481/Simple-Browser/tree/step-4-navigation-buttons">Source Code</a>)</h4><p>To add the cherry on top 🍰, let’s add the typical navigation buttons back ◀️, forward ▶️ and reload ♻️.</p><p>For this let’s use the <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/browser/menu/README.md">browser-menu</a><strong> </strong>component that allow us to create customizable items for our toolbar.</p><pre>implementation &quot;org.mozilla.components:browser-menu:{latest-version}&quot;</pre><p>Also, let’s include the <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/ui/icons/README.md">ui-icons</a> and <a href="https://github.com/mozilla-mobile/android-components/blob/master/components/ui/colors/README.md">ui-colors</a> components that help us to style our toolbar with icons and colors from the Firefox design language <a href="https://design.firefox.com/photon/welcome.html">photon</a>.</p><pre>implementation &quot;org.mozilla.components:<a href="https://github.com/mozilla-mobile/android-components/blob/master/components/ui/icons/README.md">ui-icons</a>:{latest-version}&quot;<br>implementation &quot;org.mozilla.components:<a href="https://github.com/mozilla-mobile/android-components/blob/master/components/ui/colors/README.md">ui-colors</a>:{latest-version}&quot;</pre><p>And Add this items to <strong>MainActivity.kt</strong></p><pre><strong>class </strong>MainActivity : AppCompatActivity() {</pre><pre>        /*...*/</pre><pre><strong>override fun </strong>onCreate(savedInstanceState: Bundle?) {<br>      <br>        /*...*/</pre><pre>        toolbar.setMenuBuilder(getBrowserMenuBuilder())<br>    }</pre><pre>/*...*/</pre><pre>    <strong>private fun </strong>getBrowserMenuBuilder(): BrowserMenuBuilder {<br>        <strong>return </strong>BrowserMenuBuilder(listOf(getBrowserMenuItemToolbar()))<br>    }</pre><pre>    <strong>private fun </strong>getBrowserMenuItemToolbar(): BrowserMenuItemToolbar {</pre><pre>        <strong>val </strong>back = BrowserMenuItemToolbar.Button(<br>                mozilla.components.ui.icons.R.drawable.mozac_ic_back,<br>                iconTintColorResource = R.color.photonBlue90,<br>                contentDescription = <strong>&quot;Back&quot;</strong>) <strong>{<br>            </strong>sessionUseCases.goBack.invoke()<br>        <strong>}</strong></pre><pre><strong>        val </strong>forward = BrowserMenuItemToolbar.Button(<br>                mozilla.components.ui.icons.R.drawable.mozac_ic_forward,<br>                iconTintColorResource = R.color.photonBlue90,<br>                contentDescription = <strong>&quot;Forward&quot;</strong>) <strong>{<br>            </strong>sessionUseCases.goForward.invoke()<br>        <strong>}</strong></pre><pre><strong>        val </strong>refresh = BrowserMenuItemToolbar.Button(<br>                mozilla.components.ui.icons.R.drawable.mozac_ic_refresh,<br>                iconTintColorResource = R.color.photonBlue90,<br>                contentDescription = <strong>&quot;Refresh&quot;</strong>) <strong>{<br>            </strong>sessionUseCases.reload.invoke()<br>        <strong>}</strong></pre><pre><strong>        val </strong>stop = BrowserMenuItemToolbar.Button(<br>                mozilla.components.ui.icons.R.drawable.mozac_ic_stop,<br>                iconTintColorResource = R.color.photonBlue90,<br>                contentDescription = <strong>&quot;Stop&quot;</strong>) <strong>{<br>            </strong>sessionUseCases.stopLoading.invoke()<br>        <strong>}</strong></pre><pre><strong>        return </strong>BrowserMenuItemToolbar(listOf(back, forward, refresh, stop))<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OPN60pQiQYj3KM_X62TFig.gif" /><figcaption>Simple browser with Navigation buttons.</figcaption></figure><h3>We did it 🙌!</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FmIZ9rPeMKefm0%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FmIZ9rPeMKefm0%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExcjU0eTVxaDVqcXJxbnN5ZGU2NmxsNG1wcTE1Ynp4OWo5ZXR1dndlbiZlcD12MV9naWZzX2dpZklkJmN0PWc%2FmIZ9rPeMKefm0%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/bd9d0444389c743cd40017c28f2d9622/href">https://medium.com/media/bd9d0444389c743cd40017c28f2d9622/href</a></iframe><p>This is only a small example of what you can do with <a href="https://github.com/mozilla-mobile/android-components">Mozilla Android Components</a>, take a look at our <a href="https://github.com/mozilla-mobile/android-components#sample-apps">Sample apps</a> where you can find many more advanced use cases and components in action.</p><p>We’re an open source project help is definitely welcome! You can find information about how to contribute <a href="https://mozilla-mobile.github.io/android-components/contributing/">here</a>, and stay up to date by joining our <a href="https://lists.mozilla.org/listinfo/android-components">mailing list</a>.</p><p>Hope you like this blog post, any feedback or questions are more than welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b33349cde4d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/firefox-mobile-engineering/creating-a-simple-browser-with-mozilla-android-components-b33349cde4d0">Creating a Simple browser with Mozilla Android Components.</a> was originally published in <a href="https://medium.com/firefox-mobile-engineering">Mozilla Mobile Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated Testing Intro]]></title>
            <link>https://medium.com/@arturomejiamarmol/automatic-testing-intro-46f76f5af6b0?source=rss-781ea8a76ce5------2</link>
            <guid isPermaLink="false">https://medium.com/p/46f76f5af6b0</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-craftsmanship]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Arturo Mejia]]></dc:creator>
            <pubDate>Wed, 30 Aug 2017 14:58:42 GMT</pubDate>
            <atom:updated>2017-08-30T15:05:23.993Z</atom:updated>
            <content:encoded><![CDATA[<p>Testing is the way that we use to verify that an app is working as we expected. You can have two type of tests <strong>manual testing</strong> and <strong>automated testing or</strong> a mix of both of them:</p><h4>Manual testing</h4><p>Is when a user verify <strong>manually</strong> that every functionality of the app works correctly as the requirements express. Normally, the QA team has a <strong>list of possible test cases (test suite)</strong> or functionalities, and an expected behavior that they want to verify for each one of them, for instance:</p><p><strong>Test #1 (Test login screen with correct user and password)</strong></p><p><em>Behavior</em></p><p>1.Enter to the login screen.</p><p>2. Input correct user and password.</p><p>3. Press the login button.</p><p><em>Expected Result</em></p><p>The app lets you enter into the main screen.</p><p><strong>This list of test cases (test suite) </strong>extends until to cover every possible functionality that the user can perform using the app.</p><p>As you might expect when the app grows or is updated the tests should be updated too, increasing their number for each iteration.</p><p>Before shipping the app to consumers <strong>every test of the list (test suite)</strong> should be <strong>exercised</strong> and <strong>pass. </strong>When the results are not as expected the app goes back to the Dev Team. This cycle is repeated until all the<strong> tests pass</strong>, and the app is delivered to your users.</p><p>When a user reports a bug this issue is added as a test case to the <strong>list of test cases (test suite) </strong>to verify that we’re not repeating the same mistake.</p><p>Again after the Dev Team finishes working on a feature the testers exercise every test on the l<strong>ist of test cases (test suite) for validating that everything is ok.</strong></p><p>As you can see, as the app evolves the <strong>list of test cases (test suite) keep growing and growing, making it difficult and error-prone to test manually. As times goes on is infeasible for the QA team to keep the pace of the Dev Team. </strong>In every improvement of the app takes longer and longer to the QA team give feedback to Dev team about if their changes are ok or not.</p><p>As a result, we use <strong>automated testing to help us to obtain timely feedback about the status of our changes and apply fixes in early stages of Dev cycle.</strong></p><p>Code bases that have automated testing on them are safer to modify because when we make changes we are going to receive faster feedback.</p><p>For this reasons, Michael Feathers on his book <a href="http://a.co/cId7NfO">Working Effectively with Legacy Code</a> says that Legacy code is code that has no tests.</p><h4><strong>Automated</strong> testing</h4><p>With automated testing, we do exactly the same as with do with manual testing the only difference is that we take advance of what machines are good for “<strong>repetitive routines”</strong>, instead of human labor repeating over and over every <strong>test cases of the list (test suite) </strong>the computers do it for us.</p><p>This helps us to reduce cost and possible failure, because bugs are found in early stage and at the same time give trust to developers to modify and extend the code without worrying about introducing new issues to the code base.</p><p>Our approach must be, every time that we write or modify a functionality we write some tests that cover (Code coverage)that portion of the code and verify that the app keeps working as expected.</p><h3><strong>Extra Resources</strong></h3><ul><li>Agile Connect 2011 - <a href="https://youtu.be/p5Qj75nJPEs?list=PLWy8DQlwJkdyqu6oZ_1SHKRGATXwn03Oq">Keynote Software Design in the 21st Century</a> by Martin Fowler</li><li><a href="http://a.co/cId7NfO">Working Effectively with Legacy Code</a> — Michael Feathers</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46f76f5af6b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning from vulnerability reports.]]></title>
            <link>https://medium.com/@arturomejiamarmol/learning-from-vulnerability-reports-e447430a7477?source=rss-781ea8a76ce5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e447430a7477</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Arturo Mejia]]></dc:creator>
            <pubDate>Sun, 09 Apr 2017 19:20:56 GMT</pubDate>
            <atom:updated>2017-04-10T17:01:59.895Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pNe6mcqxlO_H9V7N2lSsPA.png" /></figure><p>Yesterday, I was checking this site <a href="https://www.hackerone.com/">Hackerone</a> where many software companies offer rewards (<a href="https://en.wikipedia.org/wiki/Bug_bounty_program"><em>Bug Bounty</em></a>) for finding security vulnerabilities in their apps including mobiles ones (Android and iOS). What really caught my attention was that after a company has fixed the issue they have the option of making the reports public, and everybody can take measures in case they have something similar in their products.</p><p>In my case, I believe is a great source for getting security tips for developing apps for mobile platforms, and I’m trying to make a habit of reading some reports every week, I want to share with you how you can learn from these reports.</p><h3><strong>How does it work?</strong></h3><p>Every company has a profile on the website, where they give information about their products and how white hat hackers can supply reports.</p><p>When a white hat hacker finds a vulnerability he/she supplies a detailed report indicating what was found, and how to replicate it. Then, the company reviews the report and if they find that there is a real problem, they give a reward(<a href="https://en.wikipedia.org/wiki/Bug_bounty_program"><em>Bug Bounty</em></a>) to hacker and they tell him/her that does not disclose this information until they release a fix for it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*jfdN-H6tpaKLNcVJHIwJSg.png" /><figcaption>Square Open Source</figcaption></figure><h3>How to find a vulnerability report.</h3><p>Unfortunately, not all the reports are made public but many of them are and <strong>we can learn from them.</strong></p><p>First, we have to find a company with a <strong>Bug resolved.</strong> You can do it either with an account or without one, the info is available in both cases.</p><p><strong>Click the Directory link</strong></p><p>Then you will get a list with all the companies. The key is to find which of these have public reports, unfortunately, there is not a straight way to find public reports, I prefer to sort them by Highest Minimum <a href="https://en.wikipedia.org/wiki/Bug_bounty_program">Bounty</a> because this will show me the companies that are more eager to find vulnerabilities, and where more hackers want to report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*51PeEMq8kyja9Cgrx5-tPA.png" /><figcaption>Directory sort by Highest Minimum Bounty</figcaption></figure><p>Choose one, and in its profile, after the info part, you will find a timeline with all the reports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*BYRVHrIEuIvpBhGo0Sg2Wg.png" /><figcaption>Timeline</figcaption></figure><p>Now the hard task is to find one that is public, you can identify it because it has the description of the report. You just have to click it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*kJu-am9pdSdOEZvBaOmLHg.png" /><figcaption>Timeline</figcaption></figure><p>This is the full report, where we can find what happened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*U4WzyzJpm0EHBCi9hqqOYQ.png" /></figure><p>There are some caveats that you might take into consideration, if you are like me you will be interested in finding vulnerabilities in mobile apps in particular Android, you can not filter by type of apps or by public reports, all the reports are mixed and is tedious to find them, but it worth it.</p><p>To sum up, this is a great way to learn about software security. I courage you make habit of reading some reports, at least one per week this will help you to be aware of security issues, and deter them before they cause harm to your users.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e447430a7477" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why to be a speaker in your community ?]]></title>
            <link>https://medium.com/@arturomejiamarmol/why-to-be-a-speaker-a6587f1a0617?source=rss-781ea8a76ce5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6587f1a0617</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[droidcon]]></category>
            <dc:creator><![CDATA[Arturo Mejia]]></dc:creator>
            <pubDate>Sat, 11 Mar 2017 21:26:25 GMT</pubDate>
            <atom:updated>2017-03-11T22:42:14.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bsRm4FEUz5S6Sp4bJIWvAg.jpeg" /></figure><p>Last weekend, I was at <a href="http://droidcon.do/">DroidCon Santo Domingo</a> as speaker and attendee. It was the first event completely oriented to Android Development in Latin America, for me it was an amazing and cool experience. I met many new friends, that are awesome developers, I learned a lot, and at the same time, I had fun. I want to share with you some of my experiences, what I learned, and why I encourage you to be a speaker in your community.</p><p>The first time that I saw the announcement of the event was back at the end of 2016. When I saw it, the only thing that came to my mind was “Wow!”, I couldn’t believe it, I have been watching DroidCon talks on Youtube the whole year, and now it’s coming to my country. When I was finishing the post, at the last line it said they were looking for speakers, I thought “maybe I could … No, I can’t do it, there are going to be many people there, I can not speak in front of so many people, definitely it is not for me, I just going to attend”</p><p>That week, I spent every day thinking of the possibility of doing it, but every time that I was in the middle of filling the form my fears stopped me. I spent a completed month in that loop.</p><p>But, one week before the submission due date, I saw this video on Youtube.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUF8uR6Z6KLc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUF8uR6Z6KLc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUF8uR6Z6KLc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/928a962391366f919bb9b0ea8d745e91/href">https://medium.com/media/928a962391366f919bb9b0ea8d745e91/href</a></iframe><p>I almost cry, Steve really motivated me, and suddenly I thought “<strong>No matter how afraid I am, I’m going to do it</strong>”, I filled the form as quickly as I could before I changed my mind. <strong>Now there is not going back!</strong></p><p>Since that day, and until the end of my talk I was scared of doing something wrong or silly, <strong>but it is normal to be afraid</strong>, it is part of our nature, for that reason, if we want to learn and grow as humans and professionals, <strong>we must force ourselves to be in uncomfortable situations</strong> in what we haven’t been before, that make us think and discover new ways out of our comfort zone.</p><p><strong>Yeap! You have to push yourself</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pilGVN0BOm83A89mEur-UA.jpeg" /></figure><p>Yes, my friend. There is not another way, I know, I know it sounds pretty freighting to speak in from of a bunch of people, but believe me, it’s worthwhile.</p><p>When you present a topic, you exercise your communication abilities, that allows you to explain in an easy, and comprehensive way, what you want to express to others. Therefore, you become a better developer, remember that software development is a team practice, communication skills are a key factor for success.</p><p><strong>If I don’t have anything to say?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*69IU9QMlqGd6gsUePD62oQ.jpeg" /></figure><p>This is one of the first things that might come to your mind, but it is not true, let me show you an example when you write code, does it work always at the first time? Of course, it does not. We battle day by day with platforms and technologies, that are not perfect, we are neither, but we keep pushing and pushing until the <a href="https://en.wikipedia.org/wiki/Eureka_effect">eureka moment</a> happens, and we find a workaround. For example, you can speak about how you solved the problem XYZ after three days of without sleeping and a lot of coffee, tell to your peer how you did it, what you learned, how much you suffered in the process. This is the main idea to share what you know, maybe many people are going through the same bug and you can be their savior.</p><p><strong>Get many new friends!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BrJDtQnO7J4pGKaLRD1bdA.jpeg" /></figure><p>Let me tell you something, there are many people that enjoy the things you love and have a lot of things in common with you, but you don’t know them and this type of events reunite them all under the same roof, <strong>you are not alone</strong>.</p><h3>Now, it’s your time. What are you waiting for?</h3><h3><strong>Go for it! :)</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6587f1a0617" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>