android

Bitmaps in Android

I have a few questions regarding Bitmap objects and memory and their general taxonomy. What is an in-memory or native bitmap? How is Bitmap memory different from Heap memory? ...

digital compass problem

Hi, I am creating an augmented reality application and I noticed that the stored locations don't appear appear on the correct direction if I try to use the camera view (using layar or wikitude API). The problem is that the digital compass doesn't show north correctly when you try to look at the known objects through the camera view. If ...

android image cache

how to cache images after they are downloaded from web ...

How to set Content Type on HttpURLConnection ?

Hi guys. Do you know how to set Content-Type on HttpURLConnection? Following code is on Blackberry and I want the Android equivalent: connection.setRequestProperty("content-type", "text/plain; charset=utf-8"); connection.setRequestProperty("Host", "192.168.1.36"); connection.setRequestProperty("Expect", "100-continue"); Is it right...

Scrolling a TextView to a specific line

I have a TextView inside a ScrollView. Let's say the ScrollView is named s and the TextView is named t. I have many lines to be displayed in the TextView and at the same time I want to scroll the view to a specific line. So I did this: t.setText(aVeryLongString); int y = t.getLayout().getLineTop(40); // e.g. I want to scroll to line ...

Accoding to emulator Resolution how to change the activity(Screen) controls size according to screen Resolution in android ?

Hi, Accoding to emulator Resolution how to change the activity(Screen) controls size according to screen Resolution in android ? i have screen design like below it is working in HVGA(320x480) resolution progressbar is coming bottom of screen but if i run in other resolution emulator VM (WQVGA432 - 240x432) i am g...

Emulator - Loading App

I'm still learning how to use the dev tools. Using MotoDev which is Eclipse, I wrote a basic "hello world" app. When I run the program, the emulator starts up. It took a few restarts of the emulator and Eclipse until my Hello World icon appear in the emulator. I noticed at one point that a status message said it was sending over the ...

How to get Spinner value?

Is it be possible in the Android Hello, Spinner example to get the selected Spinner value with a listener, like for the other examples -- or do you need to subclass Spinner? ...

Is there a way to display a custom exception in an alert under Android?

I'm a newbie Android developer. I would like to know if there exists a way to listen for a custom exception in Android and display its text using an alert. Thank you. ...

PhoneStateListener memory leak - android

Hi, I am having issue with memory after running many times my app. java.lang.OutOfMemoryError: bitmap size exceeds VM budget I figure I was leaking memory somehow so I did a DUMP HPROF file and used the MAT tool to figure out what was wrong. It turns out that after running like 5 times the app and quiting, I find 5 instances of my Ac...

java.lang.OutOfMemoryError: bitmap size exceeds VM budget - android

Hi I developed an application that uses lots of images on android. The app runs once, fills the information on the screen (Layouts, Listviews, Textviews, ImageViews, etc) and user reads the information. There is no animation, no special effects or anything that can fill the memory. Sometimes the drawables can change. Some are android r...

Is there a way to fire an event when the contents of an EditText view have changed?

I can see keys on the device fire for a particular View with onKey, but this doesn't fire when keys on the software keyboard are pressed. I am trying to build a dynamic UI that recalculates a value as the input changes, while it's changing. Is there a way to capture either that the value of the EditText has changed? ...

.NET Framework on Android

Is anyone aware of any projects out there to port a version of the .NET framework to the Android platform, kind of like Mono.Touch? ...

Some files won't stream from lighttpd to Droid

We are running into some odd issues with streaming certain files in our app. After lots and lots of testing we've narrowed it down to what seems like some sort of issue between lighttpd and Droid, and it's not just our app but the built in player as well. If you point the Droid browser to http://stream29l.grooveshark.com/collinSong.mp3 ...

Can't connect to WCF service on Android

I am trying to connect to a .NET WCF service in Android using kSOAP2 (v 2.1.2), but I keep getting a fatal exception whenever I try to make the service call. I'm having a bit of difficulty tracking down the error and can't seem to figure out why it's happening. The code I am using is below: package org.example.android; import org.ksoap...

Getting my app to work on my phone

Hello I wrote an app android sdk version 1.5 using it's built in emulator in eclipse. I created a database outside of eclipse populated it with data and push it to the emulator folder data/data/project name/database and could access it fine from the my app, everything was working great. My final step was to test the apk file on an actua...

Is there a way to get copy-and-pastable debug output in the Android SDK Emulator?

I have some information generated in the Android Emulator, and the only way I can see to get it out is using the Log class. However, you cannot copy-and-paste from the DDMS log window. This is really annoying as I cannot use the information in another application, for example, without retyping it. Is there a better way to get debug inf...

Change button appearance when focus or click ?

Hi guys, I am trying to make a button with background image. <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5px" android:layout_gravity="center_vertical" android:id="@+id/button1" android:background="@drawable/imagename"> </Button> I wanna make it would be differ...

What all basic android gui elements are available?

I wanted to know the gui elements we have in android? Can anyone show me a picture as well like how do these elements look like? ...

defining a shape xml elemnt in drawable?

I dropped the following into the drawable directory in my Android 1.5 project: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gradient"> <gradient android:startColor="#FFFF00" android:endColor="#FFFFFF" android:angle="270"/> <corners android:radius="0dp" ...