The Android logger has always annoyed me, it tends to do just the bare minimum, a message is printed but no details regarding method invoking the print and no formatting support. And all those TAGS. We basically end up with lots of repetitive code.
That's why I built AppLog, a simple and smarter logger for Android. It makes the TAGS optional, supports String.format and makes type handling easier.
AppLog is available on GitHub if you want to try it out.
https://github.com/marteinn/Android-AppLog
Feedback and ideas are of course much appreciated.
Ten Google Play Tips/tricks
I wrote a blog post with Google Play optimization tips for Android called Ten Google Play tips/tricks for the frojd.se blog. It touches mostly store listing and best practice dealing with comments and updates. Feedback is if course super welcome, just drop a comment below!
I (love) Discogs Checksum And Implementation Example
The checksum for the fallback "I (Love) Discogs" discogs uses when image requests are faulty is c58c26d726f1a8e0f3436db79a8122a0.
I also wrote a quick example on how you could check for it (in Python).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The function check_if_blocked_image checks if passed checksum equals the "I love discogs" checksum. | |
Example: | |
import hashlib | |
checksum = hashlib.md5(result.content).hexdigest() | |
if check_if_blocked_image(checksum): | |
print "I love discogs is showing" | |
""" | |
# Checks if image is "I love discogs" image | |
def check_if_blocked_image(checksum): | |
return checksum == "c58c26d726f1a8e0f3436db79a8122a0" |
Tastypie: Reusing The Resource Serialization Outside Api
I needed to use Tastypies resource serialization outside the api context, so this is how you do it.
Got any suggestions? Fork it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Credit to the parker library (https://github.com/coxmediagroup/parker/) and their TastyPieHandler. | |
""" | |
req = HttpRequest() | |
resource = YourResource() | |
bundle = resource.build_bundle(obj=your_model) | |
bundle = resource.full_dehydrate(bundle) | |
bundle = resource.alter_detail_data_to_serialize(req, bundle) | |
json_string = resource.serialize(req, bundle, 'application/json') |