nexus-one

Light sensor on Nexus One returns only two distinct values

六月ゝ 毕业季﹏ 提交于 2019-12-05 01:05:40
问题 I´m trying to read the values of the Light Sensor of my Nexus One, but I´mgetting only following values: 10.0 225.0 and in a few cases some values much higher. The used code: sensorManager = (SensorManager) context .getSystemService(Context.SENSOR_SERVICE); sensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT); listener = new SensorEventListener() { @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { } @Override public void onSensorChanged(SensorEvent event) { Log.d

Android camera capture activity returns null Uri

99封情书 提交于 2019-12-04 09:07:20
This code worked on samsung before but now that i'm using Nexus One with Android 2.3.6, it's crashing as soon as I take a picture and click ok or choose a photo from gallery. Stacktrace shows a null pointer exception on the Uri. My code for the activating the camera is as follows: 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,

Light sensor on Nexus One returns only two distinct values

混江龙づ霸主 提交于 2019-12-03 17:28:34
I´m trying to read the values of the Light Sensor of my Nexus One, but I´mgetting only following values: 10.0 225.0 and in a few cases some values much higher. The used code: sensorManager = (SensorManager) context .getSystemService(Context.SENSOR_SERVICE); sensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT); listener = new SensorEventListener() { @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { } @Override public void onSensorChanged(SensorEvent event) { Log.d(Constants.TAG, "Brightness: " + event.values[0]); } }; sensorManager.registerListener(listener, sensor,

Nexus One / Android “CPU may be pegged” bug

折月煮酒 提交于 2019-12-03 11:35:54
问题 I'm writing a graphically intense game for the Nexus One, using the NDK (revision 4) and OpenGL ES 2.0. We're really pushing the hardware here, and for the most part it works well, except every once in a while I get a serious crash with this log message: W/SharedBufferStack( 398): waitForCondition(LockCondition) timed out (identity=9, status=0). CPU may be pegged. trying again. The entire system locks up, repeats this message over and over, and will either restart after a couple minutes or we

DH Keypair generation time on Android

老子叫甜甜 提交于 2019-12-03 11:17:24
问题 This is the code that I'm using to generate a DH keypair: KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DH"); keyGen.initialize(1024, new SecureRandom()); KeyPair ackp = keyGen.generateKeyPair(); (without the needed try/catch, of course). I've done some tests running such code iteratively and varying the key size (in particular ramping up from 128 with a 128 step up to 1024. 1024 would be the desired size. First of all, running each size generation 10 times to have some minimal std

DH Keypair generation time on Android

我是研究僧i 提交于 2019-12-03 00:48:25
This is the code that I'm using to generate a DH keypair: KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DH"); keyGen.initialize(1024, new SecureRandom()); KeyPair ackp = keyGen.generateKeyPair(); (without the needed try/catch, of course). I've done some tests running such code iteratively and varying the key size (in particular ramping up from 128 with a 128 step up to 1024. 1024 would be the desired size. First of all, running each size generation 10 times to have some minimal std deviation on the results gives HIGH fluctuation of results, on average, anyway, the time needed for

How can I pull databases off my android onto my desktop?

隐身守侯 提交于 2019-11-30 04:04:13
I'm trying this with my Nexus One. I have the android SDK and have used the command adb pull /data/data/com.myapp.android/databases C:\pulls but all I get is pull: building file list... 0 files pulled. 0 files skipped. Also, it seems no matter how much data I add to the tutorial NotePad app I installed, the data size for the app (as shown in Settings) never exceeds 8KB. How is this possible? Is there some other place where databases are stored? When I use the File Explorer view (that's part of ADT) in Eclipse, I see there's nothing in /data. To add a twist, I have no trouble pulling any other

How can I pull databases off my android onto my desktop?

流过昼夜 提交于 2019-11-29 01:12:46
问题 I'm trying this with my Nexus One. I have the android SDK and have used the command adb pull /data/data/com.myapp.android/databases C:\pulls but all I get is pull: building file list... 0 files pulled. 0 files skipped. Also, it seems no matter how much data I add to the tutorial NotePad app I installed, the data size for the app (as shown in Settings) never exceeds 8KB. How is this possible? Is there some other place where databases are stored? When I use the File Explorer view (that's part

Android logging levels

风格不统一 提交于 2019-11-28 03:42:38
I'm having a little difficulty configuring Android logging. Here's what my code looks like: if (Log.isLoggable("MY_TAG", Log.VERBOSE)) { Log.v("MY_TAG", "Here's a log message"); } Pretty simple, right? However, I'm having quite a bit of difficulty getting the Log.isLoggable("MY_TAG", Log.VERBOSE) to return true. Per http://developer.android.com/reference/android/util/Log.html , I tried adding a local.prop file to the /data/ directory which looks like this: log.tag.MY_TAG=VERBOSE but no luck. I also tried: System.setProperty("log.tag.MY_TAG", String.valueOf(Log.VERBOSE)); but that doesn't work