Useful ProGuard configurations for Android projects
-dontshrink
-dontoptimize
-dontpreverify
-verbose
-dontwarn javax.management.**
-dontwarn java.lang.management.**
-dontwarn org.apache.log4j.**
-dontwarn org.apache.commons.logging.**
-dontwarn org.slf4j.**
-dontwarn org.json.**
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keep class javax.** { *; }
-keep class org.** { *; }
-keep class twitter4j.** { *; }
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
Should Microsoft out-Apple Apple?
Tweet Microsoft’s strategy should not be to produce a better phone or tablet or to be the best mobile content provider. It cannot out-Apple Apple.
read moreProgramming fonts
Tweet It is a matter of preference, no doubt, but most developers I know prefer monospaced fonts. So what are the best ones to be used? Over the years, I’ve tried numerous fonts and the few that work good are Monaco, Menlo, and finally Ubuntu Mono. Menlo is a great font that comes with OS X and is used in X-Code. It is also the best font so far that I found to use with Eclipse. I have recently tried to work with Sublime Text 2. I have used TextWrangler before but Sublime seems so much more powerful out of the box. I read somewhere that...
read moreUsing Jackson JSON Parser in Android Project
Tweet After some research around JSON libraries I reached conclusion that Jackson would be the first choice, both because it is much more used then Gson and it seems to have performance edge over Gson as well. Unfortunately though, adding just the core and the databind jars, without using ProGuard inflates the size of the final APK by a whooping 600Kb.
read moreAndroid ICS style buttons for a dialog
Tweet This is basically how you create a standart borderless buttons, like the Android ICS ones. <!-- OK/Cancel buttons. --> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:divider="?android:attr/dividerHorizontal" android:showDividers="beginning" ...
read moreGit wizardry – easy way to get the change set from Git
Tweet There is a pretty way way to get the Git commits between versions which can be used to build the change set log. Below are the basic commands that should give you just that. But these commands are even more useful than this. This is almost too easy, this is why I call it wizardry The only requirement is that you somehow know what is the commit of the latest release you did (if that’s where you want to start your change set) To find a specific commit (if you had a meaningful commit message) git log --pretty=format:"%h -...
read moreGit tags cheat sheet
Tweet A short list of most useful Git commands to work with git tags. These should cover 90% of your needs. ### TAGS #create tag (annotated = with extra meta information) git tag -a ver1.4 -m 'my version 1.4' #list tags git tag #delete tag git tag -d XXX #delete remote tag #You just need to push an 'empty' reference to the remote tag name: git push origin :tagname #push tags to remote #specific tag: git push origin v1.5 #all tags: git push origin...
read moreSkype – clever upgrade marketing :)
Tweet Quite clever and funny upgrade marketing message from Skype
read moreProGuard – keep entire package (different variations)
Tweet Keeps the names of all public classes in the specified package: -keep public class com.myapp.customcomponents.* The following configuration keeps the names of all public classes in the specified package and its subpackages: -keep public class com.myapp.customcomponents.** The following configuration keeps the names of all public/protected classes/fields/methods in the specified package and its subpackages: -keep public class com.myapp.customcomponents.** { public protected...
read moreWhy I hate Facebook Engineers
Tweet I hate facebook Engineers. Yes, you heard me right. I hate them. Well, maybe not them but their hairy pointy managers and bosses who… wait a second, isn’t facebook “famous” for being all staffed with engineers? So yes, I hate facebook Engineers Now you will say but why, they are mostly smart guys and facebook is so spectafackamazing. WHY?!?… Well, for one their mobile SDK suck. Full of bugs, crashes and other pleasantries. I did at least 5 updates solely because there was some problem with Facebook and the...
read moreCleaning up and removing unused ports in your MacPorts
Tweet To remove inactive ports: sudo port uninstall inactive To remove downloaded distfiles with: sudo port clean --all installed To remove orphaned (not referenced and not anymore used ports) you can use an external tool port_cutleaves First install the tool using MacPorts sudo port install port_cutleaves Then run it sudo port_cutleaves
read more