原创 Data Binding 用戶指南(Android)

引自簡書 - Data Binding(數據綁定)用戶指南 1. 介紹 這篇文章介紹瞭如何使用Data Binding庫來寫聲明的layouts文件,並且用最少的代碼來綁定你的app邏輯和layouts文件。 Data B

原创 Android如何獲取asset下的xml文件,並解析

1.asset下的自定義xml文件:<Language cat="it"> <lan id="1"> <name>Java</name> <ide>Eclipse</ide> </lan>

原创 MySql數據庫文件遷移

一、CentOS7配置 IP地址設置-參考: https://www.cnblogs.com/yhongji/p/9336247.htm 打開關閉防火牆與端口-參考: https://www.cnblogs.com/moxiaoan/

原创 Android 項目中引用Unity3D建好的模型對象

最近在研究怎麼在Android 項目中添加Unity3D建模。在這裏寫個博客,算是總結一下。 首先在unity中把需要的模型建好,然後在unity 的 【File】 中選擇【Build Setting】如圖所示: 點開後會見到如下窗口:

原创 TextView的高級用法

private void initView() { // 字符串佔位符 TextView txt01 = (TextView) findViewById(R.id.txt01); txt01.

原创 Android Studio 快捷鍵、插件、基本設置、注意事項

之前一直使用Eclipse,現在換AS,剛開始真有些不適應。在使用AS有一段時間後,感覺AS最強大之處就是代碼提示功能。下面總結一下AS剛開始使用時的一些基本配置,磨刀不誤砍柴工,我們現在來好好磨磨刀。 一、 快捷鍵 快捷鍵這個東西

原创 如何定義BaseActivity與設定TitleBar

BaseActivity import android.app.Activity; import android.content.SharedPreferences; import android.os.Bundle; import an

原创 根據二代身份證號碼判斷年齡

/** * 根據二代身份證號碼判斷用戶年齡 * @param idCardNum * @return */ @SuppressLint("SimpleDateFormat") public static boolean agePa

原创 根據資源ID名獲取ID值

/** * 根據資源ID名獲取ID值 * 利用Java反射機制從 R.drawable 類中獲取資源ID * @param name * @return */ private in

原创 Activity XML 屬性詳解

android:screenOrientation 屏幕方向切換 android:configChanges 阻止Activity銷燬和重建 android:enabled 允許Activity被實例化 android:e

原创 Android 、Java 驗證二代身份證號碼是否正確

額~直接貼代碼吧~當個工具類 已經驗證過,包括尾字母是X(注意大寫)的身份證號碼。可放心使用。 送一個限制Edittext只輸入身份證號包含的字符 edittext.setKeyListener(new NumberKeyListene

原创 自定義Notification

可以通過Notification.Builder.setContent方法自定義Notification。setContent方法的原型如下: public Builder setContent(RemoteViews views);

原创 PHP Win7-64 環境搭建(PhpStorm + Apache24 + PHP56 + MySql + phpMyAdmin + xdebug)

PhpStorm + Apache24 + PHP56 + MySql + phpMyAdmin + xdebug 前期準備: 1、PhpStorm http://www.sdifenzhou.com/phpstorm20162.h

原创 修改Zookeeper日誌輸出路徑,並按照日期輸出

1、修改log4j.properties vi  /opt/zookeeper-3.4.8/conf/log4j.properties # Define some default values that can be overridde

原创 Android Studio NDK開發 Mac版

AS1.5版本對NDK開發優化了很多地方,網上一些帖子都是舊版本的。按照步驟做會有很多迷惑的地方。 既然有新版本那麼我們就按照新版本的來。 一、從配置環境開始。AS 選擇右上角【File】->【Project Structure】->【S