Profile

Cover photo
Saúl Molinero Malvido
Works at ameiga
Attends Universitat Oberta de Catalunya
Lives in Santiago De Compostela
542 followers|1,642,597 views
AboutPostsPhotosVideos

Stream

Saúl Molinero Malvido

Shared publicly  - 
 
 
Just wanted to show you my simple homescreen setup...in a bit of interesting way. Enjoy!

- Onca clock widget
- Htc One M9 Wallpaper (http://www.androidhackz.net/2015/02/download-htc-one-m9-wallpapers.html)
- Nova Launcher



http://drbl.in/nUCt
24 comments on original post
3
Add a comment...

Saúl Molinero Malvido

Shared publicly  - 
 
We replace the functionality of both AsyncTask and AsyncTaskLoader using the rx.Observable interface and achieve more power and more clarity in our code.
10
7
Rakeeb Rajbhandari's profile photoMarkus Wedler's profile photoJesús Manzano Camino's profile photoAndrei Bulanau's profile photo
 
Cool, thanks!! Personally i use the SafeAsyncTask or RoboAsyncTask from Roboguice and to be honest is really helpfull, you can have a no context background job or handle exceptions really easy, plus it is easy to extends and works great with otto bus. 
Add a comment...
 
 
I made a gradle plugin!
https://github.com/chiuki/gce2retrofit

It generates Retrofit classes from Google Cloud Endpoint (GCE) discovery files.

Please try it and file issues if you encounter any. Thanks!


#GDE   #Android   #OpenSourceCode  
I am working on an Android app that uses Retrofit a Google Cloud Endpoints (GCE) server. Initially I was writing the Retrofit interfaces and models by hand, but then I found out that GCE servers serve a discovery document describing all its endpoints in JSON. So I started working on a tool to ...
View original post
2
1
Jimmy Leonardo's profile photo
Add a comment...
 
#androidDev Let's troll the user, no wifi, no time, no battery...

 if (Build.VERSION.SDK_INT >=Build.VERSION_CODES.LOLLIPOP)
       getWindow().setStatusBarColor(Color.WHITE);
12
2
Ismael Reyes's profile photoJimmy Leonardo's profile photo
Add a comment...
 
To mark text that should not be translated, or wrap a value into a string use an <xliff:g> placeholder tag.
 
AwesomeFragment.java
mUserBalanceTextView.setText(
    getString(R.string.frgament_nav_drawer_balance, userBalance));

strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources
    xmlns:xliff="rn:oasis:names:tc:xliff:document:1.2">

    <string name="frament_nav_drawer_balance">
          Balance <xliff:g id="balance" example="23" >%s</xliff:g> €
     </string>
</resources>

Result:
Balance: 23.52 €

#androidDev     #proTip  
8
2
Salvador Gómez's profile photoPratama Nur Wijaya's profile photo
Add a comment...
 
#androidDev   SnackBar is a nice library that implements SnacksBars from the Material Design spec, working from SDK 8 and higher
9
2
Varuna G.P's profile photoFroylan Camacho's profile photoJimmy Leonardo's profile photoSalvador Gómez's profile photo
2 comments
 
thanks :P
Add a comment...
 
 
Android Anti-Patterns i.e. things to avoid.
This week:  scheduling future network activity

The basic principle:  never(1) schedule future network activity with a non-wakeup alarm, or with a simple deferred message or Runnable on a Looper.  [(1) Never?  Well, hardly ever.  See below for possible exceptions to think about.]

This isn't quite obvious.  Non-wakeup alarms & Looper are attractive because you feel like you're conserving battery.  You aren't waking up the device in someone's pocket; you're just taking advantage of the next time that the device is in use anyway, so you're keeping things lean, right?

Well, that's only part of the story.  The other part is that you're not the only app on the phone, and that device isn't the only one on the network.

Users turning on the screen, directly using the device, are not the only time that non-wakeup alarms get fired, or that Looper-based deferred messages get a chance to run.  _Anything else_ that wakes up the device, even without turning on the screen, will also cause any pending non-wakeup alarms etc to be delivered.  "Anything else" can mean, say, the alarm clock going off at 7:00 am....

... along with literally millions of other people who also set their alarms for 7am.  And maybe your app is pretty popular, and so you have a hundred thousand people using it out of that pool of 7am-wakeup folks.  *Boom.*  If your app was waiting for a chance to do something on the network, you just hit the cell network with a hundred thousand requests within the space of a second or two.  Deferred wakeups tend to happen in response to these kinds of external factors such as time of day.  Putting any kind of load on external resources (e.g. the network or your remote servers) when this kind of deferred wakeup happens is going to cause load spikes, guaranteed.  That's bad, and it's your fault.

There are a few different approaches to take that avoid this problem.  Pick the one that is a good fit for the kind of activity that your app does.

First off, instead of using non-wakeup alarms or simple deferred Looper messages, you could use a real wakeup alarm and make sure to "fuzz" either the interval between your wakeups, or the times at which you want to wake up.  By making sure that your app's activity on different physical devices is timed differently, you are being a good citizen by preventing load spikes on your users' carrier, your remote servers, etc.

You could even just layer a "fuzz" factor on top of your existing deferred wakeup architecture.  When your non-wakeup alarm fires, or when your deferred Looper message is handled, don't immediately perform your network activity.  Instead, set a one-shot wakeup alarm for a small random time in the future -- say, from 0 to 300 seconds, to pull numbers out of a hat.  An extra five minutes probably isn't going to hurt -- after all, you're just running at the whim of the device's other activity anyway -- and even a few minutes of fuzz makes a lot of difference in terms of preventing load spikes on the network.  This isn't as efficient as the first option of using exact timing with random intervals, because there will still be a "bump" in activity following whatever external factor caused the initial wakeup, but it's a lot better than doing nothing.

You could also consider using the Alarm Manager's "inexact" repeating alarm API <http://developer.android.com/reference/android/app/AlarmManager.html#setInexactRepeating(int, long, long, android.app.PendingIntent)>.  These are wakeup alarms, but the battery impact of them is mitigated by "batching" the inexact alarms from multiple applications to all be processed at once, within a single wakeup of the device.  The batching is not tied to wall-clock time and will vary across physical devices specifically to prevent spiking external resources.

[Edited to add] Finally, many apps will best be served by using Google Cloud Services.  The server-side implementation of GCM can do quite a bit to optimize battery and network usage patterns on the phone by multiplexing several applications' activity together, minimizing wakeups and radio power up/down cycles, etc.

Hopefully this has gotten you thinking; as always, feel free to discuss and ask questions.

Edit: In conversation after I'd written this, it was pointed out that sometimes performing network access in this "immediately upon wakeup" deferred manner really, truly is the right thing to do.  A good example is something like a Twitter application.  The best possible user experience is that if the user pulls their device out of a pocket, unlocks it, and heads straight to the app, the content they're presented with is as up-to-the-minute as possible.  If the app waited to become the foreground visible application before sending out its network request, that's not going to happen.  If the app tries to stay up to date while the phone is asleep, it means it'll burn a lot of battery keeping the data radios spun up all the time.  In this specific kind of case, the implementation I'm warning against here is likely to give the all-around best user experience.

One moral here is that there aren't many hard-and-fast rules; the needs of the user and of the app are paramount, and what is less-than-ideal in most cases might really be the best approach in certain others.  Always think hard about how your app will behave, what your users will expect and appreciate, and what the tradeoffs are.
5 comments on original post
1
1
Jennie L's profile photo
Add a comment...
 
#androidDev, Nice article talking about TDD on android 
11
8
My Android Solutions's profile photoFernando F. Gallego's profile photo
Add a comment...
Have him in circles
542 people
Mike Voytovich's profile photo
Pablo Martinez Piles's profile photo
Yuanyuan Cai's profile photo
estefania ortiz's profile photo
Ranjith P .A's profile photo
Ercument ESER's profile photo
ismael faro's profile photo
Christian Panadero Martinez's profile photo
Victor Muñoz Palomino's profile photo
 
After a month of intermittent work I am glad to be submitting my application about a twitter client for Gear wearables on the Samsung Store.

The application besides being totally free all code is open-source and is available on Github [0]

[0] https://github.com/saulmm/twitter-for-galaxy-gear 
6
Add a comment...
 
 
Looking to get your hands dirty with multi-threaded code on android?

Here's a great starter guide, as well as a sample app, to help you get the basics, and know what's coming

#perfmatters  
16 comments on original post
4
2
Jimmy Leonardo's profile photoLuís Vitela's profile photo
Add a comment...
 
#androidDev, nice stuff
Falcon Pro 3 is the much anticipated rewrite of one of the most popular Twitter apps in Android history. In just 3 weeks, Joaquim Vergès rewrote the app from scratch, and the new version generated 60,000 installs in 20 days with no advertising. In this talk, Joaquim shared what he learned about some of the newest libraries available on Android, rendering at 60fps, making sure people pay for your app, seeding your beta, and much more.
5
3
Stephen Pengilley's profile photoYair Kukielka's profile photo
Add a comment...
 
#androidDev  Nice slides [0] & source by +Romain Guy from a talk called Material Witness given at the Google I/O 2014 

[0] http://goo.gl/BaW5Fi
Chet and I gave a talk entitled "Material Witness" at Google I/O today. I am happy to announce that the entire talk is now available on YouTube. I have also published the following resources: The s...
9
5
Rakesh Barik's profile phototeo ramone's profile photo
Add a comment...
People
Have him in circles
542 people
Mike Voytovich's profile photo
Pablo Martinez Piles's profile photo
Yuanyuan Cai's profile photo
estefania ortiz's profile photo
Ranjith P .A's profile photo
Ercument ESER's profile photo
ismael faro's profile photo
Christian Panadero Martinez's profile photo
Victor Muñoz Palomino's profile photo
Education
  • Universitat Oberta de Catalunya
    Engineering Software, 2014 - present
  • University of Santiago de Compostela
    Computer Engineering, 2013 - 2014
  • Daniel Castelao
    Higher Technician in Multi-platform Applications Development, Computer Software., 2012 - 2013
Basic Information
Gender
Male
Story
Introduction
Cofounder at ameiga, mobile developer, student and android lover. GDG Vigo organizer & GDG Santiago founder, at twitter @_saulmm
Work
Employment
  • ameiga
    2013 - present
  • Indenext
    android developer, 2014 - 2015
  • Telefonica
    Intern, Talentum Startups, 2014 - 2014
  • Fundación Novagalicia banco
    Intern, IT thecnologies, 2013 - 2013
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Santiago De Compostela
Previously
Vigo - Coram Street, London
Links
Contributor to
Links