此代码之前曾在三星上运行,但现在我正在使用Nexus One和Android 2.3.6,只要我拍照并点击确定或从图库中选择一张照片就会崩溃.Stacktrace在Uri上显示空指针异常.
我激活相机的代码如下:
public void activateCamera(View view){
Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
// start the image capture Intent
startActivityForResult(i, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if ((requestCode == CHOOSE_IMAGE_ACTIVITY_REQUEST_CODE || requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE)
&& resultCode == RESULT_OK && null != data) {
selectedImage = data.getData();
String[] filePathColumn = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(selectedImage,
filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
Bitmap bits …Run Code Online (Sandbox Code Playgroud) 这是我用来生成DH密钥对的代码:
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DH");
keyGen.initialize(1024, new SecureRandom());
KeyPair ackp = keyGen.generateKeyPair();
Run Code Online (Sandbox Code Playgroud)
(当然没有必要的尝试/捕获).
我已经做了一些测试,迭代地运行这些代码并改变密钥大小(特别是从128步增加到128步到1024. 1024将是所需的大小.
首先,运行每个大小生成10次以使结果具有一些最小的std偏差会导致结果的高波动,平均而言,创建密钥(1024位)所需的时间是:683027ms,其向上舍入到周围创建密钥需要11分钟.
问题是:
测试已在Nexus-One手机上进行
提前感谢您对"问题"有所了解
问候
我正在尝试在我的Nexus One上试验LED颜色,我在创建任何带有通知的LED灯(颜色)方面遇到了问题.LED灯不工作.我测试了硬件故障,这不是问题.这是代码.
Notification notification = new Notification(R.drawable.icon, tickerText, System.currentTimeMillis());
notification.ledARGB = Color.WHITE;
notification.ledOnMS = 300;
notification.ledOffMS = 1000;
notification.flags = Notification.FLAG_SHOW_LIGHTS | Notification.FLAG_AUTO_CANCEL;
//notification.defaults = Notification.DEFAULT_ALL;
notification.setLatestEventInfo(this, getText(R.string.tekst1),
text, makeIntent(R.drawable.icon));
notificationManager.notify(R.layout.main, notification);
Run Code Online (Sandbox Code Playgroud)
谁能告诉我我做错了什么?TNX.
我已经读过dalvik vm上有一个jit编译器模块,结果非常有希望.有些人声称执行速度提高了100%.有没有人知道什么时候它将被纳入Android版本?nexus上的RAM量(512MB)暗示可能很快就会引入jit.Android 2.5也许?
嗨,我使用Nexus One来调试我的项目......
但是当连接到计算机时(调试模式为ON),没有Log处于调试模式(Eclipse).该应用安装广告从计算机启动,但日志不显示...
我能做什么?想法?
我刚买了HTC Nexus One,我正在尝试用Android创建Air应用程序.我已经下载了适用于Windows的Android SDK并安装了它,但是在工具文件夹中我找不到adb.exe我正在观看以下视频http://www.gotoandlearn.com/play.php?id=123这显示了从一开始如何设置Air Applications for Android的步骤.
使用命令提示符我想使用"adb devices"命令检查我的设备是否已连接到PC.
我安装了Android SDK的所有可用软件包,包括Usb Driver软件包,修订版4.
但是,我没有这个文件.你能建议我做什么吗?