via Public RSS-Feed of Ren Samselnig. Created with the PIXELMECHANICS ‘GPlusRSS-Webtool’ at http://gplusrss.com https://plus.google.com/113794442910833949954/posts/ihUBWXp8Bcz
Archives For post
via Public RSS-Feed of Ren Samselnig. Created with the PIXELMECHANICS ‘GPlusRSS-Webtool’ at http://gplusrss.com https://plus.google.com/113794442910833949954/posts/9cVmodCNcm8
New Android build system tip: ContentProvider authority renaming
I guess all of you have heard of the new Android Gradle-based build system. Let's be honest, this new build system is a huge step forward compared to the previous one. It is not final yet (as of this writing, the latest version is 0.4.2) but you can already use it safely in most of your projects.
I've personnaly switched most of my project to this new build system and had some issues because of the lack of support in some particular situations. One of which is the support for ContentProvider authority renaming
The new Android built system lets you deal with different types of your app by simply modifying the package name at build time. One of the main advantage of this improvement is you can now have two different versions of your app installed on the same device at the same time. For instance:
minSdkVersion 14 // Listen to advices 🙂
Using such a Gradle configuration, you can assemble two different APKs :
• A debug APK with the com.cyrilmottier.android.app.debug package name
• A release APK with the com.cyrilmottier.android.app package name
The only issue with that is you won't be able to install the two APKs at the same time if they both expose a ContentProvider with the same authorities. Pretty logically we need to rename the authority depending on the current build type … but this is not supported by the Gradle build system (yet? … I'm sure it will be fixed soon). So here is a way to go:
First we need to move the provider Android manifest ContentProvider declaration to the appropriate build type. In order to do that we will simply have :
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
Make sure to remove the ContentProvider declaration from the AndroidManifest.xml in src/main/ because Gradle doesn't know how to merge ContentProviders having the same name but a different authority.
Finally we may need to access to the authority in the code. This can be done pretty easily using the BuildConfig file and the buildConfig method:
final PROVIDER_DEBUG = "com.cyrilmottier.android.app.debug.provider"
final PROVIDER_RELEASE = "com.cyrilmottier.android.app.provider"
buildConfig "public static final String PROVIDER_AUTHORITY = \"" + PROVIDER_DEBUG + "\";"
buildConfig "public static final String PROVIDER_AUTHORITY = \"" + PROVIDER_RELEASE + "\";"
Thanks to this workaround you'll be able to use BuildConfig.PROVIDER_AUTHORITY in your ProviderContract and install two different versions of your app at the same time.
via Public RSS-Feed of Ren Samselnig. Created with the PIXELMECHANICS ‘GPlusRSS-Webtool’ at http://gplusrss.com https://plus.google.com/113794442910833949954/posts/9iXzUX8n8BZ
In this post I’m describing how we use the new “custom model” feature, introduced in Gradle 1.6, to provide IDE integration for Android projects that use the new Gradle-based build system. This feature was designed to allow Gradle plug-in developers provide a custom representation of a Gradle project through the Gradle’s Tooling API.
This post is intended to be a “note to self,” to have it handy once we start implementing Gradle support for Android projects in the Android Development Tools for Eclipse (ADT.)
via Public RSS-Feed of Ren Samselnig. Created with the PIXELMECHANICS ‘GPlusRSS-Webtool’ at http://gplusrss.com https://plus.google.com/113794442910833949954/posts/CpT5v28ruMx
via Public RSS-Feed of René Samselnig. Created with the PIXELMECHANICS ‘GPlusRSS-Webtool’ at http://gplusrss.com https://plus.google.com/113794442910833949954/posts/PbzFDdAuy6K
So here it is, Android UI Design Kit for Google Slides 1.0 is now available as a Google Slides Template! Again, the aim is to allow more people that are interested/wanted to do some Android Design to dive in regardless of the tool, whether it's for fun/mock up/serious work.
You can access the template directly from the link below and start using it in Google Slides! Please access the template on desktop browser, or if you are on mobile, request a desktop site. Apparently Google Docs Template page doesn't work on Mobile Browser Agent.
Alternative link: http://bit.ly/14PfzfH
Share this if you know anyone that will be interested in this!
via Public RSS-Feed of Ren Samselnig. Created with the PIXELMECHANICS ‘GPlusRSS-Webtool’ at http://gplusrss.com https://plus.google.com/113794442910833949954/posts/9N9gMEya2vF
Logic behind weight loss and weight gain
The simple reason why you lose or gain weight: your body’s ability to adapt. It’s smart – it’s a lot smarter than you think. Your body evolves to suit your daily needs and it assumes the shape you ask of it, though maybe not intentionally. The simple reality of it is: if you let your body think that it’s not required for it to move fast or carry heavy objects every single day it won’t grow muscles or shed the pounds to be able to perform better, easier and with less effort. That’s how it works to put it simply.
So, if someone let’s say tries to lose weight fast and goes on a crush diet it shocks the system so that the moment that someone is off the calorie restrictions his or her body starts to stockpile and stockpile like mad. It’s a simple self-preservation response – you basically just let your body know that the “hard times” might return at some point and you need all that extra weight to see you through. That’s mainly the reason why you would always get your lost weight back and fast and probably gain extra.
Conditions are vital when it comes to weight control and shaping your body. Put your body in the right conditions and that’ll force it to change the way you want to. That’s why you often hear that you must change your lifestyle in order to permanently change the way you look. It’s true enough. Sprinters have explosive, big muscles to put power into their runs and long distance runners have sleek bodies to carry them through serious distances as easily and as efficiently as possible. Bodybuilders lift and get big muscles because they feed their bodies and force them to get used to heavier and heavier loads, while yogis spend years making their bodies bend every which way by forcing it to do it over and over again. You can always tell what your body is used to by just looking at someone, the way they walk and the way their body flows. Fit people tend to be in complete control of their bodies and very aware of themselves. Have you ever seen someone who has no idea where their body starts or ends? It’s down to practice, practice and training.
Once you are in the conditions that force your body into change be that dietary restrictions or harsh physical activity your body begins to learn the new rules. It takes time for it to see if it’s worth adjusting to the new routine or if it can maintain the shape it is now. There are several factors that play a role here. When someone starts to exercise, for example, they begin to feel hunger a lot stronger – this is how your body tries to compensate for the energy spent training and you end up eating more calories than you burn as a result. This kind of hunger isn’t real – it’s a side effect of burning the reserves you already have. And it’s actually a lot easier to eat more than you burned since we tend to over-estimate the numbers spent and under-estimate the amounts consumed – it happens to the best of us.
Another factor that plays a role is time. It takes time for your body to see if it can just wait it out and hold on to whatever weight reserves you have on you. It often happens to people who tend to drop in and out of training. The experience of being challenged and being under physical stress stays in the body’s memory for a while after that. That’s why you can see fast results when you try something new and then nada when you try this same thing again, later.
Routine is something your body falls into and it does it fast, too. It’s a master of adaptation, an artist in its own right. Imagine, that you do the same old thing over and over again with the same intensity and the same calorie intake and suddenly things stop moving forward – you hit a plateau. What happened again? Yep, the bloody thing adjusted to the lifestyle and now it has optimized itself to continue going at the set pace for as long as it takes. To break free of this the best thing to do is to shake things up, let it know that routine can be broken and other things will be demanded of it any moment. That’s why it also helps to keep your training sessions fresh and mixed in intensity if it’s the change you want to see in yourself.
When you create an active environment for yourself where you might be expected to run, jump and do push-ups you force your body to be ready for it, any time. You force it to change shape to suit this kind of environment – it’s a simple enough logic. If you do something for a while – you’ll see results fast but then, you’ll also lose them after going back to your old lifestyle. And then every other time you do the same thing over and over again you’ll see less and less out of it. Every now and then shocking your body is good but if you let it be afraid of starvation, for example, it’ll hold on to the every last bite and stockpile, stockpile, stockpile.
And yet, it’s also all down to your lifestyle. Eventually your body learns what’s what and behaves accordingly. If you train one or two days a week you can probably do some good but it won’t make you change. It’s when not-training is something out of the ordinary that your body really starts adjusting and changing shape. It’s smart and it should be treated as such. Of course it doesn’t want to be put under pressure – the ideal conditions for it is to sit on pile of food and not move – because, who knows when you’ll need all these reserves. Yet, it needs to move in order to stay healthy – it’s happiest when it moves, actually. Your whole body begins to work like a well-oiled mechanism at any hour of the day if you give it what it needs, not what it wants.
Our bodies are a reflection of our lifestyles, basically. They don’t exactly have a mind of their own but they may just as well have and that’s why they must be controlled and looked after. Exercising just to tick the box, cheating half the time won’t do you any good, but waste your precious time. Think about it this way: is it making me uncomfortable enough to make my body adapt? If the answer is yes, you’ll see results. If you keep it up long enough these results will become permanent.
via Public RSS-Feed of Ren Samselnig. Created with the PIXELMECHANICS ‘GPlusRSS-Webtool’ at http://gplusrss.com https://plus.google.com/113794442910833949954/posts/QNj4vVZsfWM
via Public RSS-Feed of Ren Samselnig. Created with the PIXELMECHANICS ‘GPlusRSS-Webtool’ at http://gplusrss.com https://plus.google.com/113794442910833949954/posts/VNdmY2UN4gG
via Public RSS-Feed of Ren Samselnig. Created with the PIXELMECHANICS ‘GPlusRSS-Webtool’ at http://gplusrss.com https://plus.google.com/113794442910833949954/posts/B3yJ8W3JuLV
via Public RSS-Feed of Ren Samselnig. Created with the PIXELMECHANICS ‘GPlusRSS-Webtool’ at http://gplusrss.com https://plus.google.com/113794442910833949954/posts/WV2CqgZJVH1