android-2.2-froyo

Android ParcelFileDescriptor.createPipe() for Froyo?

落花浮王杯 提交于 2019-12-01 19:58:21
I have a need to use ParcelFileDescriptor.createPipe() , but I would still like to target API 8/Froyo. This function requires API 9/Gingerbread. I have read that there are compatibility kits that allow newer API functions to be used on the older OS versions, but know nothing about them. Is that an option here? If not, what would be the cleanest method for going about duplicating this functionality? I have considered using fromSocket() and making a simple network connection over the loopback interface, but that seems like more overhead than is needed, if there were a simpler way. Any thoughts

Camera.getNumberOfCameras() not working on Android 2.2

此生再无相见时 提交于 2019-12-01 15:45:27
问题 I am trying to use API Camera.getNumberOfCameras() but getting error "Cannot find symbol" while compiling. My API level is 8. Can anyone please tell me whats the way to get this function work? Thanks. 回答1: That method was not introduced until API Level 9 (Android 2.3). You cannot use it on older versions of Android. Here is a sample project demonstrating how to use it on newer versions of Android while safely avoiding it on older versions of Android. 回答2: I know its an old post.But updating

Which versions of Android SDK support coding in which versions of Java?

為{幸葍}努か 提交于 2019-12-01 15:32:29
I was writing an Android app for Android SDK 2.3.3 but then I was asked to test it on a device running Android 2.2.1. So I set my target to 8 instead of 10. But then java.util.concurrent.TimeUnit only had the Java 1.5 feature set instead of the Java 1.6/1.7 feature set of java.util.concurrent.TimeUnit. So I put the openjdk 6 implementation of TimeUnit into my package for my Android app and everything works fine. Does anyone know where I can get some documentation that gives me a chart that tells me, for example, that when using the official SDK, Android 2.2 has to be coded using Java 1.5

Android 2.2 SDK - Droid X Camera Activity doesn't finish properly

删除回忆录丶 提交于 2019-12-01 11:53:25
I noticed the default camera activity I call on a Droid X is different looking than the one on my Droid and Nexus One. After selecting "OK" on the Droid and Nexus One, the activity would finish - the Droid X has a "Done" button (which takes you back to the Camera, instead of finishing the activity), and the only way to get to the screen I want is to hit the "Back" button. Here is the class that works on Android 2.2/2.3, but not for Droid X's: package com.android.xxx; import java.io.File; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os

error while opening eclipse

拜拜、爱过 提交于 2019-12-01 07:37:30
When I try opening eclipse it opens, but it shows one error i.e Android SDK content Loader has encountered a problem.parseSdkContent failed When I click on details button, it shows me parseSdkContent failed java.lang.NullPointeException . And when I tried to create AVD it shows error that Location of the android SDK has not been setup in the preferences while I have already set the path in preferences. Please help me. Because of this issue my work is pending. I work in this problem for 2 days. In my workspace I have 2 projects. After review both project.properties, project 1 reference project

Is there a documented way, in Android 2.x, to inspect multiple sd cards for content?

南楼画角 提交于 2019-12-01 05:56:11
Some Android 2.x tablets such as the HTC Flyer and Samsung Galaxy Tab support both internal tablet storage and an external SD card. For example on my Flyer, /sdcard and /sdcard2 are separate, with the former representing the tablet's "internal storage." If I use Environment.getExternalStorageDirectory() , there doesn't seem to be any set rule on which of those storage locations will be returned. In using getExternalStorageDirectory() , my concern is that I'll only find media stored on one of the two storage locations. One solution is to just hard-code scanning /sdcard* into the application,

error while opening eclipse

喜欢而已 提交于 2019-12-01 04:48:15
问题 When I try opening eclipse it opens, but it shows one error i.e Android SDK content Loader has encountered a problem.parseSdkContent failed When I click on details button, it shows me parseSdkContent failed java.lang.NullPointeException . And when I tried to create AVD it shows error that Location of the android SDK has not been setup in the preferences while I have already set the path in preferences. Please help me. Because of this issue my work is pending. 回答1: I work in this problem for 2

Android Multiple Contacts Chooser (with option of choosing which phone number)

僤鯓⒐⒋嵵緔 提交于 2019-12-01 04:23:23
问题 I need to be able to select multiple contacts in Android. The flow is like this : User clicks on a button which opens the Contacts application. However, instead of being able to select a single contact, I need to be able to select multiple contacts (in the same launch of the intent). If a contact has multiple phone numbers, I need the user to be able to choose which phone number he wants to select. This feature is already present in my Samsung Android Phone (Running 2.3 Gingerbread) when I

Passing ArrayList<String> between tabs

心不动则不痛 提交于 2019-12-01 00:57:27
I'm not very clear about the Intent object and how to use it to pass data between Activities. In my application I have several tabs between which I want to pass ArrayList. Here is a sample code I plan to use, but I'm missing the part where the main activity catches the Intent and passes it to the new activity on start : 1. myTabs.java ==> This is where I think I need to add some code to pass the data between TabOne and TabTwo. For now it is just using the sample code of the TabActivity sample. public class myTabs extends TabActivity { /** Called when the activity is first created. */ @Override

Problem with Video recording after auto focus in Android

末鹿安然 提交于 2019-11-30 23:58:34
Im trying to build an app which tries to auto focus the camera before starting the video recording. Directly using MediaRecorder does not auto focus the camera. For that i am Using Camera and using the callback I can autofocus it. But providing this instance to the MediaRecorder gives me a lot of issues. Following is the code im using for recording public boolean startRecording() { try { mCamera.unlock(); mediaRecorder = new MediaRecorder(); mediaRecorder.setCamera(mCamera); mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mediaRecorder.setVideoSource(MediaRecorder.VideoSource