android

Progressdialog slow to show in Android

Hi all, I'm sure this is a simple threading issue but... I'm starting a ProgressDialog using: ProgressDialog.show(Example.this, " " , " Loading. Please wait ... ", true,true); Then running a block of code to download and parse XML. The problem I'm having is that this is all running under a onClick button method, and that the xml is ...

Sharing sqlite database between multiple Android Activities

Can two or more Android Activities open an sqlite3 database for write? I have two Activities that need to insert data into the same sqlite database. When the second Activity calls SQLiteOpenHelper.getWriteableDatabase() an IllegalStateException is thrown with the message "SQLiteDatabase created and never closed". I've been able to av...

Android - ListView autogrow is not working as expected

This is continuation to the question I already asked a while back. I've been offered a solution which is not really working. Anyway - here's the problem/question I look at some posts from the past and it seems that if I add items to the ListView adapter it should update itself and user should be able to scroll to the newly appended item...

How to make a phone call in android and comes back to my activity when call is done

Hi, I am launching an activity to make a phone call, but when I pressed the 'end call' button, it does not go back to my activity. Can you please tell me how can I launch a call activity which comes back to me when 'End call' button is pressed? This is how I'm making the phone call: String url = "tel:3334444"; Intent intent = ...

Android: Event handlers for a custom view? (QUESTION REVISED)

OLD QUESTION (Already answered by Mark - The answer is to use getTag()): Let's say I have a ListView with a custom layout for each row having an ImageView and a TextView. Now, when a click is made, I am able to determine which image and which textview were clicked based on the view but if I have to pass this information to say another ...

Android GPS cloud of confusion!

I am trying to design my first Android application with the use of GPS. As of right now, I have a drawable button that when clicked, alerts a Toast message of the longitude and latitude. I have tried to use the telnet localhost 5554 and then geo fix #number #number to feed in values but no results display just 0 0. I have also tried DDMS...

Android, how to get information on which activity is currently showing (in foregorund)?

Hi, I wonder if there is a way to get information on which activity currently has focus (is in the foreground)? I am using instrumentation and I would like to know which activity is currently running in the application that I am testing against. Thanks ...

Not able to read contact's all values

Hi, I have made an application of reading all contacts and its values from android address book, but i am not able to read all the vlaues of contact. Currently i am getting only its name and mobile number. How can i get its all phone numbers,all eamil values and address values ? Thanks in advance... ...

Android WebView crashes when clicking on a link.

Hi I have some WebView widgets inside my Activity. I use loadData() to set the content, and this html contains a link. Some of my WebViews work okay, when I click the link, the web browser is started in a new window, but some make my app crash when I click on a link. 10-13 08:45:24.257: ERROR/AndroidRuntime(751): Uncaught handler: thre...

button question

I have recently started on android. i have written this piece of code import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class ArrangeMe extends Activity { private Button button1; /** Called when the activity is first c...

How to check internet access on Android? InetAddress never timeouts...

I got a AsyncTask that is supposed to check the network access to a host name. But the doInBackground is never timed out. Anyone have a clue? public class HostAvailabilityTask extends AsyncTask<String, Void, Boolean>{ private Main main; public HostAvailabilityTask(Main main){ this.main = main; } protected Boolean doInBackground(S...

Android: What care should I take when using a View's setTag() property?

Because Java uses object references and not objects themselves, what prevents me from using setTag() to tag a view with an entire object instead of an object's property? Is it just the attribute lookup time when trying to resolve one of the attributes after the getTag() call or is there any other specific thing I should be concerned abou...

Android: How do I deal with storing Bookmarks?

I am essentially using a listview but am looking at providing a bookmark functionality. I am thinking that I should store the item attributes in a file when bookmarked and retrieve when required to populate a bookmark listview. I was wondering if there is a de facto standard used in achieving this or do I follow just the "writing into ...

How to monitor HTTP(S) traffic / URLs in Android?

I'm interested in whether there is a way to monitor HTTP(S) traffic on an Android phone? What I would like to do is to be able to retrieve all URLs that have been accessed on the phone's browser. I thought that there would be a browser intent for that, but have not seen anything - given I'm green, maybe I just did not know where to look?...

Android: ProgressDialog.show() crashes with getApplicationContext

I can't seem to grasp why this is happening. This code: mProgressDialog = ProgressDialog.show(this, "", getString(R.string.loading), true); works just fine. However, this code: mProgressDialog = ProgressDialog.show(getApplicationContext(), "", getString(R.string.loading), true); throws the following exception: W/WindowManager( 56...

Android: Animation in Gallery View?

When I use the Gallery widget, how do I get the images to say scale up & glow on being selected and scaled down & un-glow on being unselected? All the tutorials I've seen have this effect but I am not able to see it... Is there some kind of an animation that I have to attach to the Gallery? ...

How to determine if an Android phone can capture video?

Android 1.6 supports video capture, however, not all phones will support video capture. Is there a way I can tell if the phone I am running on supports video capture or not? ...

Android - ListView duplicate events

In my app I have a ListView backed by ArrayAdapter. In it I'm detecting events in OnScrollListener#onScroll method to find end of the list. I noticed that on the phone (MyTouch) both track-ball and gesture/touch scrolling will trigger the event twice. On the emulator I get the same behavior with a scrolling wheel and click-and-drug scrol...

Android: Special url to open Marketplace to a specific app?

Hi, Is there a url format available such that clicking on the url will open the Android (Gphone) Marketplace to a particular app's page for installation? Does it work with the 'current' Android OS ver in the wild? Eg, can I put something on my customized Android website better than Please open the Marketplace application, search for...

Android: Simulate WiFi in the emulator?

I would like to check from my app whether the device has WiFi connectivity, but in order to do that, I must first find a way to get "WiFi" in the emulator. Just going to Settings -> Wireless controls -> Wifi says Unable to start Wi-Fi, while logcat says: E/WifiService( 566): Failed to load Wi-Fi driver. D/SettingsWifiEnabler( 695): Re...