原创 Android分包MultiDex

用Gradle配置使用Multidex Android 的 Gradle插件在 Android Build Tool 21.1開始就支持使用multidex了。 設置你的應用程序開發項目中使用multidex配置,要求你做出一些

原创 Spring Boot中使用Spring-data-jpa讓數據訪問更簡單、更優雅

在實際開發過程中,對數據庫的操作無非就“增刪改查”。就最爲普遍的單表操作而言,除了表和字段不同外,語句都是類似的,開發人員需要寫大量類似而枯燥的語句來完成業務邏輯。 爲了解決這些大量枯燥的數據操作語句,我們第一個想到的是使用ORM

原创 FragmentTabHost

FragmentTabHost切換Fragment時避免UI重新加載. 用FragmentTabHost + Fragment,每次FragmentTabHost切換fragment時會調用onCreateView()重繪UI。

原创 RxAndroid的使用方式6-Retrofit2.0使用詳解

綜述   retrofit是由square公司開發的。square在github上發佈了很多優秀的Android開源項目。例如:otto(事件總線),leakcanary(排查內存泄露),android-times-square(

原创 Spring Boot快速入門

Spring Boot快速入門 簡介 Spring Boot的主要優點: 爲所有Spring開發者更快的入門 開箱即用,提供各種默認配置來簡化項目配置 內嵌式容器簡化Web項目 沒有冗餘代碼生成和XML配置的要求 快速

原创 RxAndroid的使用方式4-RxLifecycle

Rxlifecycle ( https://github.com/trello/RxLifecycle )就使被用來嚴格控制由於發佈了一個訂閱後,由於沒有及時取消,導致Activity/Fragment無法銷燬導致的內存泄露 。

原创 android styles

在android studio xml中報如下錯誤: Rendering Problems NOTE: This project contains Java compilation errors, which can cause

原创 Spring Boot構建RESTful API與單元測試

Spring Boot構建RESTful API與單元測試 首先,回顧並詳細說明一下在快速入門中使用的@Controller、@RestController、@RequestMapping註解。 @Controller:修飾cla

原创 Spring Boot開發Web應用

Spring Boot開發Web應用 靜態資源訪問 在我們開發Web應用的時候,需要引用大量的js、css、圖片等靜態資源。 默認配置 Spring Boot目錄名需符合如下規則: /static /public /reso

原创 Spring Boot中使用JdbcTemplate訪問數據庫

之前介紹了很多Web層的例子,包括構建RESTful API、使用Thymeleaf模板引擎渲染Web視圖,但是這些內容還不足以構建一個動態的應用。通常我們做App也好,做Web應用也好,都需要內容,而內容通常存儲於各種類型的數據

原创 Cannot create an instance of class ViewModel

Make sure your view Model class is public Make sure your view model class constructor is public Make sure you have

原创 ViewModel 時遇到的坑

通過 Activity 獲取 ViewModel 時遇到的坑: 在 Application.ActivityLifecycleCallbacks 中的 onActivityCreated 方法中獲取 ViewModel 時, Ac

原创 Arouter 報錯There is no route match the path

ARouter.openDebug() ARouter.openLog() 再測試運行的時候,一定要加上這兩句話 // It will rebuild router map every times when debuggable.

原创 bayes-opt安裝

bayes-opt 命令行安裝 pip install bayesian-optimization bayesian-optimization 0.6.0包的地址:https://pypi.org/project/bayesian-o

原创 anaconda 重新安裝

anaconda的官網https://www.anaconda.com/download/ 下載3.6的版本,下載之後,直接下一步下一步的安裝,非常的簡單。 問題出現在卸載之後,在重新安裝中就遇到了比較坑的問題。 重新安裝之後,只會