Posts

Showing posts from 2016

Log.v(), Log.d(), Log.i(), Log.w() and Log.e() - When to use each one?

I found a wonderful explanation of these on Stackoverflow and I stole them from Kurtis Nusbaum so you won't have to. You're welcome! So... you come to me and ask: When and which one to use? Let me (that is... him) tell you what I stole: Log.e : This is for when bad stuff happens. Use this tag in places like inside a catch statment. You know that an error has occurred and therefore you're logging an error. Log.w : Use this when you suspect something shady is going on. You may not be completely in full on error mode, but maybe you recovered from some unexpected behavior. Basically, use this to log stuff you didn't expect to happen but isn't necessarily an error. Kind of like a "hey, this happened, and it's weird, we should look into it." Log.i : Use this to post useful information to the log. For example: that you have successfully connected to a server. Basically use it to report successes. Log.d : Use this for debugging purposes. If you want to p

Git vejenje za budale (Git branching for schmucks)

<Slovenian language> Ker je za delo (tudi samostojno delo!) branching tako zelo uporabna metoda sem se odločil , da spišem tale kratek potek dela. Teorija gre nekako tako: Programer se loti nekega spreminjanja kode za katerega pa ne ve, če bo sploh uporaben. Recimo, da hočete v vaš program dodati možnost izvoza podatkov v Libre Office. Zato namesto da pišete v MASTER repo raje naredi novo vejo (branch), ki jo poimenuje po spremembi, ki jo želiote izvesti. Torej nekako tako: Git checkout -b libreOffice -b je za branch V ukazni lupini boste zaznali spremembo: namesto npr: Hoornet@prostitute /c/Delo/MyWorkDir ( master ) Bo sedaj Hoornet@prostitute /c/Delo/MyWorkDir ( libreOffice ) Git vam tako sporoča na kateri veji se trenutno nahajate. Preskok je u šubu. Pri kreaciji nove veje to pomeni, da imate še vedno na voljo vso kodo od prej a lahko sedaj bolj ziheraško spreminjate kodo, saj manipulerate drugo vejo. V kateremkoli trenutku se lahko vrnete na

Live templates for Android Studio 2 - Cheat sheet

Hello, my two visitors and hello Google crawler! While this is my first post (and possibly the only one, unless some miracle happens) so I should introduce my self... Nah! You can manage without it, I'm sure! So this is it - short and ...well...just short! At the top are those live templates, that are most important to me personally - the rest follow later. Loggers: Log.d(TAG, String) logd android.util.Log.d(TAG , "$METHOD_NAME$: $content$" ) ; Log.e(TAG, String, Exception) loge android.util.Log.e(TAG , "$METHOD_NAME$: $content$" , $exception$) ; Android: Define android style int constant const private static final int $name$ = $value$ ; Create a new Toast Toast android.widget.Toast.makeText( $className$. this, "$text$" ,  Toast.LENGTH_SHORT).show() ; findViewById with cast fbc ($cast$) findViewById(R.id.$resId$) ; get a String from resources rgS $resources$.getString(R.string.$stri