android

About lifecycle of activities

In my application I have several activities, the main screen has 4 buttons that each start a different activity. So one of them is a search activity, once it searches it shows you a result activity. This result activity can be reached from other activities, so in general something like this: Main activity -> Search activity -> Result ac...

Switch between speakerphone and headset on Android

Hi! I wish to know if there is a way, using which we can switch between the speaker and headset dynamically in an android application. I am using this sample code, I found online for my experiments final float frequency = 440; float increment = (float)(2*Math.PI) * frequency / 44100; // angular increment for each sample float angle =...

Determine the State given a Lat/Long using Google API in android

Is there a way to determine the State in which a given Lat/Long resides using the Google Api in Android? thx ...

Why doesn't setting clearTaskOnLaunch="true" cause OnCreate to be called?

My application works fine, once it is initialized in the OnCreate method of my View class. However, when I open my app after the Droid phone has been sitting idle all night, the OnCreate method is not being called. I use the OnCreate to initialize data, and that in turn initializes the GUI. The GUI clearly shows that OnCreate was not ...

ListView with images and text

Hi! What's the way to create a listview with images on the left side and text right after it? (Note: the images were previously downloaded from the Net) Thanks in advance! ...

Android - TimePicker minutes to 15

Hi, Can I control the Android TimePicker view to just show the minutes to 15 minutes interval? Meaning if it's 12:28 now, show 12:30 and clicking the + and - button will increment and decrement by 15? Thank you, Tee ...

Is there a way to hide the Android Device Chooser?

Whenever I run my app I get the Android Device Chooser dialog: This is happening because I am using the Google APIs for 1.6 and trying to run the application on my Nexus one. Is there any way to make this automatically, or to not check the compatibility? Sometimes when I make a modification and quickly after I save and run the applica...

Abort SAX parsing mid-document?

I'm parsing a very simple XML schema with a SAX parser in Android. An example file would be <Lists> <List name="foo"> <Note title="note 1" .../> <Note title="note 2" .../> </List> <List name="bar"> <Note title="note 3" .../> </List> </Lists> The ... represents more note data as attributes that aren't important to question. I use a S...

Null Validation on EditText box in Alert Dialog - Android

Hi, I am trying to add some text validation to an edit text field located within an alert dialog box. It prompts a user to enter in a name. I want to add some validation so that if what they have entered is blank or null, it does not do anything apart from creating a Toast saying error. So far I have: AlertDialog.Builder alert =...

Android - making a layout like Entourage/Outlook calendar

Hi, I'm trying to build a layout / view like the Entourage/Outlook calendar view, where when I schedule a time block, a new view will popup overlaying the time block. Something like this one except it's daily and not monthly like in the image http://images.appleinsider.com/office-2008-entourage-10.png What is the best way to implement ...

Android paid applications

There are a few apps on the market that are set up to have a free main component(which is a trial limited to 7 days lets say) then "recharge" apps that will add a certain amount of subscription time to an account for the user that allows them to keep using the main app. These "recharge" apps are available in the market as well. What I wo...

Supply some basic auth credentials to a WebView?

Hi, I have a WebView. I'd like to show some page from my server, but I require some basic authentication. Is there a way I can specify basic auth credentials when calling WebView.loadData() somehow? I can do this on iphone with the equivalent webview class, thinking maybe same is possible with android? Thanks ...

Android - TimePicker selecting the button and input field

Hi, I'm trying to modified the way TimePicker works as asked in my question here http://stackoverflow.com/questions/2580216/android-timepicker-minutes-to-15 To be able to do that I need to know if the + and - button was clicked and to disable the input field. So can I target the elements in a TimePicker? (i.e the + and - button and th...

Java / Android self naming

I am about to start developing an Android application and had a question if in Java there self naming. For instance say I had a variable named dog that held the value of scruffy. Could I then create a variable named scruffy from that variable. In PHP it would be $$dog. That would make a variable with the name scruffy. If this is possi...

Android Image Orientation Issue on Motorola Droid

Hi there, Our app uses the gallery pick action to grab an image from the device to upload to a new blog post. We're seeing on the Moto Droid that images taken in portrait are being sent back to the app in landscape orientation so the image is sideways. AFAIK this only occurs on the Droid. Found this via google, but we need the full si...

Assign width to half available screen width declaratively

Is it possible to assign a widget width to half the available screen width, and do it using declarative xml? thx patrick ...

Scaling VideoView on Android

I am creating a video player on android and am having trouble resizing the video. I am trying to make it so that when i click the video it goes to full screen covering everything and if i click again it goes back to the smaller size with other buttons on the screen. I have seen another similar problem and an answer from haseman (http://s...

Android - accessing an element in widget

Hi, I'm using hierarchyviewer to look through a widget that I'm using. (TimePicker). Now I can see that TimePicker contains id/decrement, id/increment and id/timepicker_input. How do I get a reference to id/timepicker_input for example? Tried my_picker.findViewWithTag("decrement"); but that returns null. Thanks, Tee ...

Android Debugging with Logcat and Emulator. Is it possible?

This is pretty simple: I'm using NetBeans on Linux with Android emulator 1.6. I have Logcat on my android phone, but the process of getting the messages to somewhere readable isn't smooth at all. Can someone tell me how to get Logcat running on the emulator? Is there anything I can do to see debug messages other then having to copy the ...

android: how to add an image button?

I am trying to replace my previous ugly text button with an imagebutton. However, after changing the XML file with the following ImageButton code, my application won't even start. Why? <ImageButton android:layout_height="fill_parent" android:id="@+id/refresh" android:src="@drawable/refresh" /> ...