android-2.0-eclair

How can I force a GridView to use the whole screen (regardless of display size)?

[亡魂溺海] 提交于 2019-12-17 19:48:08
问题 I've got the following layout file, which has a GridView and an ImageView behind that as the background. <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right" android:layout_marginRight="-70dp" android:layout

Accelerometer stops delivering samples when the screen is off on Droid/Nexus One even with a WakeLock

丶灬走出姿态 提交于 2019-12-17 17:44:31
问题 I have some code that extends a service and records onSensorChanged(SensorEvent event) accelerometer sensor readings on Android. I would like to be able to record these sensor readings even when the device is off (I'm careful with battery life and it's made obvious when it's running). While the screen is on the logging works fine on a 2.0.1 Motorola Droid and a 2.1 Nexus One. However, when the phone goes to sleep (by pushing the power button) the screen turns off and the onSensorChanged

Android Live Wallpaper touch events

陌路散爱 提交于 2019-12-08 01:43:11
问题 I've just started with Android, I'm making a simple Live wallpaper. I'm testing it on a 2.1 emulator. The trouble is while it works in the preview screen before you choose "Set Wallpaper" the touch events don't appear to register on the screen once you've selected it as a wallpaper. Do I need to state anything in the manifest about touch events or so to get it to work? Little bit confused why it would work in one and not the other. public void handleTouchEvent(MotionEvent event) { if(event

Android - Get All Contacts from All Sources

こ雲淡風輕ζ 提交于 2019-12-06 09:01:14
问题 I have been attempting to make an Android application, built against 2.0, that requires getting all of the user's contacts and displaying them in a formatted way. I have been able to get a list using a Cursor and the ContactsContract.Contacts class. However, the list I get from that provider only gives me the contacts that are either from the user's Google account, or contacts that have two or more sources (e.g. Google + Facebook, Two Facebook accounts, etc). It does not give me the entire

Best Android 2.0 development book? [closed]

邮差的信 提交于 2019-11-29 20:38:28
I'm looking for a single book source for Android 2.0 development. While I may be ok with a general Android development book, a book which covers 2.0 features is ideal. What is the best Android 2.0 book out there, or upcoming? At the time of this writing, the Android 2.0 SDK has been available for about 2.5 weeks. Hence, it will be months before you will be able to compare a wide range of print books specifically for their Android 2.0 coverage. I will be impressed if there are more than three authors with Android 2.0-ready books by the end of February 2010. I can tell you that: One of my books

Best Android 2.0 development book? [closed]

混江龙づ霸主 提交于 2019-11-28 16:20:23
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I'm looking for a single book source for Android 2.0 development. While I may be ok with a general Android development book, a book which covers 2.0 features is ideal. What is the best Android 2.0 book out there, or upcoming? 回答1: At the time of this writing, the Android 2.0

How can I force a GridView to use the whole screen (regardless of display size)?

ε祈祈猫儿з 提交于 2019-11-28 09:24:11
I've got the following layout file, which has a GridView and an ImageView behind that as the background. <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right" android:layout_marginRight="-70dp" android:layout_marginBottom="-50dp" android:src="@drawable/s_background"/> <LinearLayout xmlns:android="http://schemas.android

Accelerometer stops delivering samples when the screen is off on Droid/Nexus One even with a WakeLock

谁说胖子不能爱 提交于 2019-11-28 04:59:37
I have some code that extends a service and records onSensorChanged(SensorEvent event) accelerometer sensor readings on Android. I would like to be able to record these sensor readings even when the device is off (I'm careful with battery life and it's made obvious when it's running). While the screen is on the logging works fine on a 2.0.1 Motorola Droid and a 2.1 Nexus One. However, when the phone goes to sleep (by pushing the power button) the screen turns off and the onSensorChanged events stop being delivered (verified by using a Log.e message every N times onSensorChanged gets called).

How to read contacts on Android 2.0

安稳与你 提交于 2019-11-26 00:05:38
问题 I\'m working on Android 2.0 and am trying to receive a list of all contacts. Since android.provider.Contacts.People is deprecated, I have to use android.provider.ContactsContract , But I can\'t find a proper example of how to use it (ex: retrieve a list of all contacts on the phonebook). Anyone knows where to find such an example? 回答1: First, ensure that you have added <uses-permission android:name="android.permission.READ_CONTACTS"/> to your AndroidManifest.xml file, then you can loop