This file contains hidden or 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
final NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) | |
.setContentTitle(context.getString(R.string.app_name)) | |
.setSmallIcon(R.mipmap.ic_launcher) | |
.setContentText("notification with image") | |
.setContentIntent(resultPendingIntent) | |
.setPriority(Notification.PRIORITY_DEFAULT) | |
.setAutoCancel(true) | |
.setGroup(context.getString(R.string.app_name)) | |
.setDefaults(defaults); |
This file contains hidden or 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
public class TwitterDialog extends Dialog { | |
static final float[] DIMENSIONS_LANDSCAPE = {460, 260}; | |
static final float[] DIMENSIONS_PORTRAIT = {280, 420}; | |
static float[] DIMENSIONS_PORTRAIT_1; | |
static final FrameLayout.LayoutParams FILL = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, | |
ViewGroup.LayoutParams.MATCH_PARENT); |
This file contains hidden or 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
public final class Log { | |
public static boolean DEBUG = true; | |
public static String TAG = "TestDB"; | |
public static void v(String msg) { | |
if (DEBUG) | |
android.util.Log.v(TAG, msg); | |
} |
This file contains hidden or 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
public class ClassUtils { | |
public static String objectToInsert(Object mainObj) { | |
Field[] fields = mainObj.getClass().getFields(); | |
String key, value; | |
// System.out.println("Number of fields = " + fields.length); | |
StringBuffer keyData = new StringBuffer(" ("); | |
StringBuffer valueData = new StringBuffer(" VALUES("); | |
Vector<String> arrKey = new Vector<String>(); |
This file contains hidden or 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
public class FbHelper { | |
private Context mContext; | |
private Activity mActivity; | |
public static final String POST_SUCESS = "post_sucess"; | |
public static final String POST_FAIL = "post_fail"; | |
public static final String POST_LOGIN_NOTFOUND = "post_login_notfound"; |
This file contains hidden or 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
public class Global { | |
public static DBConnect dbObject; | |
// create test_db.sqlite in assets folder with sqlite version 3.0 | |
} |
This file contains hidden or 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
public class KeyboardUtility | |
{ | |
public static void hideSoftKeyboard(Activity activity) | |
{ | |
try | |
{ | |
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE); | |
inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0); | |
} | |
catch (Exception e) |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
<item android:id="@android:id/background"> | |
<shape> | |
<corners android:radius="20dp" /> | |
<gradient | |
android:angle="-90" | |
android:centerColor="@android:color/black" |
This file contains hidden or 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
public class Constants { | |
public static final class Database { | |
public static final String DB_NAME = "test_db.sqlite"; | |
} | |
} |
This file contains hidden or 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
public class Connectivity { | |
/** | |
* Get the network info | |
* @param context | |
* @return | |
*/ | |
public static NetworkInfo getNetworkInfo(Context context){ | |
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); | |
return cm.getActiveNetworkInfo(); |
NewerOlder