This file contains 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
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE := game_shared | |
LOCAL_MODULE_FILENAME := libgame | |
#traverse all the directory and subdirectory | |
define walk |
This file contains 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
Intent itb = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | |
itb.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(capturePicFile)); | |
startActivityForResult(itb); | |
//设置MediaStore.EXTRA_OUTPUT可以获取原始大小的图片,否则,相机仅仅返回小图片。 |
This file contains 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
//显示网页 | |
Uri uri = Uri.parse("http://google.com"); | |
Intent it = new Intent(Intent.ACTION_VIEW, uri); | |
startActivity(it); | |
//显示地图 | |
Uri uri = Uri.parse("geo:38.899533,-77.036476"); | |
Intent it = new Intent(Intent.ACTION_VIEW, uri); | |
startActivity(it); | |
//其他 geo URI 範例 |
This file contains 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
Intent itb = new Intent(); | |
itb.setType("image/*"); | |
itb.setAction(Intent.ACTION_GET_CONTENT); | |
itb.putExtra("crop", "true"); //选择后对图片进行剪裁 | |
itb.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(capturePicFile)); | |
startActivityForResult(itb, GET_IMAGE_FROM_LOCAL); |
This file contains 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
Intent intent = new Intent("com.android.camera.action.CROP"); | |
intent.setDataAndType(Uri.fromFile(capturePicFile), "image/*"); | |
//如何选择 | |
intent.putExtra("aspectX", 1); | |
intent.putExtra("aspectY", 1); | |
//输出大小 | |
intent.putExtra("outputX", 96); |
This file contains 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
//隐藏软键盘。 | |
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); | |
imm.hideSoftInputFromWindow(view.getWindowToken(), 0); | |
//进入activity不显示软键盘 | |
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); | |
或者在AndroidManifest.xml中设置android:windowSoftInputMode="adjustUnspecified|stateHidden"。 | |
This file contains 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
#!/bin/bash | |
# | |
# 多个进行并行执行任务 | |
# | |
SEND_THREAD_NUM=8 | |
tmp_fifofile="/tmp/$$.fifo" # 脚本运行的当前进程ID号作为文件名 | |
mkfifo "$tmp_fifofile" # 新建一个随机fifo管道文件 | |
exec 6<>"$tmp_fifofile" # 定义文件描述符6指向这个fifo管道文件 | |
rm $tmp_fifofile |
This file contains 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 boolean isIntentExisting(Context context, String action) { | |
final PackageManager packageManager = context.getPackageManager(); | |
final Intent intent = new Intent(action); | |
List<ResolveInfo> resolveInfo = | |
packageManager.queryIntentActivities(intent, | |
PackageManager.MATCH_DEFAULT_ONLY); | |
if (resolveInfo.size() > 0) { | |
return true; | |
} | |
return false; |
This file contains 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
/** | |
* \file include/stx/btree.h | |
* Contains the main B+ tree implementation template class btree. | |
*/ | |
/* | |
* STX B+ Tree Template Classes v0.9 | |
* Copyright (C) 2008-2013 Timo Bingmann <tb@panthema.net> | |
* | |
* Boost Software License - Version 1.0 - August 17th, 2003 |
This file contains 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
class Linux_0_01 | |
{ | |
int restart_syscall(); //0 | |
int exit(); //1 | |
int fork(); //2 | |
int read(); //3 | |
int write(); //4 | |
int open(); //5 | |
int close(); //6 | |
int waitpid(); //7 |
OlderNewer