Skip to content

Instantly share code, notes, and snippets.

@RichardNi
RichardNi / android studio gradle 添加动态库.md
Created February 6, 2015 07:09
android studio gradle 添加动态库
android {

    ......
    
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
 }
@RichardNi
RichardNi / Android模拟双击.java
Last active August 29, 2015 14:14
Android模拟双击按钮退出应用,转自:http://www.cnblogs.com/net168/p/4234869.html
private long mPressedTime = 0;
@Override
public void onBackPressed() {
//获取第一次按键时间
  long mNowTime = System.currentTimeMillis();
  
  //比较两次按键时间差
  if((mNowTime - mPressedTime) > 2000){
    Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
@RichardNi
RichardNi / android gradle配置签名证书.md
Last active August 29, 2015 14:14
android gradle 发布release版本时配置签名证书
android {

    ...
    
    signingConfigs {
        releaseConfig {
            storeFile file(System.getenv("KEYSTORE_PATH"))
            keyAlias System.getenv("KEY_ALIAS")
 storePassword System.getenv("KEYSTORE_PASSWORD")
@RichardNi
RichardNi / 创建Android签名证书文件.md
Last active August 29, 2015 14:14
创建Android签名证书文件

创建命令:keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

alias_name:证书别名;

-validity:有效天数;

您的名字与姓氏是什么?

[Unknown]:BoNi

方法1:

执行命令mvn archetype:create列出已存在的maven项目模板,根据具体提示进行操作即可。

**注:**有点慢

方法2:

执行命令:mvn archetype:create -DgroupId=com.demo -DartifactId=simple -DpackageName=com.demo.simple -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false