編輯:關於Android編程
在libs裡加上Flurry的jar包
可以寫一個Flurry的管理類:
public class FlurryTypes { public static final String DOWNLOAD_BOOK = down load book; public static final String BOOK_NAME = book_name; public static final String VIEW_AUTHOR = view_author; public static final String AUTHOR_NAME = author_name; public static final String VIEW_BOOK = view_author; public static final String DOWNLOAD_ERROR = down_load_error; public static final String CLECIK_MENU = click_menu; public static final String OPERTION = operation; public static final String AUTHOR_LIST = author_list; public static final String MY_FAV = My_fav; public static final String TURN_ON_PAGE = turn on page_animation; public static final String VOICE_TURN_ON = voice turn on; public static final String CHANGE_BACKGROUND = change background; public static final String FEEDBACK = feed back; public static final String SHARE = share; public static final String CHECK_UPDATE = check update; public static final String DELETE_FAVORITE = delete favorite book; public static final String DELETE_AUTHOR = delete author; public static final void onStartSession(Context context){ if (Global.ENABLE) { try { FlurryAgent.setUseHttps(false); FlurryAgent.setCaptureUncaughtExceptions(true); //這個是KEY FlurryAgent.onStartSession(context, ZJN9MZFDFQNZPFVHNJCX); FlurryAgent.setLogEvents(true); } catch (java.lang.Throwable t) { } } } public static final void onEndSession(Context context){ if (Global.ENABLE) { try { FlurryAgent.onEndSession(context); } catch (java.lang.Throwable t) { } } } public static final void onEvent(String eventId){ if (Global.ENABLE) { long currentTime = SystemClock.elapsedRealtime(); try { Mapparams = new HashMap (); FlurryAgent.onEvent(eventId,params); } catch (java.lang.Throwable t) { } } } public static final void onEventUseMap(String eventId, Map map) { if (Global.ENABLE) { try { FlurryAgent.onEvent(eventId, map); } catch (java.lang.Throwable t) { } } } public static final void onEvent(String eventId, String paramValue){ if (Global.ENABLE) { try { HashMap params = new HashMap (); params.put(eventId, paramValue); FlurryAgent.onEvent(eventId, params); } catch (java.lang.Throwable t) { } } } public static final void onEvent(String eventId, String paramKey, String paramValue){ if (Global.ENABLE) { long currentTime = SystemClock.elapsedRealtime(); try { Map params = new HashMap (); params.put(paramKey, paramValue); FlurryAgent.onEvent(eventId, params); } catch (java.lang.Throwable t) { } } } }
@Override protected void onStart() { super.onStart(); FlurryTypes.onStartSession(this); } @Override protected void onStop() { super.onStop(); FlurryTypes.onEndSession(this); }
FlurryTypes.onEvent(FlurryTypes.DELETE_AUTHOR, FlurryTypes.AUTHOR_NAME, info.name);
Map map = new HashMap(); map.put(FlurryTypes.BOOK_NAME, novelinfo.name); map.put(FlurryTypes.AUTHOR_NAME, novelinfo.author); FlurryTypes.onEventUseMap(FlurryTypes.DOWNLOAD_BOOK, map);
GreenDao的GitHub地址:https://github.com/greenrobot/greenDAO新建gradle空白項目,項目結構如下:新建”
本文實例講述了Android編程實現仿易信精美彈出框效果。分享給大家供大家參考,具體如下:截圖:動畫效果介紹:1.點擊ActionBar上“+”按鈕,菜單從上方彈出(帶反
前言因為這個RxJava內容不算少,而且應用場景非常廣,所以這個關於RxJava的文章我們會陸續更新,今天就來先來個入門RxJava吧初識RxJava什麼是Rx很多教程在
筆者有一段時間沒有發表關於Android的文章了,關於Android自定義組件筆者有好幾篇想跟大家分享的,後期會記錄在博客中。本篇博客給大家分享的是自定義一個日期選擇器,