WordPress database error: [INSERT, UPDATE command denied to user '51213-2'@'10.10.20.199' for table 'wp_options']
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_doing_cron', '1714389211.8246650695800781250000', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)


Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372
{"id":1612,"date":"2017-01-26T11:18:56","date_gmt":"2017-01-26T10:18:56","guid":{"rendered":"http:\/\/www.jonathanantoine.com\/?p=1612"},"modified":"2017-01-26T12:08:51","modified_gmt":"2017-01-26T11:08:51","slug":"xamarin-how-to-easily-use-the-picasso-sdk-and-mvvmcross-to-display-efficiently-images-in-your-android-apps","status":"publish","type":"post","link":"http:\/\/www.jonathanantoine.com\/2017\/01\/26\/xamarin-how-to-easily-use-the-picasso-sdk-and-mvvmcross-to-display-efficiently-images-in-your-android-apps\/","title":{"rendered":"#Xamarin : how to easily use the Picasso SDK and #MvvmCross to display efficiently images in your #Android Apps"},"content":{"rendered":"

Picasso<\/a> is a great open-source SDK which let you display images efficiently on Android. I wanted to use it in my MvvmCross app because it really helps you having great display performances especially on list. <\/p>\n

I have my images available as a remote HTTP URL in my ViewModel and I wanted to do this the easy and fast way. I then created a target binding !
\n<\/p>\n

MvvmCross lets you create your own target binding by following these steps :<\/p>\n

    \n
  1. Create an new class which inherits from MvxAndroidTargetBinding.<\/li>\n
  2. Register this binding using the name you want in your Setup class.<\/li>\n
  3. Use this new binding target<\/li>\n<\/ol>\n

    Creating the target binding<\/h4>\n

    You simply have to inherits from the asbstract class MvxAndroidTargetBinding and implements the SetValueImpl method<\/strong> which will set the value (provided as an arg) to the target element (provided as an arg too). <\/p>\n

    In our case, I use Picasso to the bitmap on an ImageView :
    \n[csharp]
    \npublic class ImageUrlToLoadBinding : MvxAndroidTargetBinding
    \n{
    \n public ImageUrlToLoadBinding(View target) : base(target) { }<\/p>\n

    public int PlaceHolderToUse { get; set; }<\/p>\n

    protected override void SetValueImpl(object target, object value)
    \n {
    \n var imageView = (ImageView)target;
    \n Picasso.With(imageView.Context)
    \n .Load(value as string)
    \n .Into(imageView);
    \n }<\/p>\n

    public override Type TargetType => typeof(string);
    \n}
    \n[\/csharp]<\/p>\n

    Registering the target binding<\/h4>\n

    In your Setup class, you have to register this custom binding using the name you want. This name will be the one used as a Target in your MvxBind attributes. To do this, you have to override the FillTargetFactories method<\/strong>. <\/p>\n

    In our case, I use “PosterImageUrlToLoad” as a key :
    \n[csharp]
    \nprotected override void FillTargetFactories
    \n (IMvxTargetBindingFactoryRegistry registry)
    \n{
    \n \/\/ register custom binding here
    \n registry.RegisterCustomBindingFactory<View>
    \n ("ImageUrlToLoad", v => new ImageUrlToLoadBinding(v));<\/p>\n

    base.FillTargetFactories(registry);
    \n}
    \n[\/csharp]<\/p>\n

    Using the target binding<\/h4>\n

    This is the easiest part because it’s a casual binding simpley using your “name” as a target. I removed all the other attributes in this example :
    \n[xml]<ImageView
    \n local:MvxBind="ImageUrlToLoad ImageUrlManager.FinalImageUrl"
    \n \/>[\/xml]<\/p>\n

    Happy coding !<\/p>\n","protected":false},"excerpt":{"rendered":"

    Picasso is a great open-source SDK which let you display images efficiently on Android. I wanted to use it in my MvvmCross app because it really helps you having great display performances especially on list.…<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/1612"}],"collection":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/comments?post=1612"}],"version-history":[{"count":15,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/1612\/revisions"}],"predecessor-version":[{"id":1627,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/1612\/revisions\/1627"}],"wp:attachment":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/media?parent=1612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/categories?post=1612"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/tags?post=1612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}