android

How do I prevent Application Switch popup from being displayed?

I notice that in the emergency dialer of HTC Sense, application switch popup (menu) is disabled for the long press of the Home button. Would some one in the know point me how this is done? Also related: I notice that Toddler Lock modified the icons on the application switch popup (menu). Again, how do I go about doing that? Suggestions...

What's the default timeout of using HttpGet and DefaultHttpClient?

The code is like below. If I don't set any timeout parameters, what is the default time out for "new DefaultHttpClient().execute(mConnection)"? mConnection = new HttpGet(mURL); mResponse = new DefaultHttpClient().execute(mConnection); Thanks. ...

Countdown Timer Problem

I am working with a countdown timer and have it set so that it is able to be set by the user. When the timer gets to 00:00 its supposed to say "done!". For some reason I'm getting the "done!" right after I start the timer. After hitting pause and resume it shows my counter counting down but I'm not so sure that customers are gonna be coo...

Create only one instance of Service (Android)

How can I make sure that only one instance of Service is created? I have checked some functions with logging (WeatherService is the class who extends Service): Log.i(TAG, "Start Id:" + WeatherService.this.hashCode()); Log.i(TAG, "End Id:" + WeatherService.this.hashCode()); It gives different hash codes even when I am sure that the s...

Android 2D Graphics - Dragging an Image onto Another Image

Hi, This is just a "where do I start" question, really. I'm working on an app where you dress up a 2D ragdoll from a selection of body parts. The aim is that the user will have a sillouhette figure on one side, and a selection of arms, legs, heads and bodies that they can sort through on the right. They can drag an image from the rig...

Loading a resource to a mutable bitmap

I am loading a bitmap from a resource like so: Bitmap mBackground = BitmapFactory.decodeResource(res,R.drawable.image); What I want to do is make some changes to the bitmap before It gets drawn to the main canvas in my draw method (As it would seem wasteful to repeat lots of drawing in my main loop when it isn't going to change). I a...

Android: Adding a button on a status bar notification

I am trying to create a custom status bar notification in Android that has a button in addition to the text. The button can do a different thing than when you click the notification itself. Is this possible at all? I'd also be ok putting an image of a button there instead. I know how to put an image, but not sure how to handle OnClick fo...

When switching tabs in Android, what does it constitute?

I have three tabs and each one is its own activity. When I switch tabs I want my Spinner to update but I don't know what method gets called on tab switch. Any help? ...

Camera preview problem in Android

I have some problem with my Android code. I need to put camera preview in my app but just on small part of screen. I found on net example with inheritance of SurfaceView but that example cover all space on screen. Can anyone help? ...

What is the best method for an object to send a message to another for Android?

For example, say the main Activity has an custom object foo with a method called bar. When foo.bar() is called via the activity, it does a bunch of things on a thread and when it is finished it would somehow alert the main ui thread, the activity, it's parent that it is finished. I imagine this working the same way an event like a On...

Custom ImageView with drop shadow

Okay, I've been reading and searching around, and am now banging my head against the wall trying to figure this out. Here's what I have so far: package com.pockdroid.sandbox; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import...

ViewFlipper animation never ends ?

Hi, I have a ViewFlipper setup where my setInAnimation() and setOutAnimation() are referring to classes that I've extended from Animation. This is all working fine, but what I have noticed is that after all the visual animation has finished ( ie. flip completed ) and whenever I click on the layouts inside my ViewFlipper area, I am still...

mobile webapp CSS breaks on orientation change

The CSS for my webapp gets completely misaligned when the mobile device is rotated to landscape (target devices are iphone and android). I tried using the javascript solution explained here in order to get my app to switch between a portrait.css and a landscape.css file on orientation change, but that still didn't work. It even messed up...

Calling android.speech.RecognizerIntent API results in Connection Error dialog, shows 'calling_package' warning in log

I wrote a small app to allow the user to choose which language he uses the Voice Search via a button, rather than relying on the user's language preference (sometimes you want to voice search in Japanese without switching your whole UI to Japanese). I am testing the app on my HTC Desire /Android 2.1 (Softbank-x06ht). However, when I cal...

Android Broadcast Receiver showing a dialog?

I've got an app that responds to an Alert - and I really need to show an alert with a password entry before going on to the next screen; the trouble is I don't seem to be able to show a dialog from a broadcast receiver -- so how can I show a dialog password entry upon receiving an alert? ...

How to compile Helloworld with Android source code.

I wanted to run a helloworld application with the AOSP and see it in emulator. [ Not through Android SDK setup] I followed the steps in http://source.android.com/source/download.html and compiled successfully the full code from / directory. I could see contacts.apk, camera.apk all applications apk in ~/mydroid/out/target/product/gener...

How to run a retry when download fails in AsyncTask using AlarmManager

Hey guys, I use an AlarmManager to run a Service which tries to download a file from the web. If it fails I'd like to retry that Service in 5 minutes. Inside the Service I run an AsyncTask to run my code. As far as I know the only way I can tell if it failed or not is from the onPostExecute(). What is the best way of implementing a re...

Slide down view in adnroid

I would like to have a button in my android application trigger a slide down view of a form. I want to have a view at the top of the screen, a list at the bottom of the screen, and I want to have the slide down form view appear between the two when a button is clicked. I have no problem showing the view, but can't seem to animate it fr...

Android: Unbuffered IO

I want to use an Non Blocking IO to read a stream/output from a background process.Can anyone give me an example on how to use the Non Blocking IO on Android? Thanks for the help. ...

How to implement a layer above a layout?

How to implement a layer above a layout? like this pic: http://ss12.sinaimg.cn/orignal/5d8cb30ag8f47eca43a5b&690 ...