android-sdk-2.1

Camera.Parameters.FLASH_MODE_TORCH replacement for Android 2.1

我的梦境 提交于 2019-11-27 08:30:24
I am trying to write an app that requires the LED flash to go into torch mode. The problem is, Android 2.1 does not support this mode and therefore I cannot support the platform yet. Wouldn't be an issue, but I am writing it for my fiance and her Epic 4G only has 2.1 right now. I found some code samples that use some undocumented API calls and therefore work on the Motorola Droid and such, but they do not work on the Epic. Does anyone have some suggestions on where to look to find code that should help me get this working? mmeyer I'm finding that torch mode is generally working fine on 2.1 but

How do I use PackageManager.addPreferredActivity()?

柔情痞子 提交于 2019-11-27 00:52:01
问题 In SDK 1.5 I was using the PackageManager class to set the preferred home screen to be my app using PackageManager.addPackageToPreferred(). In the new SDK (using 2.1) this has been deprecated so I'm trying to use addPreferredActivity() for the same result but it's not working as expected. Some necessary background. I'm writing a lock screen replacement app so I want the home key to launch my app (which will already be running, hence having the effect of disabling the key). When the user

How can I open android browser with specified POST parameters?

血红的双手。 提交于 2019-11-26 17:49:40
I my application, I need to open a link in Android Browser. This page can receive some data just via POST. Could I add these parameters (data) to the intent which start the browser? Do you know if this is possible? If it is, could you give my a hint? Use a webview: WebView webview = new WebView(this); setContentView(webview); byte[] post = EncodingUtils.getBytes("postvariable=value&nextvar=value2", "BASE64"); webview.postUrl("http://www.geenie.nl/AnHeli/mobile/ranking/demo/index.php", post); Intents sent to the browser can contain more than just a URL. In older versions of android it was

How to use Front Facing Camera on Samsung Galaxy S

拜拜、爱过 提交于 2019-11-26 16:32:30
问题 I've tried several answer I've found across the web, such as: Camera.Parameters parameters = mCamera.getParameters(); parameters.set("camera-id", 2); mCamera.setParameters(parameters); or mMediaRecorder.setVideoSource(2); But it doesn't work. I've also set permissions on the manifest file: <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" /> Am i missing out on something? I've searched StackOverflow and I know this has been asked

android camera surfaceview orientation

蓝咒 提交于 2019-11-26 15:01:57
Ok so I have a class that extends SurfaceView and overrides surfaceChanged - just calls startPreview surfaceCreated - opens camera, edits params *, sets surfaceHolder surfaceDestroyed - calls stopPreview, release camera this all work great because when the orientation is Portrait: from surfaceCreated * m_camera = Camera.open(); Camera.Parameters p = m_camera.getParameters(); if (getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) { p.set("orientation", "portrait"); // CameraApi is a wrapper to check for backwards compatibility if (CameraApi

Camera.Parameters.FLASH_MODE_TORCH replacement for Android 2.1

谁都会走 提交于 2019-11-26 14:09:27
问题 I am trying to write an app that requires the LED flash to go into torch mode. The problem is, Android 2.1 does not support this mode and therefore I cannot support the platform yet. Wouldn't be an issue, but I am writing it for my fiance and her Epic 4G only has 2.1 right now. I found some code samples that use some undocumented API calls and therefore work on the Motorola Droid and such, but they do not work on the Epic. Does anyone have some suggestions on where to look to find code that

Creating Custom Overlay on the map

坚强是说给别人听的谎言 提交于 2019-11-26 10:24:44
问题 I am trying to replicate this feature of Maps in Android: You can see that on the map, there\'s a Circle depicting the range that the user has selected. In my application, I\'ll also want a dragger to reside on the perimeter of the circle, which can be dragged to redefine radius. If someone could tell me how to draw custom drawable overlays and 2D graphics over map, I can do other things on my own. Thanks! The full application can be reached at this link 回答1: Okay, I tried to do things on my

How can I open android browser with specified POST parameters?

橙三吉。 提交于 2019-11-26 05:36:16
问题 I my application, I need to open a link in Android Browser. This page can receive some data just via POST. Could I add these parameters (data) to the intent which start the browser? Do you know if this is possible? If it is, could you give my a hint? 回答1: Use a webview: WebView webview = new WebView(this); setContentView(webview); byte[] post = EncodingUtils.getBytes("postvariable=value&nextvar=value2", "BASE64"); webview.postUrl("http://www.geenie.nl/AnHeli/mobile/ranking/demo/index.php",

android camera surfaceview orientation

◇◆丶佛笑我妖孽 提交于 2019-11-26 04:07:49
问题 Ok so I have a class that extends SurfaceView and overrides surfaceChanged - just calls startPreview surfaceCreated - opens camera, edits params *, sets surfaceHolder surfaceDestroyed - calls stopPreview, release camera this all work great because when the orientation is Portrait: from surfaceCreated * m_camera = Camera.open(); Camera.Parameters p = m_camera.getParameters(); if (getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) { p.set(\"orientation\", \

Post multipart request with Android SDK

北慕城南 提交于 2019-11-25 22:38:14
问题 I\'m trying to do something I thought would be relatively simple: Upload an image to a server with the Android SDK. I\'m found a lot of example code: http://groups.google.com/group/android-developers/browse_thread/thread/f9e17bbaf50c5fc/46145fcacd450e48 http://linklens.blogspot.com/2009/06/android-multipart-upload.html But neither work for me. The confusion I keep running into is what is really needed to make a multipart request. What is the simplest way to have a multipart upload (with an