android

Did back key destroy an activity?

I have an activity defined as below: <activity android:name="com.example.ui.HomeActivity" android:alwaysRetainTaskState="true"/> A strange thing is that, when running on emulator, and the back key is pressed, the activity was destroyed (I saw onDestroy() called in log). But when running on my Nexus One phone, and the back ...

Query regarding handlers in Android

Hi All, In my application, I have two different activities and both are list activities. I use a SimpleAdapter for each activity and each adapter binds to an arraylist during the onCreate. Both arraylists are present in a different class. Now if there is any change in the arraylists, I have to notify the corresponding activity. I curre...

android Quick Search Box problem

Hi, i want to add a QSB in my activity which will show search result from a list of string variables with in my activity.Can anyone know how can i do this. Thanks in advance.... ...

Can an Android process host multiple Dalvik VM's?

Can an Android process ever host multiple Dalvik VM's? If so, what scenarios can cause this to occur, and what would be the benefit of having multiple VM's in the same process? ...

Placing Phone Calls To Android Phone From A Program over Bluetooth

I am kicking around the idea of installing a netbook in my car, and I'd like to write an app (C# and WPF based) that would essentially be a gigantic phone interface connected via bluetooth to my Android phone (Nexus 2.2). There was already a similar question asked here, however based on a google search and response here I guess it's not ...

how to to pop up and ask for user input on android after receiving broadcast

hey, im new to android development and trying to make my first application. What im trying to implement is a feature i've seen in Handcent SMS: the popup notification. So far, my application has a broadcast receiver that uses Toast to display an incoming SMS message. However, instead of a Toast notification, I want to make a pop up wi...

How can I query contact information based on a phone number

Hi, I am trying to query contact information based on a phone number on android 1.6. This is the code I tried. But I get count equals to 0 in my cursor. String selection = "PHONE_NUMBERS_EQUAL(" + People.Phones.NUMBER + " , " + phoneNumber + ")"; Cursor cursor = mContext.getContentResolver().query(People.CONTENT_URI, ...

Android - ListView inside Gallery makes the scrolling not Smooth

Hi I implemented a gallery, and inside it I have many listviews from left to right. For some reason Gallery works great with all views but not with listview. With listview, when scrolling on the gallery, sometimes I get little jumps. Anyone have an idea on how to solve this? some notes: The gallery uses an adapter to find out what to...

Android - create Layout like the iphone weather app

Hi I am trying to do a layout similar to the one used in iphone for the weather app: http://www.spirituality.org.za/uploaded_images/MTN-South-Africa-iPhone-Weather-app-719447.jpg This layout scrolls left/right very smoothly, and only loads the weather as you scroll. HorizontalScrollView cant be used because it loads everything in memo...

Android store array in preferences

I know only primitives can be stored in the android preferences, but do arrays count? Can I store an array of, say, Strings or booleans in an android preference? ...

detect if contact has photo

ive got an imageview which im displaying a contacts picture using a uri which always looks similar to this: content://com.android.contacts/contacts/34/photo how would i be able to detect whether this photo exists, as if it doesnt then i want to use a placeholder instead (stored in my drawable folder). at the moment it just shows a ...

Android WebView - Intercept clicks

I have written a simple helloworld app with a WebView which has a link to Cnn on a simple.html page in my asset folder. <a href="http://cnn.com"&gt;cnn.com&lt;/a&gt; How, in my Activity do I capture the click on this, stop the WebView from navigating, and then informing the Activity that "http://CNN.com" was clicked? ...

android RelativeLayout, trying to vertically center a TextView when the TextView below has no text

I have a ListView that contains an Image on the left of two vertically-oriented TextViews using a RelativeLayout. When both TextViews have text it looks fine. Sometimes the TextView on the bottom won't have any text, and the problem is that the entire layout is several pixels above where it should be because it still reserves that space ...

Fast undo/redo with memento/command pattern?

I'm writing a painting/graphics Java application for a mobile phone (so memory is limited). The application state is essentially three 1000x500 bitmaps (i.e. layers of a painting). Loading three bitmaps takes about 2 or 3 seconds. I'm trying to write an undo engine but I just cannot work out a good way to do it. The typical approaches a...

how to react to an intent of the browser?

Yo guys. You know when u do options/more/share page from the browser? Well I'd like an activity of mine to show up in the menu of all the apps capable of responding to that browser's intent. Thing is I dunno how to write the intent filter in the manifest. Also how do I access data like URL and title of the page which are supposedly add ...

What's the secret to hosting custom KML for use in Google Maps Mobile?

I am new to Android and so I may be missing some very basic things here. I am trying to host custom KML files on a server behind my firewall and display those KML files on the Android emulator. I started by writing a simple app that uses an Intent to display the overlay and pointing the app at geo:0,0?q=http://code.google.com/apis/kml/...

Background Image in RelativeLayout has artifacts.

Hi all, I created a background .png for my application in GIMP. It's resolution is 640x480, which from googling, seems to be the resolution for a default emulator. My problem is when I apply the background to the RelativeLayout with android:background=@drawable/bg and run it, there are lots of artifacts in the image. As if the emulator ...

Creating java inline(?) methods

I'm not sure what it's called exactly, but I was wondering how you can create a class which you can call multiple methods on in one call. For example, using an android class but it doesn't really matter, you can call all of the class' methods at once: AlertDialog.Builder().setItem().setTitle().setPositiveButton().setCancelable() ...etc...

Get pixel value from an Android display?

I'm not even concerned with the camera per se. I want at the closest thing to the display screen. Meaning: it could even be the desktop the user is looking at, completw w/ the background and the icons she moves back and forth. Let's say, at time t=1 sec, the app goes to pixel (78, 300) on that display and obtains its value. What m...

music website: how to make it work on android/blackberry/iphone/symbian?

Hello, How can I make my simple site, on which the user can choose to play a number of music clips by clicking on little "play" buttons on the page (think of Amazon's "preview" on their product pages for CDs), work on mobile devices? [I originally created the page thinking only of desktop browsers, so currently it works by using Flash...