android

Android button with different background colors

Hi, i want to change the background-color of a button using a selector-xml-file. My approach is basically the one from the example at the bottom this page: http://developer.android.com/guide/topics/resources/color-list-resource.html i have a res/color/button_text.xml which looks like this: <?xml version="1.0" encoding="utf-8"?> <selec...

What exactly is a ROM?

Hello. I began studying android and became curious what is a ROM. There are many pages that offer to download ROMs but what it is exactly from a developer's point of view is not quite clear. So what is it? Thanks! ...

Android: Detect when ScrollView has finished scrolling and bouncing back?

I have a ScrollView which has two hidden images, one at the top and one at the bottom. In between there is a bunch of visible content. What I need to do is make these images hidden by default but when you scroll all the way up or all the way down you could see them as you're scrolling. But then as soon as you stop scrolling it should ...

how to perform **zoom in** and **zoom out** for an image view with out changing its center position in android

In my app i have an image view how to perform zoom in and zoom out for that image with out changing its center position ...

Add header view or buttons Android

Hello all, I am new to Android as well as Java programming. I have done some work before I am posting this but if this post sounds rather trivial please do respond. Here is the scenario: I have a list view. This list view needs to have multiple views( 4 specifically). Initially I thought using tab-widget to get list views may serve the...

Android: How to let my users print data from the app.

I have some data in my app that consists of text and image. I want to allow my users to be able to print that data. Here are the options that I am thinking of: 1) Convert data into HTMl format and allow users to email and they can print from their desktop. This will be zip file with html and images. Pros: can be easily coded. Cons: not...

Unable to launch app in Android device

Hi I am unable to run my app on my android device. While launching the app it gives some IOException and cancel the app launching. Like this :(in console) [2010-09-18 02:45:53 - Lime] Android Launch! [2010-09-18 02:45:53 - Lime] adb is running normally. [2010-09-18 02:45:53 - Lime] Performing com.gtx.gpstrackinglime.splash activity la...

How to get Android MediaPlayer() to stop when app is closed?

Hello, My android app creates a MediaPlayer() and plays a looping song. I need to have it stop playing when the user leaves the app. I also need to get at the volume buttons somehow, to let users adjust the songs volume... Any Ideas? MediaPlayer mp; public void setupMediaPlayer() { mp = MediaPlayer.create(context, R.raw.song);...

Android error: savedInstanceState cannot be resolved

I'm writing a simple calculator app for Android but get the error "savedInstanceState cannot be resolved to a variable" at the end of the "onCreate" method. Any suggestions how to get rid of this error? My code looks as follows: package se.robert.kalkylator; import android.app.Activity; import android.os.Bundle; import android.view.Vi...

Does google maps in android allow any integration? Say long press on a point, or click an address.

I know you can embed the google maps view in an android activity, but is it possible to plug anything into the actual google maps app. say if somebody clicked on a result in the map, and instead of the standard screen show a list of options, like when you share an image. Like "tag this". Something like that. I can't seem to find any ...

Android or iPhone OS - Programmatically enabling/disabling certain functionality

Hi all, I asked this a while back and didn't get anything useful. I'm hoping now that Android has advanced a few releases, that there will be more options. Here are the things I'm trying to accomplish: Prompt for a PIN when you uninstall a particular app. This would have been set at install time by the user. Disable certain services (...

Android: Error inflating class

Hello, I'm new to Android development and I've been having an issue that I haven't been able to fix. I'm mostly using code from examples provided in the SDK so I'm not sure what's happening here. I'm simply trying to create a custom view GhostSurfaceCameraView that extends SurfaceView. Here's my class definition file GhostSurfaceCameraVi...

Attempt to stub android Activity class using PowerMockito throws RuntimeException "Stub!"

I found this example where they used PowerMock and EasyMock to stub/mock the Menu and MenuItem classes for android. I have been trying to do something similar with PowerMock and Mockito with the Activity class. I understand that a lot of the methods are final and that in the Android.jar they all just throw RuntimeException("Stub!"). I...

How to draw a section header in Android listview just like the Contacts app did ?

I know how to display it in the screen, but when I use the Contacts app in my phone, I found its alphabet section header can be fixed in the top when I scroll the list. How to make that happen? ...

UI Animation (Showing an arrow on top of everything else)

I'd like to show a large green arrow in front of all other views when the user clicks a button. The arrow should fade in, stay there for 1-2 seconds and fade out again. How would I go about programming this? I've looked at the animation examples but would like to confirm the way forward before I dive into programming something that won't...

Android Bouncing Options View?

What is the name of the view that is used to display options in the latest android contacts app? It's the one that after clicking on a contact picture slides in displays a few options in a horizontal line. ...

OpenGL ES render textures of non base 2 dimensions?

This is just a quick question before I dive deeper into converting my current rendering system to openGL. I heard that textures needed to be in base2 sizes in order to be stored for rendering. Is this true? My application is very tight on memory, but most of the bitmaps are not a perfect square. Does storing non-base 2 textures waste e...

setting z order of View with bringChildToFront()

I'm trying to set the z order of a UI element (i.e. a View) so that it will overlap another element, but calling ViewGroup.bringChildToFront() has a weird side effect....it moves the element to be the last item in the parent (the ViewGroup). Is this a bug, expected behavior, or what? More importantly, how can I set the z order or a Vie...

How to collapse Android notifications?

I'm sending a C2DM update to my Android app every 1/2 hour, which creates a Notification. Problem is, when I wake up in the morning I get 15 Notifications queued up in the status bar. How do I only keep the latest notification, overwriting previous ones? I tried looking at the C2DM documentation (http://code.google.com/android/c2dm/) ...

Android: Instantiate a Handler in a TimerTask within a Service

I'm trying to use a service to make a regular call to my API. The asynchronous class I use to make external HTTP calls returns information to a handler which is passed in. A simplified version below dies on the line where the Handler is instantiated (without a stack trace). Any idea why? Is there a better way I should be doing this? pa...