]> Pileus Git - ~andy/spades/blob - src/org/pileus/spades/Os.java
Prevent crash with zero-length strings
[~andy/spades] / src / org / pileus / spades / Os.java
1 package org.pileus.spades;
2
3 import android.util.Log;
4 import android.util.Base64;
5 import android.graphics.Color;
6
7 public class Os
8 {
9         /* Debugging */
10         public static void debug(String txt, Exception e)
11         {
12                 Log.d("Spades", txt, e);
13         }
14         public static void debug(String txt)
15         {
16                 Log.d("Spades", txt);
17         }
18
19         /* Utilities */
20         public static String base64(String txt)
21         {
22                 return Base64.encodeToString(txt.getBytes(), 0);
23         }
24
25         public static int getColor(String hex)
26         {
27                 return Color.parseColor("#"+hex);
28         }
29 }