android

Get an instance of activity that starts another from intent

Hi Is there a way to get an instance of the activity that has called the currently running activity from the intent object that has been passed to it? eg. if A has called B, I would like to retrieve A's instance from the intent in B's onCreate method. As Activity is not Serializable i am not able to pass the instance in the extras bundl...

How to use RelativeLayout and Right Of in a Custom adaptor

Hi, I am writint a custom adaptor for a ListView.. But have problem setting the Text Right of a Image.. Here is my code.. LinearLayout.LayoutParams iconParams = new LinearLayout.LayoutParams(25,25); //Icon Parameters this.actionIcon = new ImageView(context); this.actionIcon.setImageResource(R.drawable.vg...

How to redefine the scroll in a listview

Hi, I have a listview with headers as you can see here : http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/ I would like to redefine the scroll behavior, to always let the current header on the top of the list. So if I have 20 items under my header, the listview scrolls on these items, keeping the heade...

Get Pixel Values from Android Canvas

Hi, I'm currently writing an Android game using surfaceView. I've optimized the game as much as possible and it runs quite smoothly. However, I have collision detection incorporated which is a bit messy. I would like to do collision detection by reading pixels directly from the canvas. Is this possible to do? The closest to this that I ...

Are there Android tools that assist in creating content providers?

I see that there are many options for ORM tools: http://stackoverflow.com/questions/371538/any-good-orm-tools-for-android-development But do any of them help you to create Content Providers quickly? If not, what tools exist? ...

android- changes to be made in AndroidManifest.xml while calling intent

wat changes do i hav 2 make in AndroidManifest.xml if am calling an intent.... m calling Intent frm an Inner class method defined inside class which extends name test.java i wanna disply content mentioned in class named Test2.java...... n both classes r in same package..... n hw can i define textvies n radiobuttons n othr stuff on dat...

MediaPlayer.seekTo() does not work for unbuffered position

I use MediaPlayer for playing a single mp3 song from network. Data source is a HTTP URL. Let's assume we have following playing state. Song duration: 1:00 Current progress: 0:10 Current buffering progress 0:30 Let's say I want to skip some part of a song and seek forward. I do it with MediaPlayer.seekTo() method. If I seek to buffer...

Cheap android phone for development?

What android phone would you recommend for development purposes? Not to use as a main phone. ...

Android 2.0 and OpenGL ES 2.0 support

Hello, can I assume that, if a phone runs Android 2.0, it also supports OpenGL ES 2.0 and thus the graphic hardware has full support for programmable shaders? IOW, does Android 2.0 as a platform mandate OpenGL ES 2.0 support? Or is it optional? ...

how to implement request timeout in android?

friends, I'm running into an issue when i try to call webservice and the server/internet is not available. It appears that the connection is taking a long time to timeout can i set timout manually to show error messgage to user? any help would be appreciated. ...

Android server load advice

Hi, I'd like a bit of advice on how to retrieve, process and store data. I'm building an app which gets finds the nearest laser tag site to where you are. The adderss data is stored (due to some bad design) in one field in an external database, with it's country coming from another table (told you it was a bad design). I may change whe...

eclipse fails to "build workspace" on large android files...?

hi there! i have a severe problem with eclipse, where i need to compile a somewhat larger class. by "larger" i mean, the class has about 5000 lines of code... problem is that on saving this project, eclipse takes several seconds (30-40) to "build the workspace". to be exact, it says "50%" and keeps saying that for 30-40 seconds. then, ...

Android Search in Data

At the moment I want to have three columns in my database for Notes: ID | Title | Content The table could have a few hundred entries. I want to be able to search for parts of the content. When Content is "this is a test sentence" and the user searches for "test" or even "te" then the row should be displayed. Is it okay to store this i...

How to detect system information like os or device type

The most important things i want to know are the device type, the os version, if it has a hardware keyboard and maybe the screen resolution. but if you know other useful debug information please add them :) i found this for the os version: string+="OS Version: "+System.getProperty("os.version"); how do i get the other properties? ...

Accessing ringer mode does not work inside a service

I have an application that creates a notification with sound when a specific text comes in. To do this, I detect the current ringerMode, change the ringerMode to normal, play the sound, and then quickly return the ringer back to its original setting. Here is the code: public static AudioManager audio; audio = (AudioManager) this.ge...

ReentrantLock Exceptions

I'm developing for Android 2.2, and a bit confused as to how ReentrantLocks work. Can the following code ever throw an IllegalMonitorStateException? I ask because I don't see how it can--according to the API, tryLock returns true if and only if the lock is successfully obtained--but occasionally the unlock() command does. public voi...

Not able to use new resource identifiers in Android with targetSdkVersion defined in manifest

I'm developing an Android application that I'd like to be compatible with 1.5 (SDK version 4). I'm testing the application on 2.2 (SDK version 8). To do this, I'm including in the manifest file the line <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8" /> I thought this would allow me to use the newest manifest elements...

Creating a floating, editable and scrollable list in Android

I want to show a list of items when the user clicks an overlay item on a map. The user should be able to select any of these items and edit them. The list can have many items (more than that can fit in one active screen) therefore it needs to be scrollable. Any ideas will be appreciated. Thanks in advance. ...

[Android] Textview Selector when pressed

Hi all! I have a basic LinerLayout with a TextView and an ImageView I would like to do the same thing as with a button: when you click on this linear layout, the background changes. I can change the background when I focus the LinearLayout (with the trackball), but I can't when I click on it! And I don't know why. I tried a lot of thin...

Camera preview on Android - strange on Samsung Galaxy S

In my activity I show the camera preview on a surfaceView. It works perfectly fine on Nexus One and HTC Desire, but on Samsung Galaxy S I see strange lines, weird proportions and everything three times. see the Screenshot below. The issue seems to be similar to this one: http://stackoverflow.com/questions/2053440/camera-preview-on-andro...