android

How can I use a resource within a custom Xml resource file?

I have an XML resource file: <resources> <section> <category value="1" resourceId="@xml/categoryData1" /> <category value="2" resourceId="@xml/categoryData2" /> <category value="3" resourceId="@xml/categoryData3" /> </section> </resources> Using XmlPullParser, on the START_TAG, I can use: int value = p...

Contacts favorites search bar

I'd like to replicate the search bar in Contacts app > Favorites > Search (sans icon). Could someone give me a few tips? A linear layout maybe with some top, left and bottom padding, width is fill_parent, and a weight of 1? With a button next to it with some right padding? How do I make the button look like that? Is there a parameter I ...

When are views drawn in android?

I want to get the size of a view that is in my activity but I am not able to get that information in any of the activity lifecycle callbacks (onCreate, onStart, onResume). I'm assuming this is because the views have not been drawn yet. At what point are views drawn and is there a callback I can put my code so I can get the size of the v...

AMQP + Android libraries

Is any amqp libraries for Android? ...

Do Threads Add A Lot Of Overhead To An App?

As my app matures, I find myself finding more and more uses for threads. By now I must have about 25 threads, all doing important things and working together in symphony. I notice however that my app is sitting around 15.5MB resident. Compared to the browser (+/-35MB) I feel pretty safe, but I do notice the resident size of my app ever...

Android Signal Strength update while sleeping

Hello All! I've been working on a project that requires me to grab the rss signal strength from the phone while it's sleeping via a service that runs when an alarm is received. The problem is that once the phone goes to sleep it always reads the same signal strength until it's woken up again. I can get around this by forcing the phon...

Custom Views take forever to inflate; inflate before show next screen possible?

I have some custom views that load when I start an activity with an XML layout containing them. They can be found in another thread, here: http://stackoverflow.com/questions/3392351/custom-view-not-appearing . The custom views take forever to load, and the Logcat is throwing a million warnings. I am considering just using a text button ...

steps to install new android application onto new htc device.

I need to install an android application running in my local machine on to my new android htc handset, how to do this,and i also need to give this application to someones htc device who is not near to me. ...

Setting list item background color loses highlighting

Hi, I've created an inbox Activity and I'm mirroring some functionality of the default Mail application that comes with Android. In Mail, the background color of a message that has not been read is a lighter color than the rest of the items in the list. I've mirrored this by setting calling setBackgroundResource in the getView method ...

Does Android ensure that an Activity is a singleton?

If an Activity is a singleton in practice, I think I can gain some efficiency by declaring appropriate members "static", with zero risk. Yes? ...

Creating a custom dialog in Android

Hi All, I am trying to create a custom dialog in Android. But whatever I tried to do, I am not able to change the width of the dialog. It just remains the same. The following is the view that I am setting as the content for the dialog. <RelativeLayout android:id="@+id/current_stats" android:layout_width="wrap_content" android:layout...

setting Wallpaper in android

Hi there I am developing a simple app that sets wallpapers based on some user inputs ' I am almost done with my app , I am only missing the code for setting wallpapers . I have been looking for it in lots of websites in vain . Can anybody post a sample code that sets as a wallpaper a drawable that is saved in res folder. Thanks a lot ...

ERROR No package identifier when getting value for resource number

Both activities are in the same package Second activity uses second layout file setContentView(R.layout.main2); Errors on this line in the second activity EditText text1 = (EditText) findViewById(R.id.EditText03); Here is the layout file for the second activity <TextView android:id="@+id/TextView01" ...

Android APIDemos8 2.2 SavedRestorState does not save the state of the top text edit.

Android APIDemos8 2.2 SavedRestorState does not save the state of the top text edit. This demo does not work. The initial sate is returned to both the text views. The sequencing of the getSavedText() on line 87 doesn't get called on a onResume. ...

Will this cause memory leaks?

Hi, Will the following code cause a memory leak? Essentially I switch between various layouts in my application using setContentView(), and I have member variables of my activity that maintain references to various views (buttons/textviews...) on the layouts. Am I correct in thinking that if the activity class has a reference to a but...

Changing WiFi User

I have an situation where multiple people will be using the same Android device. We want to track the data each user recorded with the device. How can I change the WiFi Login based on information entered by the user? ...

CDATA XML is truncated while parsing

Hi, I'm using a SAX parser (on android) to parse an xml file from an WebService. On some elements the CDATA is truncated and not complete, e.g. the XML-file contains data like <name><![CDATA[Gölsder und Ginck GmbH]]></name> and after parsing the xml file with public void characters(char[] ch, int start, int length) throws SAX...

How can I open another app from inside the android default the browser?

When on android default browser long press on the back key opens the history tab. Is there a way to open my own app instead of the history tab by similar user action? ...

Close virtual keyboard on button press

Hi, I have an Activity with an EditText, a button and a ListView. The purpose is to type a search screen in the EditText, press the button and have the search results populate this list. This is all working perfectly, but the virtual keyboard is behaving strange. If I click the EditText, I get the virtual keyboard. If I click the "D...

pathPattern to match file extension does not work if a period exists elsewhere in the file name?

I see numerous examples of using pathPattern to define an intent-filter for a specific file extension/type; for example, pathPattern=".*\\.xyz". Unfortunately, this does not appear to work properly if the file in question has a period elsewhere in the path; for example "my.filename.xyz". Is there a pathPattern syntax that will match...