android-2.2-froyo

ContentProvider without SQL

元气小坏坏 提交于 2019-12-09 16:22:20
问题 I have two pieces of data that need to be accessed from outside applications and stored. According to documentation ContentProviders are the only possible way, but it also mentions external storage. ContentProviders implement a database-like "interface" and using a database would be extremely unnecessary for two pieces of data. I would rather save them to a file, but using a ContentProvider by implementing the abstract methods is problematic because the methods are structured as database

UiModeManager - NightMode (Froyo)

↘锁芯ラ 提交于 2019-12-09 06:44:50
问题 I have been trying to turn off the backlight of the buttons in my application using the UiModeManager's nightmode function. The default Desk Clock application (Nexus One) turns off the backlight when it is dimmed, and I want to do this as well. I've tried using the following code: UiModeManager mgr = (UiModeManager) getSystemService(UI_MODE_SERVICE); mgr.setNightMode(UiModeManager.MODE_NIGHT_YES); The UiModeManager.setNightMode(int mode) documentation says this: Sets the night mode. Changes

Modifying and recompiling the Android SDK

社会主义新天地 提交于 2019-12-09 06:33:56
问题 I know that some methods and some classes that are implemented in Android are not exported to the Android public SDK. I've been able to create an application that uses some of these functions by compiling my application placing it inside the Android tree. Would it be possible to export these functions to the Android SDK by recompiling it from the sources? How can this be done? Can I include custom classes and functions in the Android SDK as well (supposing of course I create a new SDK and a

Camera crashes in Android 2.2

拟墨画扇 提交于 2019-12-08 22:35:58
问题 I have tested my application on the Android SDK on everything from 1.5 to 2.2 and the camera code in my activity works fine. Running it on a device with 2.1 is also working. But the same app does not work with 2.2 on HTC Desire and Nexus One and the app crashes. Any ideas why they might be happening? Am using import android.hardware.Camera; . Inside onCreate I have this: preview = (SurfaceView) findViewById(R.id.preview); previewHolder = preview.getHolder(); previewHolder.addCallback

Geo Fix command does not pass altitude

你。 提交于 2019-12-08 19:16:35
问题 On Android 2.2 Emulator, the "geo fix" command seems not to be working properly. The emulator responds "OK", and onLocationChanged() is properly called in my program. However, the Location object seems not to be complete - it registers latitude and longitude just fine, but it does not contain an altitude reading: hasAltitude() returns false . Any ideas why? Example emulator commands: geo fix -74 40.75 500 geo fix -77 39 400.0 Code snippet: public void onLocationChanged(Location loc) { System

Android: Camera Preview Orientation on HTC EVO (Android 2.1 or 2.2)

六眼飞鱼酱① 提交于 2019-12-08 18:40:29
I am developing an Android application that relies on the camera API, using an HTC EVO as my testing device. No matter what I've tried so far, the only time the camera preview looks right is in landscape mode (90 degrees rotation, to be specific). It seems as though there is no way to orient the preview correctly when in portrait mode (0 degrees rotation). The default camera application on the device (for HTC Sense) allows for any kind of rotation without any problem, so I know that there is no hardware limitation. I even downloaded some source code from HTC's developer site , but it's all in

How to tell whether a specific TTS engine is checked (enabled)?

懵懂的女人 提交于 2019-12-08 16:03:10
问题 This question refers on Android 2.2 only: The following screenshot shows 3 different text-to-speech engines installed: PIco TTS (Android's default as of Froyo 2.2) IVONA Text-to-Speech HQ SVOX Classic TTS In this screenshot, you could see that not all 3 are checked (enabled). Instead, IVONA is unchecked, leaving only Pico (implied, as it's hard-coded in) and SVOX (checked). I would like to be able to programmatically query from my application whether a specific TTS engine (e.g. IVONA) is

Retrieve minSdkVersion programmatically

一曲冷凌霜 提交于 2019-12-08 06:03:57
问题 I have set the minSdkVersion in the manifest. Now I want to retrieve it in the code. It should be easy but I'm not getting it. How can I do that? 回答1: minSDKVersion is one of the settings in the Android manifest for which there is no API to read the value. It's not impossible to get hold of - you just end up having to read the AndroidManifest.xml file yourself via XmlResourceParser parser = getResources().getAssets().openXmlResourceParser("AndroidManifest.xml") and then parsing the

Building for Froyo, Styling for ICS

℡╲_俬逩灬. 提交于 2019-12-08 04:07:22
问题 I'm planning on writing an app and building against 2.2 Froyo (API Level 8). However, I want app users of 4.0 ICS to experience the app with the ICS user interface. Currently my approach is to have the default activity of my app sense the version of the Android device. If it is less than 4.0, use XML views written for Gingerbread and Froyo and, if it's 4.0 or higher to use ICS XML views. This however seems a bit haphazard and I'm not sure I can manage the separation of version views

Play-Services for Froyo not to be found on gradle?

家住魔仙堡 提交于 2019-12-07 13:51:35
问题 I know that there is a new way of handling Maps in our applications, specifically if we want to have support for Android 2.2 and below. The new library google-play-services-for-froyo can be downloaded via the SDK Manager But I can't seem to find the gradle URL. Gradle, please only gives the compile 'com.google.android.gms:play-services:4.1.32' standard line. I was able to find the following in the Manifest.xml of the downloaded library in the "extras" folder on my hard drive: <manifest xmlns