DFdou's Blog Life is short,Be yourself.

2601/100

Android-MotoDev Shop4Apps

MotoDev Shop4Apps对中国开放,目前豆腐的状态是刚注册了下,具体还没有发布,晚上回去测试。
另外就是我也没下载Moto的Market客户端,里边的Apk介绍希望做的比Google Market好一点,不然,,只能说两个字,杯具。
来几张可爱的图:
motorola
motorola
motorola
很Q,很可爱~

2201/100

Flash-TextHighlighter

最近是越来越懒了,Blog有段时间接近于荒废……今天更新下哈。
顾名思义,TextHighlighter就是代码高亮,Demo和做法在这里:http://blog.formatlos.de/2009/06/22/as3-texthighlighter/
1.0版的下载:TextHighlighter_01.zip
Code:

// highlight container
var highlight : Sprite = new Sprite();
addChild(highlight);

// create textfield
var textField : TextField = new TextField();
addChild(textField);

// apply text style and add text
...

// highlight style
var style : IHighlightStyle = new SimpleHighlightStyle(0x00ff00, 0.5);

// highlighter
var textHighlighter : TextHighlighter = new TextHighlighter(textField, highlight, style);
textHighlighter.highlight(/far/gi);
textHighlighter.highlight("Duden", false);
2101/103

Flash-鼠标,键盘事件

今天咱来看下Flash的鼠标和键盘事件。。
先放Demo:

这个Demo实现的功能很简单,鼠标放到小球上,小球透明度会变成0.5,鼠标移开会恢复到1,按住鼠标可以拖动小球。按下键盘的上下左右键可以移动小球。
下边咱慢慢来看下,显示fla文档下的代码:

//设置舞台属性,坐上角对齐,不拉伸
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;

//new一个Role类的实例出来,并居中显示
var mRole = new Role(stage);
addChild(mRole);
setCenter(mRole);

function setCenter(obj:DisplayObject):void{
	obj.x = (stage.stageWidth - obj.width)/2;
	obj.y = (stage.stageHeight - obj.height)/2;
}

//onResize事件
stage.addEventListener(Event.RESIZE,mResize);
function mResize(e:Event):void{
	//场景大小变化时的操作
}
Tagged as: Continue reading
2001/101

Android-Permission V1.0

Android Permission大全出自1.0 SDK中记录着新改变的访问权限许可。程序执行需要读取到安全敏感项必需在androidmanifest.xml中声明相关权限请求,完整列表如下:
PS:在开发中,调用到系统功能的时候,如果程序代码逻辑无错,但是被强行终止多半都是因为权限的原因。

  android.permission.ACCESS_CHECKIN_PROPERTIES允许读写访问"properties"表在checkin数据库中,改值可以修改上传( Allows read/write access to the "properties" table in the checkin database, to change values that get uploaded)

  android.permission.ACCESS_COARSE_LOCATION允许一个程序访问CellID或WiFi热点来获取粗略的位置(Allows an application to access coarse (e.g., Cell-ID, WiFi) location)

  android.permission.ACCESS_FINE_LOCATION允许一个程序访问精良位置(如GPS) (Allows an application to access fine (e.g., GPS) location)

  android.permission.ACCESS_LOCATION_EXTRA_COMMANDS允许应用程序访问额外的位置提供命令(Allows an application to access extra location provider commands)

  android.permission.ACCESS_MOCK_LOCATION允许程序创建模拟位置提供用于测试(Allows an application to create mock location providers for testing)

  android.permission.ACCESS_NETWORK_STATE允许程序访问有关GSM网络信息(Allows applications to access information about networks)

  android.permission.ACCESS_SURFACE_FLINGER允许程序使用SurfaceFlinger底层特性(Allows an application to use SurfaceFlinger's low level features)

  android.permission.ACCESS_WIFI_STATE允许程序访问Wi-Fi网络状态信息(Allows applications to access information about Wi-Fi networks)

  android.permission.ADD_SYSTEM_SERVICE允许程序发布系统级服务(Allows an application to publish system-level services).

  android.permission.BATTERY_STATS允许程序更新手机电池统计信息(Allows an application to update the collected battery statistics)

  android.permission.BLUETOOTH允许程序连接到已配对的蓝牙设备(Allows applications to connect to paired bluetooth devices)

1901/100

mklink 简单用法

mklink是 链接文件命令,具体用途是连接文件夹,或者说引用更来的直接?
什么时候会用到这个命令,以及在什么环境下可以用?
Windows平台下需要Vista或者更高版本,比如目前的Win7。
在非Windows下边基本都可以用。
Windows下的命令行如下,记得用管理员帐号运行cmd。

mklink "F:\目标文件夹" "E:\源文件夹" /j
Tagged as: No Comments
1401/100

Android-OnGestureListener接口

在做应用的时候难免会碰到触摸事件,Android提供了不少事件,只要实现OnGestureListener接口,并且呢,在onTouch方法里写个:

//记得要implements OnTouchListener,OnGestureListener
//public class mGestureDetector extends Activity implements OnTouchListener,OnGestureListener
private GestureDetector mGestureDetector;
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	// setContentView(R.layout.main);
	View v = new View(this);
	setContentView(v);
        //mGestureDetector是个GestureDetector对象,记得初始化一下。
	mGestureDetector = new GestureDetector(this);
        //另外呢,需要针对onFling方法的监听,需要在监听的View里边加上:
	v.setOnTouchListener(this);
	v.setLongClickable(true);
}
public boolean onTouch(View v, MotionEvent mo) {
	return mGestureDetector.onTouchEvent(mo);
}

另外是OnGestureListener接口必须实现的几个方法,具体要怎么实现大家自个儿对号入座吧。

public boolean onDown(MotionEvent e) {
	return false;
}
public void onLongPress(MotionEvent e) {
}
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
    float distanceY) {
	return false;
}
public void onShowPress(MotionEvent e) {
}
public boolean onSingleTapConfirmed(MotionEvent e) {
	return false;
}
public boolean onSingleTapUp(MotionEvent e) {
	return false;
}
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
    float velocityY) {
	return true;
}
1301/100

Google-New Approach To China

真是每天都有新闻,今天比昨天的baidu被干掉还要厉害。Google官方博文如下(被xxx的党和谐了):

Like many other well-known organizations, we face cyber attacks of varying degrees on a regular basis. In mid-December, we detected a highly sophisticated and targeted attack on our corporate infrastructure originating from China that resulted in the theft of intellectual property from Google. However, it soon became clear that what at first appeared to be solely a security incident--albeit a significant one--was something quite different.

First, this attack was not just on Google. As part of our investigation we have discovered that at least twenty other large companies from a wide range of businesses--including the Internet, finance, technology, media and chemical sectors--have been similarly targeted. We are currently in the process of notifying those companies, and we are also working with the relevant U.S. authorities.

Second, we have evidence to suggest that a primary goal of the attackers was accessing the Gmail accounts of Chinese human rights activists. Based on our investigation to date we believe their attack did not achieve that objective. Only two Gmail accounts appear to have been accessed, and that activity was limited to account information (such as the date the account was created) and subject line, rather than the content of emails themselves.

Third, as part of this investigation but independent of the attack on Google, we have discovered that the accounts of dozens of U.S.-, China- and Europe-based Gmail users who are advocates of human rights in China appear to have been routinely accessed by third parties. These accounts have not been accessed through any security breach at Google, but most likely via phishing scams or malware placed on the users' computers.

1101/100

Flash-SWFAddress

SWFAddress是个干嘛用的东西呢?请看下边的内容:
主要就是一个SEO优化和URL语义化的东西,建议Flash整站的都看下吧~

SWFAddress - Deep linking for Flash and Ajax

SWFAddress is a small but powerful library that provides deep linking for Flash and Ajax. It's a developer tool, allowing creation of unique virtual URLs that can point to a website section or an application state. SWFAddress enables a number of important capabilities which are missing in today's rich web technologies including:

  • Bookmarking in a browser or social website
  • Sending links via email or instant messenger
  • Finding specific content with the major search engines
  • Utilizing browser history and reload buttons

Download SWFAddress 2.4 (12MB, Including docs, samples and sources) or just the core scripts and libraries (39KB).

Samples

Flash | Flex | Ajax | SEO | More »

License

SWFAddress is licensed under the MIT license.

Source

The latest and greatest development version of the project can be found at SourceForge.

Tagged as: No Comments
601/100

Android – AlertDialog,Dialog

丢一个自定义AlertDialog的例子。

AlertDialog.Builder alert = new AlertDialog.Builder(aBrainExploration.this);

alert.setTitle(R.string.label_enterOneName);

// Set an EditText view to get user input
final EditText input = new EditText(aBrainExploration.this);
alert.setView(input);

alert.setPositiveButton("Ok",
        new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog,
                    int whichButton) {
                Appendable value = input.getText();
                // setTitle(value.toString());
            }
        });

alert.setNegativeButton("Cancel",
        new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog,
                    int whichButton) {
                // Canceled.
            }
        });

alert.show();

相对来说有个更轻量级的Dialog类,用法也是差不多~